* [PATCH] mm/page_alloc: remove unneeded variable base
@ 2023-08-03 11:49 Miaohe Lin
2023-08-03 13:08 ` David Hildenbrand
0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2023-08-03 11:49 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe
Since commit 5d0a661d808f ("mm/page_alloc: use only one PCP list for
THP-sized allocations"), local variable base is just as same as order.
So remove it. No functional change intended.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/page_alloc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d7a357cb21ee..96b7c1a7d1f2 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -538,8 +538,6 @@ static void bad_page(struct page *page, const char *reason)
static inline unsigned int order_to_pindex(int migratetype, int order)
{
- int base = order;
-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
if (order > PAGE_ALLOC_COSTLY_ORDER) {
VM_BUG_ON(order != pageblock_order);
@@ -549,7 +547,7 @@ static inline unsigned int order_to_pindex(int migratetype, int order)
VM_BUG_ON(order > PAGE_ALLOC_COSTLY_ORDER);
#endif
- return (MIGRATE_PCPTYPES * base) + migratetype;
+ return (MIGRATE_PCPTYPES * order) + migratetype;
}
static inline int pindex_to_order(unsigned int pindex)
--
2.33.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/page_alloc: remove unneeded variable base
2023-08-03 11:49 [PATCH] mm/page_alloc: remove unneeded variable base Miaohe Lin
@ 2023-08-03 13:08 ` David Hildenbrand
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2023-08-03 13:08 UTC (permalink / raw)
To: Miaohe Lin, akpm; +Cc: linux-mm, linux-kernel
On 03.08.23 13:49, Miaohe Lin wrote:
> Since commit 5d0a661d808f ("mm/page_alloc: use only one PCP list for
> THP-sized allocations"), local variable base is just as same as order.
> So remove it. No functional change intended.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> mm/page_alloc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d7a357cb21ee..96b7c1a7d1f2 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -538,8 +538,6 @@ static void bad_page(struct page *page, const char *reason)
>
> static inline unsigned int order_to_pindex(int migratetype, int order)
> {
> - int base = order;
> -
> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
> if (order > PAGE_ALLOC_COSTLY_ORDER) {
> VM_BUG_ON(order != pageblock_order);
> @@ -549,7 +547,7 @@ static inline unsigned int order_to_pindex(int migratetype, int order)
> VM_BUG_ON(order > PAGE_ALLOC_COSTLY_ORDER);
> #endif
>
> - return (MIGRATE_PCPTYPES * base) + migratetype;
> + return (MIGRATE_PCPTYPES * order) + migratetype;
> }
>
> static inline int pindex_to_order(unsigned int pindex)
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-03 13:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03 11:49 [PATCH] mm/page_alloc: remove unneeded variable base Miaohe Lin
2023-08-03 13:08 ` David Hildenbrand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox