* [merged] mm-z3fold-remove-unused-function-handle_to_z3fold_header.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 unused function handle_to_z3fold_header()
has been removed from the -mm tree. Its filename was
mm-z3fold-remove-unused-function-handle_to_z3fold_header.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 unused function handle_to_z3fold_header()
handle_to_z3fold_header() is unused now. So we can remove it. As a
result, get_z3fold_header() becomes the only caller of
__get_z3fold_header() and the argument lock is always true. Therefore we
could further fold the __get_z3fold_header() into get_z3fold_header() with
lock = true.
Link: https://lkml.kernel.org/r/20210619093151.1492174-5-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 | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
--- a/mm/z3fold.c~mm-z3fold-remove-unused-function-handle_to_z3fold_header
+++ a/mm/z3fold.c
@@ -253,9 +253,8 @@ static inline void z3fold_page_unlock(st
spin_unlock(&zhdr->page_lock);
}
-
-static inline struct z3fold_header *__get_z3fold_header(unsigned long handle,
- bool lock)
+/* return locked z3fold page if it's not headless */
+static inline struct z3fold_header *get_z3fold_header(unsigned long handle)
{
struct z3fold_buddy_slots *slots;
struct z3fold_header *zhdr;
@@ -269,13 +268,12 @@ static inline struct z3fold_header *__ge
read_lock(&slots->lock);
addr = *(unsigned long *)handle;
zhdr = (struct z3fold_header *)(addr & PAGE_MASK);
- if (lock)
- locked = z3fold_page_trylock(zhdr);
+ locked = z3fold_page_trylock(zhdr);
read_unlock(&slots->lock);
if (locked)
break;
cpu_relax();
- } while (lock);
+ } while (true);
} else {
zhdr = (struct z3fold_header *)(handle & PAGE_MASK);
}
@@ -283,18 +281,6 @@ static inline struct z3fold_header *__ge
return zhdr;
}
-/* Returns the z3fold page where a given handle is stored */
-static inline struct z3fold_header *handle_to_z3fold_header(unsigned long h)
-{
- return __get_z3fold_header(h, false);
-}
-
-/* return locked z3fold page if it's not headless */
-static inline struct z3fold_header *get_z3fold_header(unsigned long h)
-{
- return __get_z3fold_header(h, true);
-}
-
static inline void put_z3fold_header(struct z3fold_header *zhdr)
{
struct page *page = virt_to_page(zhdr);
_
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-unused-function-handle_to_z3fold_header.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.