linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gregory Price <gourry@gourry.net>
To: Oscar Salvador <osalvador@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Vlastimil Babka <vbabka@suse.cz>,
	Hyeonggon Yoo <42.hyeyoo@gmail.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Rakie Kim <rakie.kim@sk.com>, Harry Yoo <harry.yoo@oracle.com>,
	dan.carpenter@linaro.org, honggyu.kim@sk.com
Subject: Re: [PATCH v3 2/3] mm,memory_hotplug: Implement numa node notifier
Date: Fri, 2 May 2025 11:28:02 -0400	[thread overview]
Message-ID: <aBTkgnYYSN0SMQCU@gourry-fedora-PF4VCD3F> (raw)
In-Reply-To: <20250502083624.49849-3-osalvador@suse.de>

On Fri, May 02, 2025 at 10:36:23AM +0200, Oscar Salvador wrote:
> There are at least six consumers of hotplug_memory_notifier that what they
> really are interested in is whether any numa node changed its state, e.g: going
> from being memory aware to becoming memoryless and vice versa.
> 
> Implement a specific notifier for numa nodes when their state gets changed,
> and have those consumers that only care about numa node state changes use it.
> 
> Signed-off-by: Oscar Salvador <osalvador@suse.de>
> Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>  
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index f43951668c41..b3ad63fb3a2b 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -3591,20 +3591,20 @@ static int wi_node_notifier(struct notifier_block *nb,
>  			       unsigned long action, void *data)
>  {
>  	int err;
> -	struct memory_notify *arg = data;
> +	struct node_notify *arg = data;
>  	int nid = arg->status_change_nid;
>  
>  	if (nid < 0)
>  		return NOTIFY_OK;
>  
>  	switch (action) {
> -	case MEM_ONLINE:
> +	case NODE_BECAME_MEM_AWARE:
>  		err = sysfs_wi_node_add(nid);
>  		if (err)
>  			pr_err("failed to add sysfs for node%d during hotplug: %d\n",
>  			       nid, err);
>  		break;

May I suggest rolling this patch in with this change:
https://lore.kernel.org/linux-mm/aAij2oUCP1zmcoPv@stanley.mountain/

seems to fix the underlying problem, and returning an error now makes
sense given the change. 

+cc: Honggyu Kim, Dan Carpenter

> -	case MEM_OFFLINE:
> +	case NODE_BECAME_MEMORYLESS:
>  		sysfs_wi_node_delete(nid);
>  		break;
>  	}
> @@ -3639,7 +3639,7 @@ static int __init add_weighted_interleave_group(struct kobject *mempolicy_kobj)
>  		}
>  	}
>  
> -	hotplug_memory_notifier(wi_node_notifier, DEFAULT_CALLBACK_PRI);
> +	hotplug_node_notifier(wi_node_notifier, DEFAULT_CALLBACK_PRI);
>  	return 0;
>  
>  err_cleanup_kobj:


  reply	other threads:[~2025-05-02 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02  8:36 [PATCH v3 0/3] " Oscar Salvador
2025-05-02  8:36 ` [PATCH v3 1/3] mm,slub: Do not special case N_NORMAL nodes for slab_nodes Oscar Salvador
2025-05-05 13:43   ` Vlastimil Babka
2025-05-02  8:36 ` [PATCH v3 2/3] mm,memory_hotplug: Implement numa node notifier Oscar Salvador
2025-05-02 15:28   ` Gregory Price [this message]
2025-05-05 14:51     ` Dan Carpenter
2025-05-28  2:23     ` Honggyu Kim
2025-06-03  9:14       ` Oscar Salvador
2025-05-02 19:09   ` ALOK TIWARI
2025-05-05 13:58   ` Vlastimil Babka
2025-05-02  8:36 ` [PATCH v3 3/3] mm,memory_hotplug: Rename status_change_nid parameter in memory_notify Oscar Salvador
2025-05-02 19:15   ` ALOK TIWARI
2025-05-04  3:03 ` [PATCH v3 0/3] Implement numa node notifier Andrew Morton
2025-05-04  5:44   ` Oscar Salvador
2025-05-04  6:16     ` Andrew Morton
2025-05-05 17:07     ` Gregory Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aBTkgnYYSN0SMQCU@gourry-fedora-PF4VCD3F \
    --to=gourry@gourry.net \
    --cc=42.hyeyoo@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@linaro.org \
    --cc=david@redhat.com \
    --cc=harry.yoo@oracle.com \
    --cc=honggyu.kim@sk.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=rakie.kim@sk.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox