Skip to content

Commit 535b81e

Browse files
weiyang-linuxtorvalds
authored andcommitted
mm/page_alloc.c: remove unnecessary end_bitidx for [set|get]_pfnblock_flags_mask()
After previous cleanup, the end_bitidx is not necessary any more. Signed-off-by: Wei Yang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Cc: Mel Gorman <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent d93d5ab commit 535b81e

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

include/linux/mmzone.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ extern int page_group_by_mobility_disabled;
9191
#define MIGRATETYPE_MASK ((1UL << PB_migratetype_bits) - 1)
9292

9393
#define get_pageblock_migratetype(page) \
94-
get_pfnblock_flags_mask(page, page_to_pfn(page), \
95-
PB_migrate_end, MIGRATETYPE_MASK)
94+
get_pfnblock_flags_mask(page, page_to_pfn(page), MIGRATETYPE_MASK)
9695

9796
struct free_area {
9897
struct list_head free_list[MIGRATE_TYPES];

include/linux/pageblock-flags.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,25 @@ struct page;
5656

5757
unsigned long get_pfnblock_flags_mask(struct page *page,
5858
unsigned long pfn,
59-
unsigned long end_bitidx,
6059
unsigned long mask);
6160

6261
void set_pfnblock_flags_mask(struct page *page,
6362
unsigned long flags,
6463
unsigned long pfn,
65-
unsigned long end_bitidx,
6664
unsigned long mask);
6765

6866
/* Declarations for getting and setting flags. See mm/page_alloc.c */
6967
#ifdef CONFIG_COMPACTION
7068
#define get_pageblock_skip(page) \
7169
get_pfnblock_flags_mask(page, page_to_pfn(page), \
72-
PB_migrate_skip, (1 << (PB_migrate_skip)))
70+
(1 << (PB_migrate_skip)))
7371
#define clear_pageblock_skip(page) \
7472
set_pfnblock_flags_mask(page, 0, page_to_pfn(page), \
75-
PB_migrate_skip, (1 << PB_migrate_skip))
73+
(1 << PB_migrate_skip))
7674
#define set_pageblock_skip(page) \
7775
set_pfnblock_flags_mask(page, (1 << PB_migrate_skip), \
7876
page_to_pfn(page), \
79-
PB_migrate_skip, (1 << PB_migrate_skip))
77+
(1 << PB_migrate_skip))
8078
#else
8179
static inline bool get_pageblock_skip(struct page *page)
8280
{

mm/page_alloc.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,13 @@ static inline int pfn_to_bitidx(struct page *page, unsigned long pfn)
469469
* get_pfnblock_flags_mask - Return the requested group of flags for the pageblock_nr_pages block of pages
470470
* @page: The page within the block of interest
471471
* @pfn: The target page frame number
472-
* @end_bitidx: The last bit of interest to retrieve
473472
* @mask: mask of bits that the caller is interested in
474473
*
475474
* Return: pageblock_bits flags
476475
*/
477-
static __always_inline unsigned long __get_pfnblock_flags_mask(struct page *page,
476+
static __always_inline
477+
unsigned long __get_pfnblock_flags_mask(struct page *page,
478478
unsigned long pfn,
479-
unsigned long end_bitidx,
480479
unsigned long mask)
481480
{
482481
unsigned long *bitmap;
@@ -493,28 +492,25 @@ static __always_inline unsigned long __get_pfnblock_flags_mask(struct page *page
493492
}
494493

495494
unsigned long get_pfnblock_flags_mask(struct page *page, unsigned long pfn,
496-
unsigned long end_bitidx,
497495
unsigned long mask)
498496
{
499-
return __get_pfnblock_flags_mask(page, pfn, end_bitidx, mask);
497+
return __get_pfnblock_flags_mask(page, pfn, mask);
500498
}
501499

502500
static __always_inline int get_pfnblock_migratetype(struct page *page, unsigned long pfn)
503501
{
504-
return __get_pfnblock_flags_mask(page, pfn, PB_migrate_end, MIGRATETYPE_MASK);
502+
return __get_pfnblock_flags_mask(page, pfn, MIGRATETYPE_MASK);
505503
}
506504

507505
/**
508506
* set_pfnblock_flags_mask - Set the requested group of flags for a pageblock_nr_pages block of pages
509507
* @page: The page within the block of interest
510508
* @flags: The flags to set
511509
* @pfn: The target page frame number
512-
* @end_bitidx: The last bit of interest
513510
* @mask: mask of bits that the caller is interested in
514511
*/
515512
void set_pfnblock_flags_mask(struct page *page, unsigned long flags,
516513
unsigned long pfn,
517-
unsigned long end_bitidx,
518514
unsigned long mask)
519515
{
520516
unsigned long *bitmap;
@@ -550,8 +546,7 @@ void set_pageblock_migratetype(struct page *page, int migratetype)
550546
migratetype = MIGRATE_UNMOVABLE;
551547

552548
set_pfnblock_flags_mask(page, (unsigned long)migratetype,
553-
page_to_pfn(page), PB_migrate_end,
554-
MIGRATETYPE_MASK);
549+
page_to_pfn(page), MIGRATETYPE_MASK);
555550
}
556551

557552
#ifdef CONFIG_DEBUG_VM

0 commit comments

Comments
 (0)