* [PATCH] zram: fix partial I/O config check @ 2026-05-31 12:35 Jianyue Wu 2026-05-31 21:38 ` Barry Song 0 siblings, 1 reply; 5+ messages in thread From: Jianyue Wu @ 2026-05-31 12:35 UTC (permalink / raw) To: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Chris Li, Kairui Song, Andrew Morton, Barry Song, Baoquan He Cc: linux-kernel, linux-block, linux-mm, Christoph Hellwig, Jianyue Wu IS_ENABLED() expects a CONFIG_* symbol. Use the real Kconfig symbol so this warning reflects whether synchronous partial I/O is built in. Signed-off-by: Jianyue Wu <wujianyue000@gmail.com> --- zram: fix partial I/O config check --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 6e1330ce4bc1..72f89fd5572e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1510,7 +1510,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, { atomic64_inc(&zram->stats.bd_reads); if (!parent) { - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_ZRAM_PARTIAL_IO))) return -EIO; return read_from_bdev_sync(zram, page, index, blk_idx); } --- base-commit: 404fb4f38e8f38469dfff4df0205c9d18eeb1f57 change-id: 20260531-zram-fix-partial-io-config-check-on-akpm-c62b972416f8 Best regards, -- Jianyue Wu <wujianyue000@gmail.com> ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: fix partial I/O config check 2026-05-31 12:35 [PATCH] zram: fix partial I/O config check Jianyue Wu @ 2026-05-31 21:38 ` Barry Song 2026-06-01 0:25 ` Jianyue Wu 0 siblings, 1 reply; 5+ messages in thread From: Barry Song @ 2026-05-31 21:38 UTC (permalink / raw) To: Jianyue Wu Cc: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Chris Li, Kairui Song, Andrew Morton, Baoquan He, linux-kernel, linux-block, linux-mm, Christoph Hellwig On Sun, May 31, 2026 at 8:35 PM Jianyue Wu <wujianyue000@gmail.com> wrote: > > IS_ENABLED() expects a CONFIG_* symbol. Use the real Kconfig symbol so > this warning reflects whether synchronous partial I/O is built in. > > Signed-off-by: Jianyue Wu <wujianyue000@gmail.com> > --- > zram: fix partial I/O config check > --- > drivers/block/zram/zram_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 6e1330ce4bc1..72f89fd5572e 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -1510,7 +1510,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, > { > atomic64_inc(&zram->stats.bd_reads); > if (!parent) { > - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) > + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_ZRAM_PARTIAL_IO))) However, I don't see ZRAM_PARTIAL_IO defined as a Kconfig option. #if PAGE_SIZE != 4096 static inline bool is_partial_io(struct bio_vec *bvec) { return bvec->bv_len != PAGE_SIZE; } #define ZRAM_PARTIAL_IO 1 #else static inline bool is_partial_io(struct bio_vec *bvec) { return false; } #endif > return -EIO; > return read_from_bdev_sync(zram, page, index, blk_idx); > } > > --- > base-commit: 404fb4f38e8f38469dfff4df0205c9d18eeb1f57 > change-id: 20260531-zram-fix-partial-io-config-check-on-akpm-c62b972416f8 > > Best regards, > -- > Jianyue Wu <wujianyue000@gmail.com> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: fix partial I/O config check 2026-05-31 21:38 ` Barry Song @ 2026-06-01 0:25 ` Jianyue Wu 2026-06-01 0:44 ` Baoquan He 0 siblings, 1 reply; 5+ messages in thread From: Jianyue Wu @ 2026-06-01 0:25 UTC (permalink / raw) To: Barry Song Cc: Minchan Kim, Sergey Senozhatsky, Jens Axboe, Chris Li, Kairui Song, Andrew Morton, Baoquan He, linux-kernel, linux-block, linux-mm, Christoph Hellwig On Mon, Jun 1, 2026 at 5:38 AM Barry Song <baohua@kernel.org> wrote: > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > > index 6e1330ce4bc1..72f89fd5572e 100644 > > --- a/drivers/block/zram/zram_drv.c > > +++ b/drivers/block/zram/zram_drv.c > > @@ -1510,7 +1510,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, > > { > > atomic64_inc(&zram->stats.bd_reads); > > if (!parent) { > > - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) > > + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_ZRAM_PARTIAL_IO))) > > However, I don't see ZRAM_PARTIAL_IO defined as a Kconfig option. You are right. ZRAM_PARTIAL_IO is a local source-level define, not a Kconfig symbol. Please drop this patch. Sorry for the noise. Thanks, Jianyue ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: fix partial I/O config check 2026-06-01 0:25 ` Jianyue Wu @ 2026-06-01 0:44 ` Baoquan He 2026-06-01 1:38 ` Jianyue Wu 0 siblings, 1 reply; 5+ messages in thread From: Baoquan He @ 2026-06-01 0:44 UTC (permalink / raw) To: Jianyue Wu Cc: Barry Song, Minchan Kim, Sergey Senozhatsky, Jens Axboe, Chris Li, Kairui Song, Andrew Morton, linux-kernel, linux-block, linux-mm, Christoph Hellwig On 06/01/26 at 08:25am, Jianyue Wu wrote: > On Mon, Jun 1, 2026 at 5:38 AM Barry Song <baohua@kernel.org> wrote: > > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > > > index 6e1330ce4bc1..72f89fd5572e 100644 > > > --- a/drivers/block/zram/zram_drv.c > > > +++ b/drivers/block/zram/zram_drv.c > > > @@ -1510,7 +1510,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, > > > { > > > atomic64_inc(&zram->stats.bd_reads); > > > if (!parent) { > > > - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) > > > + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_ZRAM_PARTIAL_IO))) > > > > However, I don't see ZRAM_PARTIAL_IO defined as a Kconfig option. > > You are right. ZRAM_PARTIAL_IO is a local source-level define, not a > Kconfig symbol. How about removing ZRAM_PARTIAL_IO and use PAGE_SIZE to check? diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 07111455eecf..ca0c29482283 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -221,7 +221,6 @@ static inline bool is_partial_io(struct bio_vec *bvec) { return bvec->bv_len != PAGE_SIZE; } -#define ZRAM_PARTIAL_IO 1 #else static inline bool is_partial_io(struct bio_vec *bvec) { @@ -1507,7 +1506,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, { atomic64_inc(&zram->stats.bd_reads); if (!parent) { - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) + if (WARN_ON_ONCE(PAGE_SIZE == 4096)) return -EIO; return read_from_bdev_sync(zram, page, index, blk_idx); } ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] zram: fix partial I/O config check 2026-06-01 0:44 ` Baoquan He @ 2026-06-01 1:38 ` Jianyue Wu 0 siblings, 0 replies; 5+ messages in thread From: Jianyue Wu @ 2026-06-01 1:38 UTC (permalink / raw) To: Baoquan He Cc: Barry Song, Minchan Kim, Sergey Senozhatsky, Jens Axboe, Chris Li, Kairui Song, Andrew Morton, linux-kernel, linux-block, linux-mm, Christoph Hellwig On Mon, Jun 1, 2026 at 8:44 AM Baoquan He <baoquan.he@linux.dev> wrote: > > On 06/01/26 at 08:25am, Jianyue Wu wrote: > > On Mon, Jun 1, 2026 at 5:38 AM Barry Song <baohua@kernel.org> wrote: > > > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > > > > index 6e1330ce4bc1..72f89fd5572e 100644 > > > > --- a/drivers/block/zram/zram_drv.c > > > > +++ b/drivers/block/zram/zram_drv.c > > > > @@ -1510,7 +1510,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, > > > > { > > > > atomic64_inc(&zram->stats.bd_reads); > > > > if (!parent) { > > > > - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) > > > > + if (WARN_ON_ONCE(!IS_ENABLED(CONFIG_ZRAM_PARTIAL_IO))) > > > > > > However, I don't see ZRAM_PARTIAL_IO defined as a Kconfig option. > > > > You are right. ZRAM_PARTIAL_IO is a local source-level define, not a > > Kconfig symbol. > > > How about removing ZRAM_PARTIAL_IO and use PAGE_SIZE to check? > > diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c > index 07111455eecf..ca0c29482283 100644 > --- a/drivers/block/zram/zram_drv.c > +++ b/drivers/block/zram/zram_drv.c > @@ -221,7 +221,6 @@ static inline bool is_partial_io(struct bio_vec *bvec) > { > return bvec->bv_len != PAGE_SIZE; > } > -#define ZRAM_PARTIAL_IO 1 > #else > static inline bool is_partial_io(struct bio_vec *bvec) > { > @@ -1507,7 +1506,7 @@ static int read_from_bdev(struct zram *zram, struct page *page, u32 index, > { > atomic64_inc(&zram->stats.bd_reads); > if (!parent) { > - if (WARN_ON_ONCE(!IS_ENABLED(ZRAM_PARTIAL_IO))) > + if (WARN_ON_ONCE(PAGE_SIZE == 4096)) > return -EIO; > return read_from_bdev_sync(zram, page, index, blk_idx); > } > Yes, that looks good. Thanks for the patch. The synchronous backing-device read is only needed on PAGE_SIZE != 4096 systems, where partial I/O can happen. On 4K systems is_partial_io() always returns false, so this path should not be hit in normal operation. Thanks, Jianyue ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-01 1:38 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-31 12:35 [PATCH] zram: fix partial I/O config check Jianyue Wu 2026-05-31 21:38 ` Barry Song 2026-06-01 0:25 ` Jianyue Wu 2026-06-01 0:44 ` Baoquan He 2026-06-01 1:38 ` Jianyue Wu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox