This is an attempt at providing clearer names as discussed here: https://github.com/linuxppc/issues/issues/164
as well as providing better behavior for RTAS_BUSY (-2) and small extended delay values, which in my experience seem more common than the larger ones. In testing PREEMPT_NONE kernels with CPUs busy, I see the elapsed time for memory add operations roughly halved, while memory remove operations' elapsed time shrinks by about ~25%. This is achieved without significantly more time spent on CPU: (- is before, + is after) Performance counter stats for 'drmgr -c mem -a -q 10' (10 runs): - 1,898 probe:rtas_call # 0.003 M/sec ( +- 2.20% ) - 751.57 msec task-clock # 0.289 CPUs utilized ( +- 1.56% ) + 1,969 probe:rtas_call # 0.003 M/sec ( +- 2.69% ) + 766.20 msec task-clock # 0.688 CPUs utilized ( +- 1.99% ) - 2.605 +- 0.148 seconds time elapsed ( +- 5.70% ) + 1.1129 +- 0.0660 seconds time elapsed ( +- 5.93% ) Performance counter stats for 'drmgr -c mem -r -q 10' (10 runs): - 673 probe:rtas_call # 0.002 M/sec ( +- 0.55% ) - 318.36 msec task-clock # 0.234 CPUs utilized ( +- 0.42% ) + 692 probe:rtas_call # 0.002 M/sec ( +- 0.73% ) + 320.87 msec task-clock # 0.309 CPUs utilized ( +- 0.34% ) - 1.362 +- 0.100 seconds time elapsed ( +- 7.37% ) + 1.0372 +- 0.0468 seconds time elapsed ( +- 4.51% ) Questions / concerns / to do: * I don't love the new API function names. * Introduces three new APIs when two likely would suffice. * Need to convert eeh_pseries and scanlog. * rtas_busy_delay() and rtas_busy_delay_time() not yet removed. Nathan Lynch (10): powerpc/rtas: new APIs for busy and extended delay statuses powerpc/rtas: do not schedule in rtas_os_term() powerpc/rtas-rtc: convert get-time-of-day to rtas_force_spin_if_busy() powerpc/rtas-rtc: convert set-time-of-day to rtas_sched_if_busy() powerpc/pseries/fadump: convert to rtas_sched_if_busy() powerpc/pseries/msi: convert to rtas_sched_if_busy() powerpc/pseries/iommu: convert to rtas_sched_if_busy() powerpc/pseries/dlpar: convert to rtas_sched_if_busy() powerpc/rtas: convert to rtas_sched_if_busy() powerpc/rtas_flash: convert to rtas_sched_if_busy() arch/powerpc/include/asm/rtas.h | 4 + arch/powerpc/kernel/rtas-rtc.c | 38 +--- arch/powerpc/kernel/rtas.c | 178 ++++++++++++++++++- arch/powerpc/kernel/rtas_flash.c | 4 +- arch/powerpc/platforms/pseries/dlpar.c | 2 +- arch/powerpc/platforms/pseries/iommu.c | 2 +- arch/powerpc/platforms/pseries/msi.c | 4 +- arch/powerpc/platforms/pseries/rtas-fadump.c | 22 +-- 8 files changed, 190 insertions(+), 64 deletions(-) -- 2.30.2