Re: [RFC PATCH 14/20] mm: Allocate kcompactd on its node

From: Vlastimil Babka
Date: Wed Jul 31 2024 - 11:08:20 EST


On 7/26/24 11:56 PM, Frederic Weisbecker wrote:
> kcompactd runs preferrably on a specific node. Allocate its task
> structure accordingly for better memory locality.
>
> Signed-off-by: Frederic Weisbecker <frederic@xxxxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>

could even squash it to previous patch since you touch that line anyway and
it should be a no-brainer

> ---
> mm/compaction.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 64a6486f06e1..dc4347c4e352 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -3252,7 +3252,7 @@ void __meminit kcompactd_run(int nid)
> if (pgdat->kcompactd)
> return;
>
> - pgdat->kcompactd = kthread_create(kcompactd, pgdat, "kcompactd%d", nid);
> + pgdat->kcompactd = kthread_create_on_node(kcompactd, pgdat, nid, "kcompactd%d", nid);
> if (IS_ERR(pgdat->kcompactd)) {
> pr_err("Failed to start kcompactd on node %d\n", nid);
> pgdat->kcompactd = NULL;