[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <552d5a9b-0ca9-cc30-d8c2-33dc1cde917f@intel.com>
Date: Mon, 2 Jul 2018 12:47:29 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Pavel Tatashin <pasha.tatashin@...cle.com>,
steven.sistare@...cle.com, daniel.m.jordan@...cle.com,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
kirill.shutemov@...ux.intel.com, mhocko@...e.com,
linux-mm@...ck.org, dan.j.williams@...el.com, jack@...e.cz,
jglisse@...hat.com, jrdr.linux@...il.com, bhe@...hat.com,
gregkh@...uxfoundation.org, vbabka@...e.cz,
richard.weiyang@...il.com, rientjes@...gle.com, mingo@...nel.org,
osalvador@...hadventures.net
Subject: Re: [PATCH v3 2/2] mm/sparse: start using sparse_init_nid(), and
remove old code
On 07/01/2018 07:04 PM, Pavel Tatashin wrote:
> + for_each_present_section_nr(pnum_begin + 1, pnum_end) {
> + int nid = sparse_early_nid(__nr_to_section(pnum_end));
>
> + if (nid == nid_begin) {
> + map_count++;
> continue;
> }
> + sparse_init_nid(nid_begin, pnum_begin, pnum_end, map_count);
> + nid_begin = nid;
> + pnum_begin = pnum_end;
> + map_count = 1;
> }
Ugh, this is really hard to read. Especially because the pnum "counter"
is called "pnum_end".
So, this is basically a loop that collects all of the adjacent sections
in a given single nid and then calls sparse_init_nid(). pnum_end in
this case is non-inclusive, so the sparse_init_nid() call is actually
for the *previous* nid that pnum_end is pointing _past_.
This *really* needs commenting.
Powered by blists - more mailing lists