[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230619143506.45253-3-avromanov@sberdevices.ru>
Date: Mon, 19 Jun 2023 17:35:06 +0300
From: Alexey Romanov <avromanov@...rdevices.ru>
To: <minchan@...nel.org>, <senozhatsky@...omium.org>,
<akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<kernel@...rdevices.ru>, Alexey Romanov <avromanov@...rdevices.ru>
Subject: [PATCH v1 2/2] zsmalloc: check empty page in find_alloced_obj
It makes no sense to search for an allocated object
if there are none on the page. Using this check, we
get rid of the extra kmap_atomic, as well as the search
for a tagged object. On my synthetic test data, this
change speed up zsmalloc compaction time by up to 10%.
Signed-off-by: Alexey Romanov <avromanov@...rdevices.ru>
---
mm/zsmalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index dd6e2c3429e0..d0ce579dcde5 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1764,6 +1764,9 @@ static unsigned long find_tagged_obj(struct size_class *class,
static unsigned long find_alloced_obj(struct size_class *class,
struct page *page, int *obj_idx)
{
+ if (!get_obj_allocated(page))
+ return 0;
+
return find_tagged_obj(class, page, obj_idx, OBJ_ALLOCATED_TAG);
}
--
2.38.1
Powered by blists - more mailing lists