linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Improve Zram by separating compression context from kswapd
@ 2025-03-07 12:01 Qun-Wei Lin
  2025-03-07 12:01 ` [PATCH 1/2] mm: Split BLK_FEAT_SYNCHRONOUS and SWP_SYNCHRONOUS_IO into separate read and write flags Qun-Wei Lin
                   ` (4 more replies)
  0 siblings, 5 replies; 39+ messages in thread
From: Qun-Wei Lin @ 2025-03-07 12:01 UTC (permalink / raw)
  To: Jens Axboe, Minchan Kim, Sergey Senozhatsky, Vishal Verma,
	Dan Williams, Dave Jiang, Ira Weiny, Andrew Morton,
	Matthias Brugger, AngeloGioacchino Del Regno, Chris Li,
	Ryan Roberts, Huang, Ying, Kairui Song, Dan Schatzberg,
	Barry Song, Al Viro
  Cc: linux-kernel, linux-block, nvdimm, linux-mm, linux-arm-kernel,
	linux-mediatek, Casper Li, Chinwen Chang, Andrew Yang, James Hsu,
	Qun-Wei Lin

This patch series introduces a new mechanism called kcompressd to
improve the efficiency of memory reclaiming in the operating system. The
main goal is to separate the tasks of page scanning and page compression
into distinct processes or threads, thereby reducing the load on the
kswapd thread and enhancing overall system performance under high memory
pressure conditions.

Problem:
 In the current system, the kswapd thread is responsible for both
 scanning the LRU pages and compressing pages into the ZRAM. This
 combined responsibility can lead to significant performance bottlenecks,
 especially under high memory pressure. The kswapd thread becomes a
 single point of contention, causing delays in memory reclaiming and
 overall system performance degradation.

Target:
 The target of this invention is to improve the efficiency of memory
 reclaiming. By separating the tasks of page scanning and page
 compression into distinct processes or threads, the system can handle
 memory pressure more effectively.

Patch 1:
- Introduces 2 new feature flags, BLK_FEAT_READ_SYNCHRONOUS and
  SWP_READ_SYNCHRONOUS_IO.

Patch 2:
- Implemented the core functionality of Kcompressd and made necessary
  modifications to the zram driver to support it.

In our handheld devices, we found that applying this mechanism under high
memory pressure scenarios can increase the rate of pgsteal_anon per second
by over 260% compared to the situation with only kswapd.

Qun-Wei Lin (2):
  mm: Split BLK_FEAT_SYNCHRONOUS and SWP_SYNCHRONOUS_IO into separate
    read and write flags
  kcompressd: Add Kcompressd for accelerated zram compression

 drivers/block/brd.c             |   3 +-
 drivers/block/zram/Kconfig      |  11 ++
 drivers/block/zram/Makefile     |   3 +-
 drivers/block/zram/kcompressd.c | 340 ++++++++++++++++++++++++++++++++
 drivers/block/zram/kcompressd.h |  25 +++
 drivers/block/zram/zram_drv.c   |  21 +-
 drivers/nvdimm/btt.c            |   3 +-
 drivers/nvdimm/pmem.c           |   5 +-
 include/linux/blkdev.h          |  24 ++-
 include/linux/swap.h            |  31 +--
 mm/memory.c                     |   4 +-
 mm/page_io.c                    |   6 +-
 mm/swapfile.c                   |   7 +-
 13 files changed, 446 insertions(+), 37 deletions(-)
 create mode 100644 drivers/block/zram/kcompressd.c
 create mode 100644 drivers/block/zram/kcompressd.h

-- 
2.45.2



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

end of thread, other threads:[~2025-03-13 20:37 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-07 12:01 [PATCH 0/2] Improve Zram by separating compression context from kswapd Qun-Wei Lin
2025-03-07 12:01 ` [PATCH 1/2] mm: Split BLK_FEAT_SYNCHRONOUS and SWP_SYNCHRONOUS_IO into separate read and write flags Qun-Wei Lin
2025-03-07 12:01 ` [PATCH 2/2] kcompressd: Add Kcompressd for accelerated zram compression Qun-Wei Lin
2025-03-07 19:41   ` Barry Song
2025-03-07 23:13     ` Nhat Pham
2025-03-07 23:14       ` Nhat Pham
2025-03-10 13:26         ` Qun-wei Lin (林群崴)
     [not found]       ` <20250309010541.3152-1-hdanton@sina.com>
2025-03-09 19:56         ` Nhat Pham
2025-03-09 20:44           ` Barry Song
2025-03-09 22:20             ` Nhat Pham
2025-03-10 13:23               ` Qun-wei Lin (林群崴)
     [not found]             ` <20250310103427.3216-1-hdanton@sina.com>
2025-03-10 17:44               ` Barry Song
     [not found]                 ` <20250310230902.3282-1-hdanton@sina.com>
2025-03-11  3:57                   ` Barry Song
2025-03-11  6:36                     ` Greg KH
2025-03-11  5:02       ` Sergey Senozhatsky
2025-03-10 13:26     ` Qun-wei Lin (林群崴)
2025-03-11  7:05       ` Barry Song
2025-03-11  7:25         ` Barry Song
2025-03-11 14:33         ` Qun-wei Lin (林群崴)
2025-03-07 19:34 ` [PATCH 0/2] Improve Zram by separating compression context from kswapd Barry Song
2025-03-10 13:21   ` Qun-wei Lin (林群崴)
2025-03-07 23:03 ` Nhat Pham
2025-03-08  5:41   ` Barry Song
2025-03-10 13:22     ` Qun-wei Lin (林群崴)
2025-03-10 16:58       ` Nhat Pham
2025-03-10 17:30         ` Nhat Pham
2025-03-11  4:58     ` Sergey Senozhatsky
2025-03-11  9:33       ` Barry Song
2025-03-11 14:12         ` Qun-wei Lin (林群崴)
2025-03-12  5:19           ` Sergey Senozhatsky
2025-03-12 18:11 ` Minchan Kim
2025-03-13  3:09   ` Sergey Senozhatsky
2025-03-13  3:45     ` Barry Song
2025-03-13 16:07       ` Minchan Kim
2025-03-13 16:58         ` Barry Song
2025-03-13 17:33           ` Minchan Kim
2025-03-13 20:37             ` Barry Song
2025-03-13  3:52     ` Barry Song
2025-03-13  9:30       ` Barry Song

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