lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250127080254.1302026-1-senozhatsky@chromium.org>
Date: Mon, 27 Jan 2025 16:59:25 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Andrew Morton <akpm@...ux-foundation.org>,
	Minchan Kim <minchan@...nel.org>,
	Johannes Weiner <hannes@...xchg.org>,
	Yosry Ahmed <yosry.ahmed@...ux.dev>,
	Nhat Pham <nphamcs@...il.com>
Cc: linux-mm@...ck.org,
	linux-kernel@...r.kernel.org,
	Sergey Senozhatsky <senozhatsky@...omium.org>
Subject: [RFC PATCH 0/6] zsmalloc: make zsmalloc preemptible

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ