From: Wei Yang <richard.weiyang@gmail.com>
To: David Rientjes <rientjes@google.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
dave.hansen@linux.intel.com, akpm@linux-foundation.org,
mhocko@suse.com, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func()
Date: Tue, 27 Mar 2018 06:56:21 +0800 [thread overview]
Message-ID: <20180326225621.GA79778@WeideMacBook-Pro.local> (raw)
In-Reply-To: <alpine.DEB.2.20.1803261546240.99792@chino.kir.corp.google.com>
On Mon, Mar 26, 2018 at 03:47:03PM -0700, David Rientjes wrote:
>On Tue, 27 Mar 2018, Wei Yang wrote:
>
>> >> In 'commit c4e1be9ec113 ("mm, sparsemem: break out of loops early")',
>> >> __highest_present_section_nr is introduced to reduce the loop counts for
>> >> present section. This is also helpful for usemap and memmap allocation.
>> >>
>> >> This patch uses __highest_present_section_nr + 1 to optimize the loop.
>> >>
>> >> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>> >> ---
>> >> mm/sparse.c | 2 +-
>> >> 1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/mm/sparse.c b/mm/sparse.c
>> >> index 7af5e7a92528..505050346249 100644
>> >> --- a/mm/sparse.c
>> >> +++ b/mm/sparse.c
>> >> @@ -561,7 +561,7 @@ static void __init alloc_usemap_and_memmap(void (*alloc_func)
>> >> map_count = 1;
>> >> }
>> >> /* ok, last chunk */
>> >> - alloc_func(data, pnum_begin, NR_MEM_SECTIONS,
>> >> + alloc_func(data, pnum_begin, __highest_present_section_nr+1,
>> >> map_count, nodeid_begin);
>> >> }
>> >>
>> >
>> >What happens if s/NR_MEM_SECTIONS/pnum/?
>>
>> I have tried this :-)
>>
>> The last pnum is -1 from next_present_section_nr().
>>
>
>Lol. I think it would make more sense for the second patch to come before
>the first, but feel free to add
>
Thanks for your comment.
Do I need to reorder the patch and send v2?
>Acked-by: David Rientjes <rientjes@google.com>
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2018-03-26 22:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 8:19 [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func() Wei Yang
2018-03-26 8:19 ` [PATCH 2/2] mm/sparse: check __highest_present_section_nr only for a present section Wei Yang
2018-03-30 3:20 ` [PATCH] mm: check __highest_present_sectioin_nr directly in memory_dev_init() Wei Yang
2018-03-26 20:56 ` [PATCH 1/2] mm/sparse: pass the __highest_present_section_nr + 1 to alloc_func() David Rientjes
2018-03-26 22:30 ` Wei Yang
2018-03-26 22:47 ` David Rientjes
2018-03-26 22:56 ` Wei Yang [this message]
2018-03-26 22:58 ` David Rientjes
2018-03-26 23:15 ` Wei Yang
2018-04-12 3:26 ` Wei Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180326225621.GA79778@WeideMacBook-Pro.local \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@linux.intel.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).