diff mbox series

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

Message ID 20240726215701.19459-15-frederic@kernel.org (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Frederic Weisbecker July 26, 2024, 9:56 p.m. UTC
kcompactd runs preferrably on a specific node. Allocate its task
structure accordingly for better memory locality.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
---
 mm/compaction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vlastimil Babka July 31, 2024, 3:07 p.m. UTC | #1
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@kernel.org>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

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;
Frederic Weisbecker Aug. 5, 2024, 2:30 p.m. UTC | #2
Le Wed, Jul 31, 2024 at 05:07:48PM +0200, Vlastimil Babka a écrit :
> 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@kernel.org>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> 
> could even squash it to previous patch since you touch that line anyway and
> it should be a no-brainer

It looks like a no brainer indeed but I'm very careful about introducing subtle
logical changes ;-)

Thanks.
diff mbox series

Patch

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;