Commit 3dcac25
Peter Zijlstra
sched/core: Introduce SM_IDLE and an idle re-entry fast-path in __schedule()
Since commit b2a02fc ("smp: Optimize
send_call_function_single_ipi()") an idle CPU in TIF_POLLING_NRFLAG mode
can be pulled out of idle by setting TIF_NEED_RESCHED flag to service an
IPI without actually sending an interrupt. Even in cases where the IPI
handler does not queue a task on the idle CPU, do_idle() will call
__schedule() since need_resched() returns true in these cases.
Introduce and use SM_IDLE to identify call to __schedule() from
schedule_idle() and shorten the idle re-entry time by skipping
pick_next_task() when nr_running is 0 and the previous task is the idle
task.
With the SM_IDLE fast-path, the time taken to complete a fixed set of
IPIs using ipistorm improves noticeably. Following are the numbers
from a dual socket Intel Ice Lake Xeon server (2 x 32C/64T) and
3rd Generation AMD EPYC system (2 x 64C/128T) (boost on, C2 disabled)
running ipistorm between CPU8 and CPU16:
cmdline: insmod ipistorm.ko numipi=100000 single=1 offset=8 cpulist=8 wait=1
==================================================================
Test : ipistorm (modified)
Units : Normalized runtime
Interpretation: Lower is better
Statistic : AMean
======================= Intel Ice Lake Xeon ======================
kernel: time [pct imp]
tip:sched/core 1.00 [baseline]
tip:sched/core + SM_IDLE 0.80 [20.51%]
==================== 3rd Generation AMD EPYC =====================
kernel: time [pct imp]
tip:sched/core 1.00 [baseline]
tip:sched/core + SM_IDLE 0.90 [10.17%]
==================================================================
[ kprateek: Commit message, SM_RTLOCK_WAIT fix ]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Not-yet-signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20240809092240.6921-1-kprateek.nayak@amd.com1 parent b2d7022 commit 3dcac25
1 file changed
Lines changed: 26 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6410 | 6410 | | |
6411 | 6411 | | |
6412 | 6412 | | |
6413 | | - | |
6414 | | - | |
6415 | | - | |
| 6413 | + | |
6416 | 6414 | | |
6417 | | - | |
6418 | | - | |
6419 | | - | |
6420 | | - | |
6421 | | - | |
6422 | | - | |
6423 | | - | |
6424 | | - | |
6425 | | - | |
| 6415 | + | |
| 6416 | + | |
| 6417 | + | |
| 6418 | + | |
6426 | 6419 | | |
6427 | 6420 | | |
6428 | 6421 | | |
| |||
6463 | 6456 | | |
6464 | 6457 | | |
6465 | 6458 | | |
6466 | | - | |
| 6459 | + | |
6467 | 6460 | | |
6468 | 6461 | | |
| 6462 | + | |
| 6463 | + | |
| 6464 | + | |
| 6465 | + | |
| 6466 | + | |
6469 | 6467 | | |
6470 | 6468 | | |
6471 | 6469 | | |
| |||
6476 | 6474 | | |
6477 | 6475 | | |
6478 | 6476 | | |
6479 | | - | |
| 6477 | + | |
6480 | 6478 | | |
6481 | 6479 | | |
6482 | 6480 | | |
6483 | 6481 | | |
6484 | 6482 | | |
6485 | | - | |
| 6483 | + | |
6486 | 6484 | | |
6487 | 6485 | | |
6488 | 6486 | | |
| |||
6511 | 6509 | | |
6512 | 6510 | | |
6513 | 6511 | | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
6514 | 6515 | | |
6515 | 6516 | | |
6516 | 6517 | | |
6517 | 6518 | | |
6518 | 6519 | | |
6519 | | - | |
| 6520 | + | |
| 6521 | + | |
| 6522 | + | |
| 6523 | + | |
| 6524 | + | |
| 6525 | + | |
6520 | 6526 | | |
6521 | 6527 | | |
6522 | 6528 | | |
| |||
6547 | 6553 | | |
6548 | 6554 | | |
6549 | 6555 | | |
| 6556 | + | |
6550 | 6557 | | |
6551 | 6558 | | |
6552 | 6559 | | |
| |||
6588 | 6595 | | |
6589 | 6596 | | |
6590 | 6597 | | |
6591 | | - | |
| 6598 | + | |
6592 | 6599 | | |
6593 | 6600 | | |
6594 | 6601 | | |
| |||
6664 | 6671 | | |
6665 | 6672 | | |
6666 | 6673 | | |
6667 | | - | |
| 6674 | + | |
6668 | 6675 | | |
6669 | 6676 | | |
6670 | 6677 | | |
| |||
6709 | 6716 | | |
6710 | 6717 | | |
6711 | 6718 | | |
6712 | | - | |
| 6719 | + | |
6713 | 6720 | | |
6714 | 6721 | | |
6715 | 6722 | | |
| |||
0 commit comments