mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 07:53:11 -05:00
1d6d399223
1) Per-CPU kthreads must stay affine to a single CPU and never execute relevant code on any other CPU. This is currently handled by smpboot code which takes care of CPU-hotplug operations. Affinity here is a correctness constraint. 2) Some kthreads _have_ to be affine to a specific set of CPUs and can't run anywhere else. The affinity is set through kthread_bind_mask() and the subsystem takes care by itself to handle CPU-hotplug operations. Affinity here is assumed to be a correctness constraint. 3) Per-node kthreads _prefer_ to be affine to a specific NUMA node. This is not a correctness constraint but merely a preference in terms of memory locality. kswapd and kcompactd both fall into this category. The affinity is set manually like for any other task and CPU-hotplug is supposed to be handled by the relevant subsystem so that the task is properly reaffined whenever a given CPU from the node comes up. Also care should be taken so that the node affinity doesn't cross isolated (nohz_full) cpumask boundaries. 4) Similar to the previous point except kthreads have a _preferred_ affinity different than a node. Both RCU boost kthreads and RCU exp kworkers fall into this category as they refer to "RCU nodes" from a distinctly distributed tree. Currently the preferred affinity patterns (3 and 4) have at least 4 identified users, with more or less success when it comes to handle CPU-hotplug operations and CPU isolation. Each of which do it in its own ad-hoc way. This is an infrastructure proposal to handle this with the following API changes: _ kthread_create_on_node() automatically affines the created kthread to its target node unless it has been set as per-cpu or bound with kthread_bind[_mask]() before the first wake-up. - kthread_affine_preferred() is a new function that can be called right after kthread_create_on_node() to specify a preferred affinity different than the specified node. When the preferred affinity can't be applied because the possible targets are offline or isolated (nohz_full), the kthread is affine to the housekeeping CPUs (which means to all online CPUs most of the time or only the non-nohz_full CPUs when nohz_full= is set). kswapd, kcompactd, RCU boost kthreads and RCU exp kworkers have been converted, along with a few old drivers. Summary of the changes: * Consolidate a bunch of ad-hoc implementations of kthread_run_on_cpu() * Introduce task_cpu_fallback_mask() that defines the default last resort affinity of a task to become nohz_full aware * Add some correctness check to ensure kthread_bind() is always called before the first kthread wake up. * Default affine kthread to its preferred node. * Convert kswapd / kcompactd and remove their halfway working ad-hoc affinity implementation * Implement kthreads preferred affinity * Unify kthread worker and kthread API's style * Convert RCU kthreads to the new API and remove the ad-hoc affinity implementation. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEd76+gtGM8MbftQlOhSRUR1COjHcFAmeNf8gACgkQhSRUR1CO jHedQQ/+IxTjjqQiItzrq41TES2S0desHDq8lNJFb7rsR/DtKFyLx3s67cOYV+cM Yx54QHg2m/Fz4nXMQ7Po5ygOtJGCKBc5C5QQy7y0lVKeTQK+daDfEtBSa3oG7j3C u+E3tTY6qxkbCzymUyaKkHN4/ay2vLvjFS50luV7KMyI3x47Aji+t7VdCX4LCPP2 eAwOALWD0+7qLJ/VF6gsmQLKA4Qx7PQAzBa3KSBmUN9UcN8Gk1bQHCTIQKDHP9LQ v8BXrNZtYX1o2+snNYpX2z6/ECjxkdwriOgqqZY5306hd9RAQ1u46Dx3byrIqjGn ULG/XQ2istPyhTqb/h+RbrobdOcwEUIeqk8hRRbBXE8bPpqUz9EMuaCMxWDbQjgH NTuKG4ifKJ/IqstkkuDkdOiByE/ysMmwqrTXgSnu2ITNL9yY3BEgFbvA95hgo42s f7QCxEfZb1MHcNEMENSMwM3xw5lLMGMpxVZcMQ3gLwyotMBRrhFZm1qZJG7TITYW IDIeCbH4JOMdQwLs3CcWTXio0N5/85NhRNFV+IDn96OrgxObgnMtV8QwNgjXBAJ5 wGeJWt8s34W1Zo3qS9gEuVzEhW4XaxISQQMkHe8faKkK6iHmIB/VjSQikDwwUNQ/ AspYj82RyWBCDZsqhiYh71kpxjvS6Xp0bj39Ce1sNsOnuksxKkQ= =g8In -----END PGP SIGNATURE----- Merge tag 'kthread-for-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks Pull kthread updates from Frederic Weisbecker: "Kthreads affinity follow either of 4 existing different patterns: 1) Per-CPU kthreads must stay affine to a single CPU and never execute relevant code on any other CPU. This is currently handled by smpboot code which takes care of CPU-hotplug operations. Affinity here is a correctness constraint. 2) Some kthreads _have_ to be affine to a specific set of CPUs and can't run anywhere else. The affinity is set through kthread_bind_mask() and the subsystem takes care by itself to handle CPU-hotplug operations. Affinity here is assumed to be a correctness constraint. 3) Per-node kthreads _prefer_ to be affine to a specific NUMA node. This is not a correctness constraint but merely a preference in terms of memory locality. kswapd and kcompactd both fall into this category. The affinity is set manually like for any other task and CPU-hotplug is supposed to be handled by the relevant subsystem so that the task is properly reaffined whenever a given CPU from the node comes up. Also care should be taken so that the node affinity doesn't cross isolated (nohz_full) cpumask boundaries. 4) Similar to the previous point except kthreads have a _preferred_ affinity different than a node. Both RCU boost kthreads and RCU exp kworkers fall into this category as they refer to "RCU nodes" from a distinctly distributed tree. Currently the preferred affinity patterns (3 and 4) have at least 4 identified users, with more or less success when it comes to handle CPU-hotplug operations and CPU isolation. Each of which do it in its own ad-hoc way. This is an infrastructure proposal to handle this with the following API changes: - kthread_create_on_node() automatically affines the created kthread to its target node unless it has been set as per-cpu or bound with kthread_bind[_mask]() before the first wake-up. - kthread_affine_preferred() is a new function that can be called right after kthread_create_on_node() to specify a preferred affinity different than the specified node. When the preferred affinity can't be applied because the possible targets are offline or isolated (nohz_full), the kthread is affine to the housekeeping CPUs (which means to all online CPUs most of the time or only the non-nohz_full CPUs when nohz_full= is set). kswapd, kcompactd, RCU boost kthreads and RCU exp kworkers have been converted, along with a few old drivers. Summary of the changes: - Consolidate a bunch of ad-hoc implementations of kthread_run_on_cpu() - Introduce task_cpu_fallback_mask() that defines the default last resort affinity of a task to become nohz_full aware - Add some correctness check to ensure kthread_bind() is always called before the first kthread wake up. - Default affine kthread to its preferred node. - Convert kswapd / kcompactd and remove their halfway working ad-hoc affinity implementation - Implement kthreads preferred affinity - Unify kthread worker and kthread API's style - Convert RCU kthreads to the new API and remove the ad-hoc affinity implementation" * tag 'kthread-for-6.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks: kthread: modify kernel-doc function name to match code rcu: Use kthread preferred affinity for RCU exp kworkers treewide: Introduce kthread_run_worker[_on_cpu]() kthread: Unify kthread_create_on_cpu() and kthread_create_worker_on_cpu() automatic format rcu: Use kthread preferred affinity for RCU boost kthread: Implement preferred affinity mm: Create/affine kswapd to its preferred node mm: Create/affine kcompactd to its preferred node kthread: Default affine kthread to its preferred NUMA node kthread: Make sure kthread hasn't started while binding it sched,arm64: Handle CPU isolation on last resort fallback rq selection arm64: Exclude nohz_full CPUs from 32bits el0 support lib: test_objpool: Use kthread_run_on_cpu() kallsyms: Use kthread_run_on_cpu() soc/qman: test: Use kthread_run_on_cpu() arm/bL_switcher: Use kthread_run_on_cpu() |
||
---|---|---|
.. | ||
acquirewdt.c | ||
advantech_ec_wdt.c | ||
advantechwdt.c | ||
airoha_wdt.c | ||
alim1535_wdt.c | ||
alim7101_wdt.c | ||
apple_wdt.c | ||
arm_smc_wdt.c | ||
armada_37xx_wdt.c | ||
asm9260_wdt.c | ||
aspeed_wdt.c | ||
at91rm9200_wdt.c | ||
at91sam9_wdt.c | ||
at91sam9_wdt.h | ||
ath79_wdt.c | ||
bcm47xx_wdt.c | ||
bcm2835_wdt.c | ||
bcm7038_wdt.c | ||
bcm_kona_wdt.c | ||
bd9576_wdt.c | ||
bd96801_wdt.c | ||
booke_wdt.c | ||
cadence_wdt.c | ||
cgbc_wdt.c | ||
cpwd.c | ||
cros_ec_wdt.c | ||
da9052_wdt.c | ||
da9055_wdt.c | ||
da9062_wdt.c | ||
da9063_wdt.c | ||
davinci_wdt.c | ||
db8500_wdt.c | ||
diag288_wdt.c | ||
digicolor_wdt.c | ||
dw_wdt.c | ||
ebc-c384_wdt.c | ||
ep93xx_wdt.c | ||
eurotechwdt.c | ||
exar_wdt.c | ||
f71808e_wdt.c | ||
ftwdt010_wdt.c | ||
gef_wdt.c | ||
geodewdt.c | ||
gpio_wdt.c | ||
gxp-wdt.c | ||
hpwdt.c | ||
i6300esb.c | ||
ib700wdt.c | ||
ibmasr.c | ||
ie6xx_wdt.c | ||
imgpdc_wdt.c | ||
imx2_wdt.c | ||
imx7ulp_wdt.c | ||
imx_sc_wdt.c | ||
indydog.c | ||
intel-mid_wdt.c | ||
it87_wdt.c | ||
it8712f_wdt.c | ||
iTCO_vendor.h | ||
iTCO_vendor_support.c | ||
iTCO_wdt.c | ||
ixp4xx_wdt.c | ||
jz4740_wdt.c | ||
Kconfig | ||
keembay_wdt.c | ||
kempld_wdt.c | ||
lantiq_wdt.c | ||
lenovo_se10_wdt.c | ||
loongson1_wdt.c | ||
lpc18xx_wdt.c | ||
m54xx_wdt.c | ||
machzwd.c | ||
Makefile | ||
marvell_gti_wdt.c | ||
max63xx_wdt.c | ||
max77620_wdt.c | ||
mei_wdt.c | ||
mena21_wdt.c | ||
menf21bmc_wdt.c | ||
menz69_wdt.c | ||
meson_gxbb_wdt.c | ||
meson_wdt.c | ||
mixcomwd.c | ||
mlx_wdt.c | ||
moxart_wdt.c | ||
mpc8xxx_wdt.c | ||
msc313e_wdt.c | ||
mt7621_wdt.c | ||
mtk_wdt.c | ||
mtx-1_wdt.c | ||
ni903x_wdt.c | ||
nic7018_wdt.c | ||
npcm_wdt.c | ||
nv_tco.c | ||
nv_tco.h | ||
octeon-wdt-main.c | ||
octeon-wdt-nmi.S | ||
of_xilinx_wdt.c | ||
omap_wdt.c | ||
omap_wdt.h | ||
orion_wdt.c | ||
pc87413_wdt.c | ||
pcwd.c | ||
pcwd_pci.c | ||
pcwd_usb.c | ||
pic32-dmt.c | ||
pic32-wdt.c | ||
pika_wdt.c | ||
pm8916_wdt.c | ||
pnx4008_wdt.c | ||
pretimeout_noop.c | ||
pretimeout_panic.c | ||
pseries-wdt.c | ||
qcom-wdt.c | ||
rave-sp-wdt.c | ||
rc32434_wdt.c | ||
rdc321x_wdt.c | ||
realtek_otto_wdt.c | ||
renesas_wdt.c | ||
retu_wdt.c | ||
riowd.c | ||
rn5t618_wdt.c | ||
rt2880_wdt.c | ||
rtd119x_wdt.c | ||
rti_wdt.c | ||
rza_wdt.c | ||
rzg2l_wdt.c | ||
rzn1_wdt.c | ||
rzv2h_wdt.c | ||
s3c2410_wdt.c | ||
sa1100_wdt.c | ||
sama5d4_wdt.c | ||
sb_wdog.c | ||
sbc60xxwdt.c | ||
sbc7240_wdt.c | ||
sbc8360.c | ||
sbc_epx_c3.c | ||
sbc_fitpc2_wdt.c | ||
sbsa_gwdt.c | ||
sc520_wdt.c | ||
sc1200wdt.c | ||
sch311x_wdt.c | ||
scx200_wdt.c | ||
shwdt.c | ||
simatic-ipc-wdt.c | ||
sl28cpld_wdt.c | ||
smsc37b787_wdt.c | ||
softdog.c | ||
sp805_wdt.c | ||
sp5100_tco.c | ||
sp5100_tco.h | ||
sprd_wdt.c | ||
st_lpc_wdt.c | ||
starfive-wdt.c | ||
stm32_iwdg.c | ||
stmp3xxx_rtc_wdt.c | ||
stpmic1_wdt.c | ||
sun4v_wdt.c | ||
sunplus_wdt.c | ||
sunxi_wdt.c | ||
tegra_wdt.c | ||
tqmx86_wdt.c | ||
ts72xx_wdt.c | ||
ts4800_wdt.c | ||
twl4030_wdt.c | ||
txx9wdt.c | ||
uniphier_wdt.c | ||
via_wdt.c | ||
visconti_wdt.c | ||
w83627hf_wdt.c | ||
w83877f_wdt.c | ||
w83977f_wdt.c | ||
wafer5823wdt.c | ||
watchdog_core.c | ||
watchdog_core.h | ||
watchdog_dev.c | ||
watchdog_hrtimer_pretimeout.c | ||
watchdog_pretimeout.c | ||
watchdog_pretimeout.h | ||
wd501p.h | ||
wdat_wdt.c | ||
wdrtas.c | ||
wdt.c | ||
wdt285.c | ||
wdt977.c | ||
wdt_pci.c | ||
wm831x_wdt.c | ||
wm8350_wdt.c | ||
xen_wdt.c | ||
xilinx_wwdt.c | ||
ziirave_wdt.c |