linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Romanov <avromanov@sberdevices.ru>
To: <minchan@kernel.org>, <senozhatsky@chromium.org>,
	<akpm@linux-foundation.org>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
	<kernel@sberdevices.ru>,
	Alexey Romanov <avromanov@sberdevices.ru>
Subject: [PATCH v1 0/2] Add obj allocated counter for subpages
Date: Mon, 19 Jun 2023 17:35:04 +0300	[thread overview]
Message-ID: <20230619143506.45253-1-avromanov@sberdevices.ru> (raw)

This patch series adds a count of allocated objects for each of the
zspage subpages. The main idea is that we can use the extra bytes
of the page_type field, because with PAGE_SIZE = 4096 we only use
the first two bytes there.

By storing the number of allocated objects, we can optimize, for
example, the running time of function find_allocated_obj, as well
as the entire compact algorithm as a whole. Also, counting allocated
objects has no effect on the performance of the entire zsmalloc:
bitwise operations are fast and we don't use any extra memory.

I also believe that we can also use this counter (maybe in the future)
in some other things, which will speed up the allocator even more.

Alexey Romanov (2):
  zsmalloc: add allocated objects counter for subpage
  zsmalloc: check empty page in find_alloced_obj

 mm/zsmalloc.c | 41 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 38 insertions(+), 3 deletions(-)

-- 
2.38.1



             reply	other threads:[~2023-06-19 14:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 14:35 Alexey Romanov [this message]
2023-06-19 14:35 ` [PATCH v1 1/2] zsmalloc: add allocated objects counter for subpage Alexey Romanov
2023-06-20 10:36   ` Sergey Senozhatsky
2023-06-20 11:16     ` Alexey Romanov
2023-06-21 13:17       ` Sergey Senozhatsky
2023-06-21 13:41         ` Alexey Romanov
2023-06-21 13:55           ` Sergey Senozhatsky
2023-06-21 13:59             ` Alexey Romanov
2023-06-21 14:18               ` Sergey Senozhatsky

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=20230619143506.45253-1-avromanov@sberdevices.ru \
    --to=avromanov@sberdevices.ru \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@sberdevices.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox