linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] zsmalloc: make zsmalloc preemptible
@ 2025-01-27  7:59 Sergey Senozhatsky
  2025-01-27  7:59 ` [RFC PATCH 1/6] zram: deffer slot free notification Sergey Senozhatsky
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Sergey Senozhatsky @ 2025-01-27  7:59 UTC (permalink / raw)
  To: Andrew Morton, Minchan Kim, Johannes Weiner, Yosry Ahmed, Nhat Pham
  Cc: linux-mm, linux-kernel, Sergey Senozhatsky

RFC

This is Part II of the series [1] that makes zram read() and write()
preemptible.  This part focuses only zsmalloc because zsmalloc imposes
atomicity restrictions on its users.  One notable example is object
mapping API, which returns with:
a) local CPU lock held
b) zspage rwlock held

First, zsmalloc is converted to use sleepable locks for internal
structs/data managements.  Second, a new handle mapping is introduced
(temporarily, until we remove zs_map_object/zs_unmap_object) which
doesn't use per-CPU buffers (and hence local CPU lock) but requires
users to provide a pointer to temp buffer for objects copy-in (when
needed) so the callers now should be able to schedule while having
objects mapped.

The series makes zsmalloc preemptible which, in turn, makes zram read()
preemptible.

[1] https://lore.kernel.org/linux-mm/20250127072932.1289973-1-senozhatsky@chromium.org

Sergey Senozhatsky (6):
  zram: deffer slot free notification
  zsmalloc: make zspage lock preemptible
  zsmalloc: convert to sleepable pool lock
  zsmalloc: make class lock sleepable
  zsmalloc: introduce handle mapping API
  zram: switch over to zshandle mapping API

 drivers/block/zram/zcomp.c    |   4 +-
 drivers/block/zram/zcomp.h    |   2 +
 drivers/block/zram/zram_drv.c | 169 ++++++++++-----
 drivers/block/zram/zram_drv.h |   4 +
 include/linux/zsmalloc.h      |  29 +++
 mm/zsmalloc.c                 | 372 ++++++++++++++++++++++------------
 6 files changed, 404 insertions(+), 176 deletions(-)

-- 
2.48.1.262.g85cc9f2d1e-goog



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

end of thread, other threads:[~2025-01-29  5:40 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-27  7:59 [RFC PATCH 0/6] zsmalloc: make zsmalloc preemptible Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 1/6] zram: deffer slot free notification Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 2/6] zsmalloc: make zspage lock preemptible Sergey Senozhatsky
2025-01-27 20:23   ` Uros Bizjak
2025-01-28  0:29     ` Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 3/6] zsmalloc: convert to sleepable pool lock Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 4/6] zsmalloc: make class lock sleepable Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 5/6] zsmalloc: introduce handle mapping API Sergey Senozhatsky
2025-01-27 21:26   ` Yosry Ahmed
2025-01-28  0:37     ` Sergey Senozhatsky
2025-01-28  0:49       ` Yosry Ahmed
2025-01-28  1:13         ` Sergey Senozhatsky
2025-01-27 21:58   ` Yosry Ahmed
2025-01-28  0:59     ` Sergey Senozhatsky
2025-01-28  1:36       ` Yosry Ahmed
2025-01-28  5:29         ` Sergey Senozhatsky
2025-01-28  9:38           ` Sergey Senozhatsky
2025-01-28 17:21             ` Yosry Ahmed
2025-01-29  3:32               ` Sergey Senozhatsky
2025-01-28 11:10           ` Sergey Senozhatsky
2025-01-28 17:22             ` Yosry Ahmed
2025-01-28 23:01               ` Sergey Senozhatsky
2025-01-29  5:40         ` Sergey Senozhatsky
2025-01-27  7:59 ` [RFC PATCH 6/6] zram: switch over to zshandle " Sergey Senozhatsky

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