All of lore.kernel.org
 help / color / mirror / Atom feed
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: Tue, 22 Jan 2019 16:16:28 +0100	[thread overview]
Message-ID: <20190122151628.GI4087@dhcp22.suse.cz> (raw)
In-Reply-To: <20190122150717.llf4owk6soejibov@master>

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?

> >>   * use BITS_TO_LONGS() to get number of bytes for bitmap
> >> 
> >> This patch also fix one typo in comment.
> >> 
> >> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> >> ---
> >>  mm/page_alloc.c | 9 +++------
> >>  1 file changed, 3 insertions(+), 6 deletions(-)
> >> 
> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> >> index d295c9bc01a8..d7073cedd087 100644
> >> --- a/mm/page_alloc.c
> >> +++ b/mm/page_alloc.c
> >> @@ -6352,7 +6352,7 @@ static void __init calculate_node_totalpages(struct pglist_data *pgdat,
> >>  /*
> >>   * Calculate the size of the zone->blockflags rounded to an unsigned long
> >>   * Start by making sure zonesize is a multiple of pageblock_order by rounding
> >> - * up. Then use 1 NR_PAGEBLOCK_BITS worth of bits per pageblock, finally
> >> + * up. Then use 1 NR_PAGEBLOCK_BITS width of bits per pageblock, finally
> >
> >why do you change this?
> >
> 
> Is the original comment not correct? Or I misunderstand the English
> word?

yes AFAICS

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2019-01-22 15:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 23:49 [PATCH] mm, page_alloc: cleanup usemap_size() when SPARSEMEM is not set Wei Yang
2019-01-22  8:55 ` Michal Hocko
2019-01-22 15:07   ` Wei Yang
2019-01-22 15:16     ` Michal Hocko [this message]
2019-01-22 15:56       ` Wei Yang
2019-01-23  9:55         ` Michal Hocko
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=20190122151628.GI4087@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.