linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/7] zsmalloc: preemptible object mapping
@ 2025-01-30  4:42 Sergey Senozhatsky
  2025-01-30  4:42 ` [PATCHv2 1/7] zsmalloc: factor out pool locking helpers Sergey Senozhatsky
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Sergey Senozhatsky @ 2025-01-30  4:42 UTC (permalink / raw)
  To: Andrew Morton, Yosry Ahmed
  Cc: Minchan Kim, Johannes Weiner, Nhat Pham, Uros Bizjak, linux-mm,
	linux-kernel, Sergey Senozhatsky

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 RW-"lock" (it's atomic_t
in fact) for zspage migration protection.  Second, a new handle mapping
is introduced which doesn't use per-CPU buffers (and hence no local CPU
lock), does fewer memcpy() calls, but requires users to provide a
pointer to temp buffer for object copy-in (when needed).  Third, zram is
converted to the new zsmalloc mapping API and thus zram read() becomes
preemptible.

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

v1 -> v2:
- Tweak cmpxchg loop (Uros)
- Addressed feedback provided by Yosry

Sergey Senozhatsky (7):
  zsmalloc: factor out pool locking helpers
  zsmalloc: re-shuffle zs_pool members
  zsmalloc: factor out size-class locking helpers
  zsmalloc: make zspage lock preemptible
  zsmalloc: introduce new object mapping API
  zram: switch to new zsmalloc object mapping API
  zram: add might_sleep to zcomp API

 drivers/block/zram/zcomp.c    |   6 +-
 drivers/block/zram/zcomp.h    |   2 +
 drivers/block/zram/zram_drv.c |  28 +--
 include/linux/zsmalloc.h      |   8 +
 mm/zsmalloc.c                 | 379 ++++++++++++++++++++++++++--------
 5 files changed, 313 insertions(+), 110 deletions(-)

--
2.48.1.262.g85cc9f2d1e-goog



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

end of thread, other threads:[~2025-01-30 14:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-30  4:42 [PATCHv2 0/7] zsmalloc: preemptible object mapping Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 1/7] zsmalloc: factor out pool locking helpers Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 2/7] zsmalloc: re-shuffle zs_pool members Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 3/7] zsmalloc: factor out size-class locking helpers Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 4/7] zsmalloc: make zspage lock preemptible Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 5/7] zsmalloc: introduce new object mapping API Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 6/7] zram: switch to new zsmalloc " Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 7/7] zram: add might_sleep to zcomp API Sergey Senozhatsky
2025-01-30 14:21 ` [PATCHv2 0/7] zsmalloc: preemptible object mapping Sergey Senozhatsky

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