From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, minchan@kernel.org,
AVRomanov@sberdevices.ru, avromanov@sberdevices.ru,
senozhatsky@chromium.org, akpm@linux-foundation.org
Subject: [merged mm-stable] zsmalloc-do-not-scan-for-allocated-objects-in-empty-zspage.patch removed from -mm tree
Date: Fri, 11 Aug 2023 15:59:03 -0700 [thread overview]
Message-ID: <20230811225904.89126C433C8@smtp.kernel.org> (raw)
The quilt patch titled
Subject: zsmalloc: do not scan for allocated objects in empty zspage
has been removed from the -mm tree. Its filename was
zsmalloc-do-not-scan-for-allocated-objects-in-empty-zspage.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: zsmalloc: do not scan for allocated objects in empty zspage
Date: Sat, 24 Jun 2023 14:12:14 +0900
Patch series "zsmalloc: small compaction improvements", v2.
A tiny series that can reduce the number of find_alloced_obj() invocations
(which perform a linear scan of sub-page) during compaction. Inspired by
Alexey Romanov's findings.
This patch (of 3):
zspage migration can terminate as soon as it moves the last allocated
object from the source zspage. Add a simple helper zspage_empty() that
tests zspage ->inuse on each migration iteration.
Link: https://lkml.kernel.org/r/20230624053120.643409-2-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Suggested-by: Alexey Romanov <AVRomanov@sberdevices.ru>
Reviewed-by: Alexey Romanov <avromanov@sberdevices.ru>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/zsmalloc.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/mm/zsmalloc.c~zsmalloc-do-not-scan-for-allocated-objects-in-empty-zspage
+++ a/mm/zsmalloc.c
@@ -1147,6 +1147,11 @@ static bool zspage_full(struct size_clas
return get_zspage_inuse(zspage) == class->objs_per_zspage;
}
+static bool zspage_empty(struct zspage *zspage)
+{
+ return get_zspage_inuse(zspage) == 0;
+}
+
/**
* zs_lookup_class_index() - Returns index of the zsmalloc &size_class
* that hold objects of the provided size.
@@ -1625,6 +1630,10 @@ static void migrate_zspage(struct zs_poo
obj_idx++;
record_obj(handle, free_obj);
obj_free(class->size, used_obj);
+
+ /* Stop if there are no more objects to migrate */
+ if (zspage_empty(get_zspage(s_page)))
+ break;
}
/* Remember last position in this iteration */
_
Patches currently in -mm which might be from senozhatsky@chromium.org are
reply other threads:[~2023-08-11 22:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230811225904.89126C433C8@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=AVRomanov@sberdevices.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.