linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@techadventures.net>
To: Michal Hocko <mhocko@suse.com>
Cc: linux-mm@kvack.org, vbabka@suse.cz, akpm@linux-foundation.org
Subject: Re: [PATCH] mm/page_owner.c Clean up init_pages_in_zone()
Date: Wed, 10 Jan 2018 09:05:40 +0100	[thread overview]
Message-ID: <20180110080540.GA22405@techadventures.net> (raw)
In-Reply-To: <20180109171820.GN1732@dhcp22.suse.cz>

On Tue, Jan 09, 2018 at 06:18:20PM +0100, Michal Hocko wrote:
> On Tue 09-01-18 14:33:03, Oscar Salvador wrote:
> [...]
> > @@ -551,13 +548,11 @@ static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone)
> >  		block_end_pfn = ALIGN(pfn + 1, pageblock_nr_pages);
> >  		block_end_pfn = min(block_end_pfn, end_pfn);
> >  
> > -		page = pfn_to_page(pfn);
> > -
> >  		for (; pfn < block_end_pfn; pfn++) {
> >  			if (!pfn_valid_within(pfn))
> >  				continue;
> >  
> > -			page = pfn_to_page(pfn);
> > +			struct page *page = pfn_to_page(pfn);
> >  
> >  			if (page_zone(page) != zone)
> >  				continue;
> > @@ -580,7 +575,7 @@ static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone)
> >  			if (PageReserved(page))
> >  				continue;
> >  
> > -			page_ext = lookup_page_ext(page);
> > +			struct page_ext *page_ext = lookup_page_ext(page);
> >  			if (unlikely(!page_ext))
> >  				continue;
> 
> we do not interleave declarations with the code in the kernel. You can
> move those from the function scope to the loop scope and remove the
> pointless pfn and page initialization outside of the loop.

I will send a v2 fixing this.

Thanks!

Oscar Salvador

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2018-01-10  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-09 13:33 Oscar Salvador
2018-01-09 17:18 ` Michal Hocko
2018-01-10  8:05   ` Oscar Salvador [this message]

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=20180110080540.GA22405@techadventures.net \
    --to=osalvador@techadventures.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vbabka@suse.cz \
    /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