linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"mhocko@kernel.org" <mhocko@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Subject: Re: [PATCH v4] mm/memory_hotplug: refrain from adding memory into an impossible node
Date: Thu, 16 Apr 2020 19:53:02 +0200	[thread overview]
Message-ID: <6af5471c-8c41-e642-b20e-9c9d156cc754@redhat.com> (raw)
In-Reply-To: <149f247e-173d-dcd5-3f68-f648bf18351c@redhat.com>

On 16.04.20 19:25, David Hildenbrand wrote:
> On 16.04.20 19:23, Verma, Vishal L wrote:
>> On Thu, 2020-04-16 at 19:12 +0200, David Hildenbrand wrote:
>>> On 16.04.20 19:10, Vishal Verma wrote:
>>>>
>>>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>>>> index 0a54ffac8c68..ddd3347edd54 100644
>>>> --- a/mm/memory_hotplug.c
>>>> +++ b/mm/memory_hotplug.c
>>>> @@ -1005,6 +1005,11 @@ int __ref add_memory_resource(int nid, struct resource *res)
>>>>  	if (ret)
>>>>  		return ret;
>>>>  
>>>> +	if (!node_possible(nid)) {
>>>> +		WARN(1, "node %d was absent from the node_possible_map\n", nid);
>>>> +		return -ENXIO;
>>>
>>> Nit: I suggest using "-EINVAL" instead (e.g., returned via
>>> check_hotplug_memory_range).
>>>
>>> Not sure if we should pr_err() instead of WARN (see e.g.,
>>> check_hotplug_memory_range)
>>>
>> Hm, I'm happy to make the changes, but EINVAL to me suggests there is a
>> problem in the way this was called by the user. And in this case there
>> really might not be much the user can change in case fo buggy firmware.
> 
> Yeah, but introducing new return codes callers might not expected might
> create IMHO other issues.
> 
>>
>> Same thing with the WARN - make the potential firmware bug much more
>> obvious and visible.
>>
> 
> Yeah, but I doubt this is really necessary. No strong feelings.
> 

Forgot to

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb



  reply	other threads:[~2020-04-16 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-16 17:10 Vishal Verma
2020-04-16 17:12 ` David Hildenbrand
2020-04-16 17:23   ` Verma, Vishal L
2020-04-16 17:25     ` David Hildenbrand
2020-04-16 17:53       ` David Hildenbrand [this message]
2020-04-16 22:47         ` Verma, Vishal L

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=6af5471c-8c41-e642-b20e-9c9d156cc754@redhat.com \
    --to=david@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mhocko@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /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