mm/page_owner.c: clean up init_pages_in_zone()
Remove two redundant assignments in init_pages_in_zone(). [osalvador@techadventures.net: v3] Link: http://lkml.kernel.org/r/20180117124513.GA876@techadventures.net [akpm@linux-foundation.org: coding style tweaks] Link: http://lkml.kernel.org/r/20180110084355.GA22822@techadventures.net Signed-off-by: Oscar Salvador <osalvador@techadventures.net> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3c2c648842
commit
6787c1dab1
1 changed files with 7 additions and 9 deletions
|
@ -528,21 +528,18 @@ read_page_owner(struct file *file, char __user *buf, size_t count, loff_t *ppos)
|
||||||
|
|
||||||
static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone)
|
static void init_pages_in_zone(pg_data_t *pgdat, struct zone *zone)
|
||||||
{
|
{
|
||||||
struct page *page;
|
unsigned long pfn = zone->zone_start_pfn;
|
||||||
struct page_ext *page_ext;
|
unsigned long end_pfn = zone_end_pfn(zone);
|
||||||
unsigned long pfn = zone->zone_start_pfn, block_end_pfn;
|
|
||||||
unsigned long end_pfn = pfn + zone->spanned_pages;
|
|
||||||
unsigned long count = 0;
|
unsigned long count = 0;
|
||||||
|
|
||||||
/* Scan block by block. First and last block may be incomplete */
|
|
||||||
pfn = zone->zone_start_pfn;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walk the zone in pageblock_nr_pages steps. If a page block spans
|
* Walk the zone in pageblock_nr_pages steps. If a page block spans
|
||||||
* a zone boundary, it will be double counted between zones. This does
|
* a zone boundary, it will be double counted between zones. This does
|
||||||
* not matter as the mixed block count will still be correct
|
* not matter as the mixed block count will still be correct
|
||||||
*/
|
*/
|
||||||
for (; pfn < end_pfn; ) {
|
for (; pfn < end_pfn; ) {
|
||||||
|
unsigned long block_end_pfn;
|
||||||
|
|
||||||
if (!pfn_valid(pfn)) {
|
if (!pfn_valid(pfn)) {
|
||||||
pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES);
|
pfn = ALIGN(pfn + 1, MAX_ORDER_NR_PAGES);
|
||||||
continue;
|
continue;
|
||||||
|
@ -551,9 +548,10 @@ 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 = ALIGN(pfn + 1, pageblock_nr_pages);
|
||||||
block_end_pfn = min(block_end_pfn, end_pfn);
|
block_end_pfn = min(block_end_pfn, end_pfn);
|
||||||
|
|
||||||
page = pfn_to_page(pfn);
|
|
||||||
|
|
||||||
for (; pfn < block_end_pfn; pfn++) {
|
for (; pfn < block_end_pfn; pfn++) {
|
||||||
|
struct page *page;
|
||||||
|
struct page_ext *page_ext;
|
||||||
|
|
||||||
if (!pfn_valid_within(pfn))
|
if (!pfn_valid_within(pfn))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue