Skip to content

zram: add accounting for incompressible pages#755

Open
blktests-ci[bot] wants to merge 15 commits intofor-next_basefrom
series/1081514=>for-next
Open

zram: add accounting for incompressible pages#755
blktests-ci[bot] wants to merge 15 commits intofor-next_basefrom
series/1081514=>for-next

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented Apr 21, 2026

Pull request for series with
subject: zram: add accounting for incompressible pages
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1081514

axboe and others added 15 commits April 3, 2026 10:16
Merge in io_uring changes slated for 7.1 to avoid conflicts with the
fuse io_uring prep patches, as they end up touching both ublk and
overlap with io_uring core changes.

* for-7.1/io_uring: (60 commits)
  io_uring/timeout: use 'ctx' consistently
  io_uring/rw: clean up __io_read() obsolete comment and early returns
  io_uring/zcrx: use correct mmap off constants
  io_uring/zcrx: use dma_len for chunk size calculation
  io_uring/zcrx: don't clear not allocated niovs
  io_uring/zcrx: don't use mark0 for allocating xarray
  io_uring: cast id to u64 before shifting in io_allocate_rbuf_ring()
  io_uring/zcrx: reject REG_NODEV with large rx_buf_size
  io_uring/cancel: validate opcode for IORING_ASYNC_CANCEL_OP
  io_uring/rsrc: use io_cache_free() to free node
  io_uring/zcrx: rename zcrx [un]register functions
  io_uring/zcrx: check ctrl op payload struct sizes
  io_uring/zcrx: cache fallback availability in zcrx ctx
  io_uring/zcrx: warn on a repeated area append
  io_uring/zcrx: consolidate dma syncing
  io_uring/zcrx: netmem array as refiling format
  io_uring/zcrx: warn on alloc with non-empty pp cache
  io_uring/zcrx: move count check into zcrx_get_free_niov
  io_uring/zcrx: use guards for locking
  io_uring/zcrx: add a struct for refill queue
  ...
…bvec()

Currently, io_buffer_register_bvec() takes in a request. In preparation
for supporting kernel-populated buffers in fuse io-uring (which will
need to register bvecs directly, not through a struct request), rename
this to io_buffer_register_request().

A subsequent patch will commandeer the "io_buffer_register_bvec()"
function name to support registering bvecs directly.

Rename io_buffer_unregister_bvec() to a more generic name,
io_buffer_unregister(), as both io_buffer_register_request() and
io_buffer_register_bvec() callers will use it for unregistration.

Signed-off-by: Joanne Koong <[email protected]>
Reviewed-by: Caleb Sander Mateos <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Split the main initialization logic in io_buffer_register_request() into
a helper function.

This is a preparatory patch for supporting kernel-populated buffers in
fuse io-uring, which will be reusing this logic.

Signed-off-by: Joanne Koong <[email protected]>
Reviewed-by: Caleb Sander Mateos <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Add io_buffer_register_bvec() for registering a bvec array.

This is a preparatory patch for fuse-over-io-uring zero-copy.

Signed-off-by: Joanne Koong <[email protected]>
Reviewed-by: Caleb Sander Mateos <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Rename IO_IMU_DEST and IO_IMU_SOURCE to IO_BUF_DEST and IO_BUF_SOURCE
and export it so subsystems may use it.

This is needed by the io_buffer_register_bvec() path for callers who may
need the buffer to be both readable and writable.

Signed-off-by: Joanne Koong <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
* for-7.1/io_uring-fuse:
  io_uring/rsrc: rename and export IO_IMU_DEST / IO_IMU_SOURCE
  io_uring/rsrc: add io_buffer_register_bvec()
  io_uring/rsrc: split io_buffer_register_request() logic
  io_uring/rsrc: rename io_buffer_register_bvec()/io_buffer_unregister_bvec()
* block-7.1:
  zloop: remove irq-safe locking
  zloop: factor out zloop_mark_{full,empty} helpers
  zloop: set RQF_QUIET when completing requests on deleted devices
  zloop: improve the unaligned write pointer warning
  zloop: use vfs_truncate
  zloop: fix write pointer calculation in zloop_forget_cache
* io_uring-7.1:
  io_uring/poll: fix signed comparison in io_poll_get_ownership()
As with the idling code before it, the error exit path should check for
a NULL tctx->io_wq before calling io_wq_put_and_exit().

Fixes: 7880174 ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling")
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
* io_uring-7.1:
  io_uring/tctx: check for setup tctx->io_wq before teardown
syzbot reports that it's hitting the below condition for exiting an
io_wq context:

WARN_ON_ONCE(!test_bit(IO_WQ_BIT_EXIT, &wq->state))

in io_wq_put_and_exit(), which can be triggered with memory allocation
fault injection. Ensure that the io_wq is marked as exiting to silence
this warning trigger.

Reported-by: [email protected]
Fixes: 7880174 ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling")
Signed-off-by: Jens Axboe <[email protected]>
* io_uring-7.1:
  io_uring/tctx: mark io_wq as exiting before error path teardown
* block-7.1:
  block/blk-throttle: Add WQ_PERCPU to alloc_workqueue users
  block: Add WQ_PERCPU to alloc_workqueue users
  block: relax pgmap check in bio_add_page for compatible zone device pages
  block: add pgmap check to biovec_phys_mergeable
  floppy: fix reference leak on platform_device_register() failure
  ublk: use unchecked copy helpers for bio page data
  t10-pi: reduce ref tag code duplication
1. Rename write_incompressible_page to write_huge_page since huge page
could be recompressed with secondary algorithms.
2. Similar to huge page, add incompressible_pages accounting for current
incompressible pages, and incompressible_pages_since accounting for
incompressible pages since zram set up. The accounting value can be showed
by mm_stat.

Signed-off-by: qiwu.chen <[email protected]>
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 21, 2026

Upstream branch: 1796ef2
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081514
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Apr 22, 2026

Upstream branch: f53ce51
series: https://patchwork.kernel.org/project/linux-block/list/?series=1081514
version: 1

Pull request is NOT updated. Failed to apply https://patchwork.kernel.org/project/linux-block/list/?series=1081514
error message:

Cmd('git') failed due to: exit code(128)
  cmdline: git am --3way
  stdout: 'Applying: zram: add accounting for incompressible pages
Using index info to reconstruct a base tree...
M	drivers/block/zram/zram_drv.c
M	drivers/block/zram/zram_drv.h
Falling back to patching base and 3-way merge...
Auto-merging drivers/block/zram/zram_drv.h
Auto-merging drivers/block/zram/zram_drv.c
CONFLICT (content): Merge conflict in drivers/block/zram/zram_drv.c
Patch failed at 0001 zram: add accounting for incompressible pages'
  stderr: 'error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"'

conflict:

diff --cc drivers/block/zram/zram_drv.c
index aebc710f0d6a,f16d52c4ed79..000000000000
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@@ -2476,11 -2490,14 +2485,19 @@@ static int recompress_slot(struct zram 
  		 * Secondary algorithms failed to re-compress the page
  		 * in a way that would save memory.
  		 *
 -		 * Mark the object incompressible if the max-priority
 -		 * algorithm couldn't re-compress it.
 +		 * Mark the object incompressible if the max-priority (the
 +		 * last configured one) algorithm couldn't re-compress it.
  		 */
++<<<<<<< HEAD
 +		if (highest_priority_algorithm(zram, prio))
 +			set_slot_flag(zram, index, ZRAM_INCOMPRESSIBLE);
++=======
+ 		if (prio < zram->num_active_comps)
+ 			return 0;
+ 		set_slot_flag(zram, index, ZRAM_INCOMPRESSIBLE);
+ 		atomic64_inc(&zram->stats.incompressible_pages);
+ 		atomic64_inc(&zram->stats.incompressible_pages_since);
++>>>>>>> zram: add accounting for incompressible pages
  		return 0;
  	}
  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants