* [merged] mm-z3fold-remove-magic-number-in-z3fold_create_pool.patch removed from -mm tree
@ 2021-07-06 19:18 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-06 19:18 UTC (permalink / raw)
To: hdanton, linmiaohe, mm-commits, vitaly.wool
The patch titled
Subject: mm/z3fold: remove magic number in z3fold_create_pool()
has been removed from the -mm tree. Its filename was
mm-z3fold-remove-magic-number-in-z3fold_create_pool.patch
This patch was dropped because it was merged into mainline or a subsystem tree
------------------------------------------------------
From: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm/z3fold: remove magic number in z3fold_create_pool()
It's meaningless to pass a magic number 2 to __alloc_percpu() as there is
a minimum alignment size of PCPU_MIN_ALLOC_SIZE (> 2) in it. Also there
is no special alignment requirement for unbuddied. So we could replace
this magic number with nature alignment, i.e. __alignof__(struct
list_head), to improve readability.
Link: https://lkml.kernel.org/r/20210619093151.1492174-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Reviewed-by: Vitaly Wool <vitaly.wool@konsulko.com>
Cc: Hillf Danton <hdanton@sina.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/z3fold.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/mm/z3fold.c~mm-z3fold-remove-magic-number-in-z3fold_create_pool
+++ a/mm/z3fold.c
@@ -998,7 +998,8 @@ static struct z3fold_pool *z3fold_create
goto out_c;
spin_lock_init(&pool->lock);
spin_lock_init(&pool->stale_lock);
- pool->unbuddied = __alloc_percpu(sizeof(struct list_head)*NCHUNKS, 2);
+ pool->unbuddied = __alloc_percpu(sizeof(struct list_head) * NCHUNKS,
+ __alignof__(struct list_head));
if (!pool->unbuddied)
goto out_pool;
for_each_possible_cpu(cpu) {
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
mm-zsmallocc-combine-two-atomic-ops-in-zs_pool_dec_isolated.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-06 19:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 19:18 [merged] mm-z3fold-remove-magic-number-in-z3fold_create_pool.patch removed from -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.