[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180816104736.GA16861@techadventures.net>
Date: Thu, 16 Aug 2018 12:47:36 +0200
From: Oscar Salvador <osalvador@...hadventures.net>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
Vlastimil Babka <vbabka@...e.cz>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Pavel Tatashin <pasha.tatashin@...cle.com>,
Kemi Wang <kemi.wang@...el.com>,
David Rientjes <rientjes@...gle.com>,
Jia He <jia.he@...-semitech.com>,
Oscar Salvador <osalvador@...e.de>,
Petr Tesarik <ptesarik@...e.com>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Dan Williams <dan.j.williams@...el.com>,
Mathieu Malaterre <malat@...ian.org>,
Baoquan He <bhe@...hat.com>,
Wei Yang <richard.weiyang@...il.com>,
Ross Zwisler <zwisler@...nel.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH v1 3/5] mm/memory_hotplug: check if sections are already
online/offline
On Thu, Aug 16, 2018 at 12:06:26PM +0200, David Hildenbrand wrote:
> +
> +/* check if all mem sections are offline */
> +bool mem_sections_offline(unsigned long pfn, unsigned long end_pfn)
> +{
> + for (; pfn < end_pfn; pfn += PAGES_PER_SECTION) {
> + unsigned long section_nr = pfn_to_section_nr(pfn);
> +
> + if (WARN_ON(!valid_section_nr(section_nr)))
> + continue;
> + if (online_section_nr(section_nr))
> + return false;
> + }
> + return true;
> +}
AFAICS pages_correctly_probed will catch this first.
pages_correctly_probed checks for the section to be:
- present
- valid
- !online
Maybe it makes sense to rename it, and write another pages_correctly_probed routine
for the offline case.
So all checks would stay in memory_block_action level, and we would not need
the mem_sections_offline/online stuff.
Thanks
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists