Skip to content

RFC mm/zsmalloc: Split zsdesc from struct page

Hyeonggon Yoo linux-mm llvm oe-kbuild-all 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest21 patches 10 repliesIn review
  2. v2 RFC21 patches 10 repliesSuperseded
  3. v1 RFC25 patches 5 repliesSuperseded

Changes in v3 from the cover letter

- rebased to the latest mm-unstable
- adjusted comments from Sergey Senozhatsky (Moving zsdesc definition, kerneldoc fix) and Yosry Ahmed (adding memcg_data field to zsdesc)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21mm/zsmalloc: create new struct zsdescmm/zsmalloc.c+50 -170 replies
2/21mm/zsmalloc: add utility functions for zsdescmm/zsmalloc.c+33 -00 replies
3/21mm/zsmalloc: replace first_page to first_zsdesc in struct zspagemm/zsmalloc.c+4 -42 replies
4/21mm/zsmalloc: add alternatives of frequently used helper functionsmm/zsmalloc.c+25 -22 replies
5/21mm/zsmalloc: convert {try,}lock_zspage() to use zsdescmm/zsmalloc.c+35 -200 replies
6/21mm/zsmalloc: convert __zs_{map,unmap}_object() to use zsdescmm/zsmalloc.c+13 -80 replies
7/21mm/zsmalloc: convert obj_to_location() and its users to use zsdescmm/zsmalloc.c+38 -370 replies
8/21mm/zsmalloc: convert obj_malloc() to use zsdescmm/zsmalloc.c+8 -80 replies
9/21mm/zsmalloc: convert create_page_chain() and its users to use zsdescmm/zsmalloc.c+81 -390 replies
10/21mm/zsmalloc: convert obj_allocated() and related helpers to use zsdescmm/zsmalloc.c+10 -100 replies
11/21mm/zsmalloc: convert init_zspage() to use zsdescmm/zsmalloc.c+8 -80 replies
12/21mm/zsmalloc: convert obj_to_page() and zs_free() to use zsdescmm/zsmalloc.c+5 -50 replies
13/21mm/zsmalloc: convert reset_page() to reset_zsdesc()mm/zsmalloc.c+13 -110 replies
14/21mm/zsmalloc: convert zs_page_{isolate,migrate,putback} to use zsdescmm/zsmalloc.c+32 -182 replies
15/21mm/zsmalloc: convert __free_zspage() to use zsdescmm/zsmalloc.c+15 -100 replies
16/21mm/zsmalloc: convert location_to_obj() to use zsdescmm/zsmalloc.c+6 -60 replies
17/21mm/zsmalloc: convert migrate_zspage() to use zsdescmm/zsmalloc.c+4 -40 replies
18/21mm/zsmalloc: convert get_zspage() to take zsdescmm/zsmalloc.c+12 -120 replies
19/21mm/zsmalloc: convert SetZsPageMovable() to use zsdescmm/zsmalloc.c+5 -50 replies
20/21mm/zsmalloc: remove now unused helper functionsmm/zsmalloc.c+3 -260 replies
21/21mm/zsmalloc: convert {get,set}_first_obj_offset() to use zsdescmm/zsmalloc.c+9 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [RFC PATCH v3 00/21] mm/zsmalloc: Split zsdesc from struct page

RFC v2: https://lore.kernel.org/linux-mm/[email protected]/

v2 -> v3:
- rebased to the latest mm-unstable
- adjusted comments from Sergey Senozhatsky (Moving zsdesc definition, kerneldoc fix) and Yosry Ahmed (adding memcg_data field to zsdesc)

V3 update is a bit late, but I still believe this is worth doing. It would be nice to get comments/reviews/acks from maintainers/people.

Cover Letter:

The purpose of this series is to define own memory descriptor for zsmalloc, instead of re-using various fields of struct page. This is a part of the effort to reduce the size of struct page to unsigned long and enable dynamic allocation of memory descriptors.

While [1] outlines this ultimate objective, the current use of struct page is highly dependent on its definition, making it challenging to separately allocate memory descriptors.

Therefore, this series introduces new descriptor for zsmalloc, called zsdesc. It overlays struct page for now, but will eventually be allocated independently in the future. And apart from dynamic allocation of descriptors, this is a nice cleanup.

This work is also available at:
https://gitlab.com/hyeyoo/linux/-/tree/separate_zsdesc_rfc-v3

[1] State Of The Page, August 2022
https://lore.kernel.org/lkml/[email protected]

Hyeonggon Yoo (21):
mm/zsmalloc: create new struct zsdesc
mm/zsmalloc: add utility functions for zsdesc
mm/zsmalloc: replace first_page to first_zsdesc in struct zspage mm/zsmalloc: add alternatives of frequently used helper functions mm/zsmalloc: convert {try,}lock_zspage() to use zsdesc mm/zsmalloc: convert __zs_{map,unmap}_object() to use zsdesc mm/zsmalloc: convert obj_to_location() and its users to use zsdesc mm/zsmalloc: convert obj_malloc() to use zsdesc mm/zsmalloc: convert create_page_chain() and its users to use zsdesc mm/zsmalloc: convert obj_allocated() and related helpers to use zsdesc mm/zsmalloc: convert init_zspage() to use zsdesc mm/zsmalloc: convert obj_to_page() and zs_free() to use zsdesc mm/zsmalloc: convert reset_page() to reset_zsdesc() mm/zsmalloc: convert zs_page_{isolate,migrate,putback} to use zsdesc mm/zsmalloc: convert __free_zspage() to use zsdesc mm/zsmalloc: convert location_to_obj() to use zsdesc mm/zsmalloc: convert migrate_zspage() to use zsdesc mm/zsmalloc: convert get_zspage() to take zsdesc mm/zsmalloc: convert SetZsPageMovable() to use zsdesc mm/zsmalloc: remove now unused helper functions mm/zsmalloc: convert {get,set}_first_obj_offset() to use zsdesc

 mm/zsmalloc.c | 578 +++++++++++++++++++++++++++++++-------------------
 1 file changed, 364 insertions(+), 214 deletions(-)
Signature · 1 line
2.39.3