Message ID | 20220809171854.3725722-2-willy@infradead.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Allocate and free frozen pages | expand |
On 2022/8/10 1:18, Matthew Wilcox (Oracle) wrote: > Save 17 bytes of text by calculating page_zone() once instead of twice. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Miaohe Lin <linmiaohe@huawei.com> Thanks. > --- > mm/page_alloc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index e5486d47406e..2745865a57c5 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3483,16 +3483,16 @@ void free_unref_page(struct page *page, unsigned int order) > * areas back if necessary. Otherwise, we may have to free > * excessively into the page allocator > */ > + zone = page_zone(page); > migratetype = get_pcppage_migratetype(page); > if (unlikely(migratetype >= MIGRATE_PCPTYPES)) { > if (unlikely(is_migrate_isolate(migratetype))) { > - free_one_page(page_zone(page), page, pfn, order, migratetype, FPI_NONE); > + free_one_page(zone, page, pfn, order, migratetype, FPI_NONE); > return; > } > migratetype = MIGRATE_MOVABLE; > } > > - zone = page_zone(page); > pcp_trylock_prepare(UP_flags); > pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags); > if (pcp) { >
> On Aug 10, 2022, at 01:18, Matthew Wilcox (Oracle) <willy@infradead.org> wrote: > > Save 17 bytes of text by calculating page_zone() once instead of twice. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Thanks.
On Tue, Aug 09, 2022 at 06:18:39PM +0100, Matthew Wilcox (Oracle) wrote: > Save 17 bytes of text by calculating page_zone() once instead of twice. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Mel Gorman <mgorman@techsinguularity.net>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e5486d47406e..2745865a57c5 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3483,16 +3483,16 @@ void free_unref_page(struct page *page, unsigned int order) * areas back if necessary. Otherwise, we may have to free * excessively into the page allocator */ + zone = page_zone(page); migratetype = get_pcppage_migratetype(page); if (unlikely(migratetype >= MIGRATE_PCPTYPES)) { if (unlikely(is_migrate_isolate(migratetype))) { - free_one_page(page_zone(page), page, pfn, order, migratetype, FPI_NONE); + free_one_page(zone, page, pfn, order, migratetype, FPI_NONE); return; } migratetype = MIGRATE_MOVABLE; } - zone = page_zone(page); pcp_trylock_prepare(UP_flags); pcp = pcp_spin_trylock_irqsave(zone->per_cpu_pageset, flags); if (pcp) {
Save 17 bytes of text by calculating page_zone() once instead of twice. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)