linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Oscar Salvador <osalvador@suse.de>
Cc: Alastair D'Silva <alastair@au1.ibm.com>,
	alastair@d-silva.org, Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] memory_hotplug: Add a bounds check to __add_pages
Date: Thu, 26 Sep 2019 09:47:18 +0200	[thread overview]
Message-ID: <20190926074718.GF20255@dhcp22.suse.cz> (raw)
In-Reply-To: <20190926073951.GA17200@linux>

On Thu 26-09-19 09:40:05, Oscar Salvador wrote:
> On Thu, Sep 26, 2019 at 11:34:05AM +1000, Alastair D'Silva wrote:
> > From: Alastair D'Silva <alastair@d-silva.org>
> > @@ -291,6 +307,10 @@ int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,
> >  	unsigned long nr, start_sec, end_sec;
> >  	struct vmem_altmap *altmap = restrictions->altmap;
> >  
> > +	err = check_hotplug_memory_addressable(pfn, nr_pages);
> > +	if (err)
> > +		return err;
> > +
> 
> I am probably off here because 1) I am jumping blind in a middle of a discussion and
> 2) I got back from holydays yesterday, so bear with me.
> 
> Would not be better to just place the check in add_memory_resource instead?

This was the previous version of the patch. The argument is that we do
not want each add_pages user to think of this special handling.
-- 
Michal Hocko
SUSE Labs


  parent reply	other threads:[~2019-09-26  7:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  1:34 [PATCH v4 0/1] Add bounds check for Hotplugged memory Alastair D'Silva
2019-09-26  1:34 ` [PATCH v4] memory_hotplug: Add a bounds check to __add_pages Alastair D'Silva
2019-09-26  7:12   ` David Hildenbrand
2019-09-26  7:37     ` David Hildenbrand
2019-09-26  7:43     ` Michal Hocko
2019-09-26  7:46       ` David Hildenbrand
2019-09-27  6:33         ` Alastair D'Silva
2019-09-27  7:24           ` David Hildenbrand
2019-09-26  7:40   ` Oscar Salvador
2019-09-26  7:42     ` David Hildenbrand
2019-09-26  7:47     ` Michal Hocko [this message]
2019-09-26  7:44   ` Michal Hocko
2019-09-26  7:53   ` Oscar Salvador
2019-09-27  5:14     ` Alastair D'Silva
2019-09-26 15:35   ` kbuild test robot

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=20190926074718.GF20255@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alastair@au1.ibm.com \
    --cc=alastair@d-silva.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --cc=pasha.tatashin@soleen.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