[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YL3b5HGqfIW23TJh@dhcp22.suse.cz>
Date: Mon, 7 Jun 2021 10:42:12 +0200
From: Michal Hocko <mhocko@...e.com>
To: Oscar Salvador <osalvador@...e.de>
Cc: David Hildenbrand <david@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Vlastimil Babka <vbabka@...e.cz>,
Pavel Tatashin <pasha.tatashin@...een.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] mm,page_alloc: Use {get,put}_online_mems() to get
stable zone's values
On Fri 04-06-21 09:41:45, Oscar Salvador wrote:
> On Thu, Jun 03, 2021 at 02:45:13PM +0200, Michal Hocko wrote:
[...]
> > But the primary question is whether anybody actually cares about
> > potential races in the first place.
>
> I have been checking move_freepages_block() and alloc_contig_pages(), which
> are two of the functions that call zone_spans_pfn().
>
> move_freepages_block() uses it in a way to align the given pfn to pageblock
> top and bottom, and then check that aligned pfns are still within the same zone.
> From a memory-hotplug perspective that's ok as we know that we are offlining
> PAGES_PER_SECTION (which implies whole pageblocks).
>
> alloc_contig_pages() (used by the hugetlb gigantic allocator) runs through a
> node's zonelist and checks whether zone->zone_start_pfn + nr_pages stays within
> the same zone.
> IMHO, the race with zone_spans_last_pfn() vs mem-hotplug would not be that bad,
> as it will be caught afters by e.g: __alloc_contig_pages when pages cannot be
> isolated because they are offline etc.
>
> So, I would say we do not really need the lock, but I might be missing something.
> But if we chose to care about this, then the locking should be done right, not
> half-way as it is right now.
That is my understanding as well.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists