diff options
| author | Baolin Wang <[email protected]> | 2023-04-24 13:45:39 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-06-09 23:25:14 +0000 |
| commit | 3c4322c94b9af33dc62e47cb80c057f9814fb595 (patch) | |
| tree | c4dbf4b99f6c172380eae4b968cd614e351fdc82 /mm/page_alloc.c | |
| parent | mm: compaction: optimize compact_memory to comply with the admin-guide (diff) | |
| download | kernel-3c4322c94b9af33dc62e47cb80c057f9814fb595.tar.gz kernel-3c4322c94b9af33dc62e47cb80c057f9814fb595.zip | |
mm/page_alloc: drop the unnecessary pfn_valid() for start pfn
__pageblock_pfn_to_page() currently performs both pfn_valid check and
pfn_to_online_page(). The former one is redundant because the latter is a
stronger check. Drop pfn_valid().
Link: https://lkml.kernel.org/r/c3868b58c6714c09a43440d7d02c7b4eed6e03f6.1682342634.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Reviewed-by: "Huang, Ying" <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Mike Rapoport (IBM) <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/page_alloc.c')
| -rw-r--r-- | mm/page_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 47421bedc12b..af9c995d3c1e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1521,7 +1521,7 @@ struct page *__pageblock_pfn_to_page(unsigned long start_pfn, /* end_pfn is one past the range we are checking */ end_pfn--; - if (!pfn_valid(start_pfn) || !pfn_valid(end_pfn)) + if (!pfn_valid(end_pfn)) return NULL; start_page = pfn_to_online_page(start_pfn); |
