[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180730113029.GM24267@dhcp22.suse.cz>
Date: Mon, 30 Jul 2018 13:30:29 +0200
From: Michal Hocko <mhocko@...nel.org>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>,
Pavel Tatashin <pasha.tatashin@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Jan Kara <jack@...e.cz>,
Matthew Wilcox <mawilcox@...rosoft.com>,
Jérôme Glisse <jglisse@...hat.com>,
Souptick Joarder <jrdr.linux@...il.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Vlastimil Babka <vbabka@...e.cz>,
Oscar Salvador <osalvador@...hadventures.net>,
YASUAKI ISHIMATSU <yasu.isimatu@...il.com>,
Mathieu Malaterre <malat@...ian.org>,
Mel Gorman <mgorman@...e.de>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH v1] mm: inititalize struct pages when adding a section
On Fri 27-07-18 18:54:54, David Hildenbrand wrote:
> Right now, struct pages are inititalized when memory is onlined, not
> when it is added (since commit d0dc12e86b31 ("mm/memory_hotplug: optimize
> memory hotplug")).
>
> remove_memory() will call arch_remove_memory(). Here, we usually access
> the struct page to get the zone of the pages.
>
> So effectively, we access stale struct pages in case we remove memory that
> was never onlined. So let's simply inititalize them earlier, when the
> memory is added. We only have to take care of updating the zone once we
> know it. We can use a dummy zone for that purpose.
I have considered something like this when I was reworking memory
hotplug to not associate struct pages with zone before onlining and I
considered this to be rather fragile. I would really not like to get
back to that again if possible.
> So effectively, all pages will already be initialized and set to
> reserved after memory was added but before it was onlined (and even the
> memblock is added). We only inititalize pages once, to not degrade
> performance.
To be honest, I would rather see d0dc12e86b31 reverted. It is late in
the release cycle and if the patch is buggy then it should be reverted
rather than worked around. I found the optimization not really
convincing back then and this is still the case TBH.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists