From: Michal Hocko <mhocko@suse.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org
Subject: Re: [PATCH] mm, page_alloc: cleanup usemap_size() when SPARSEMEM is not set
Date: Wed, 23 Jan 2019 10:55:03 +0100 [thread overview]
Message-ID: <20190123095503.GR4087@dhcp22.suse.cz> (raw)
In-Reply-To: <20190122155628.eu4sxocyjb5lrcla@master>
On Tue 22-01-19 15:56:28, Wei Yang wrote:
> On Tue, Jan 22, 2019 at 04:16:28PM +0100, Michal Hocko wrote:
> >On Tue 22-01-19 15:07:17, Wei Yang wrote:
> >> On Tue, Jan 22, 2019 at 09:55:24AM +0100, Michal Hocko wrote:
> >> >On Sat 19-01-19 07:49:05, Wei Yang wrote:
> >> >> Two cleanups in this patch:
> >> >>
> >> >> * since pageblock_nr_pages == (1 << pageblock_order), the roundup()
> >> >> and right shift pageblock_order could be replaced with
> >> >> DIV_ROUND_UP()
> >> >
> >> >Why is this change worth it?
> >> >
> >>
> >> To make it directly show usemapsize is number of times of
> >> pageblock_nr_pages.
> >
> >Does this lead to a better code generation? Does it make the code easier
> >to read/maintain?
> >
>
> I think the answer is yes.
>
> * it reduce the code from 6 lines to 3 lines, 50% off
> * by reducing calculation back and forth, it would be easier for
> audience to catch what it tries to do
To be honest, I really do not see this sufficient to justify touching
the code unless the resulting _generated_ code is better/more efficient.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-01-23 9:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-18 23:49 Wei Yang
2019-01-22 8:55 ` Michal Hocko
2019-01-22 15:07 ` Wei Yang
2019-01-22 15:16 ` Michal Hocko
2019-01-22 15:56 ` Wei Yang
2019-01-23 9:55 ` Michal Hocko [this message]
2019-01-24 14:13 ` Wei Yang
2019-01-24 14:30 ` Michal Hocko
2019-01-25 1:12 ` 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=20190123095503.GR4087@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=richard.weiyang@gmail.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