Message ID | 20230821183733.106619-2-hannes@cmpxchg.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: page_alloc: freelist migratetype hygiene | expand |
On 21 Aug 2023, at 14:33, Johannes Weiner wrote: > Save a pfn_to_page() lookup when the pfn is right there already. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> > --- > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) LGTM. Reviewed-by: Zi Yan <ziy@nvidia.com> -- Best Regards, Yan, Zi
On 21 Aug 2023, at 14:33, Johannes Weiner wrote: > Save a pfn_to_page() lookup when the pfn is right there already. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> > --- > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Just notice that it is already done in: https://lkml.kernel.org/r/20230811115945.3423894-3-shikemeng@huaweicloud.com -- Best Regards, Yan, Zi
On Mon, Aug 21, 2023 at 04:29:36PM -0400, Zi Yan wrote: > On 21 Aug 2023, at 14:33, Johannes Weiner wrote: > > > Save a pfn_to_page() lookup when the pfn is right there already. > > > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> > > --- > > mm/page_alloc.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > Just notice that it is already done in: > https://lkml.kernel.org/r/20230811115945.3423894-3-shikemeng@huaweicloud.com Even better :) I'll rebase on top of this.
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 977bb4d5e8e1..e430ac45df7c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -824,7 +824,7 @@ static inline void __free_one_page(struct page *page, * pageblock isolation could cause incorrect freepage or CMA * accounting or HIGHATOMIC accounting. */ - int buddy_mt = get_pageblock_migratetype(buddy); + int buddy_mt = get_pfnblock_migratetype(buddy, buddy_pfn); if (migratetype != buddy_mt && (!migratetype_is_mergeable(migratetype) || @@ -900,7 +900,7 @@ int split_free_page(struct page *free_page, goto out; } - mt = get_pageblock_migratetype(free_page); + mt = get_pfnblock_migratetype(free_page, free_page_pfn); if (likely(!is_migrate_isolate(mt))) __mod_zone_freepage_state(zone, -(1UL << order), mt);
Save a pfn_to_page() lookup when the pfn is right there already. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)