Re: [PATCH RFC 08/12] kcompactd: Add housekeeping notifier for dynamic mask update
From: Zi Yan
Date: Fri Feb 06 2026 - 10:10:02 EST
On 6 Feb 2026, at 2:04, Qiliang Yuan wrote:
> The kcompactd threads should respect the housekeeping mask for kthreads
> (HK_TYPE_KTHREAD) to avoid running on isolated CPUs. Currently, they
> are created without explicit affinity constraints beyond the node
> preference.
>
> Add housekeeping_affine() to kcompactd_run() to set initial affinity,
> and register a housekeeping notifier to update kcompactd affinity
> when the HK_TYPE_KTHREAD mask is changed at runtime.
>
How about khugepaged and kswapd?
khugepaged thread is created in start_stop_khugepaged() from mm/khugepaged.c.
kswapd threads are created in kswapd_init() from mm/vmscan.c.
> Signed-off-by: Qiliang Yuan <realwujing@xxxxxxxxx>
> Signed-off-by: Qiliang Yuan <yuanql9@xxxxxxxxxxxxxxx>
> ---
> mm/compaction.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Best Regards,
Yan, Zi