linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] Add obj allocated counter for subpages
@ 2023-06-19 14:35 Alexey Romanov
  2023-06-19 14:35 ` [PATCH v1 1/2] zsmalloc: add allocated objects counter for subpage Alexey Romanov
  0 siblings, 1 reply; 9+ messages in thread
From: Alexey Romanov @ 2023-06-19 14:35 UTC (permalink / raw)
  To: minchan, senozhatsky, akpm; +Cc: linux-mm, linux-kernel, kernel, Alexey Romanov

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-21 14:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 14:35 [PATCH v1 0/2] Add obj allocated counter for subpages Alexey Romanov
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox