[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190926074718.GF20255@dhcp22.suse.cz>
Date: Thu, 26 Sep 2019 09:47:18 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Oscar Salvador <osalvador@...e.de>
Cc: Alastair D'Silva <alastair@....ibm.com>, alastair@...ilva.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Pavel Tatashin <pasha.tatashin@...een.com>,
Dan Williams <dan.j.williams@...el.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] memory_hotplug: Add a bounds check to __add_pages
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@...ilva.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
Powered by blists - more mailing lists