All of lore.kernel.org
 help / color / mirror / Atom feed
* + zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch added to mm-unstable branch
@ 2023-04-03 20:42 Andrew Morton
  2023-04-04  2:00 ` Sergey Senozhatsky
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2023-04-03 20:42 UTC (permalink / raw)
  To: mm-commits, willy, viro, senozhatsky, minchan, mcgrof, martin,
	hubcap, hch, brauner, axboe, p.raghav, akpm


The patch titled
     Subject: zram: always chain bio to the parent in read_from_bdev_async
has been added to the -mm mm-unstable branch.  Its filename is
     zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Pankaj Raghav <p.raghav@samsung.com>
Subject: zram: always chain bio to the parent in read_from_bdev_async
Date: Mon, 3 Apr 2023 15:22:17 +0200

Patch series "remove page_endio()", v2.

It was decided to remove page_endio() as per the previous RFC
discussion[1] of this series and move that functionality into the caller
itself.  One of the side benefit of doing that is the callers have been
modified to directly work on folios as page_endio() already worked on
folios.

mpage changes were tested with a simple boot testing.  orangefs was tested
by Mike Marshall (No code changes since he tested).  Basic testing was
performed for the zram changes with fio and writeback to a backing device.


This patch (of 5):

zram_bvec_read() is called with the bio set to NULL only in
writeback_store() function.  When a writeback is triggered,
zram_bvec_read() is called only if ZRAM_WB flag is not set.  That will
result only calling zram_read_from_zspool() in __zram_bvec_read().

rw_page callback used to call read_from_bdev_async with a NULL parent bio
but that has been removed since commit 3222d8c2a7f8 ("block: remove
->rw_page").

We can now safely always call bio_chain() as read_from_bdev_async() will
be called with a parent bio set.  A WARN_ON_ONCE is added if this function
is called with parent set to NULL.

Link: https://lore.kernel.org/linux-mm/ZBHcl8Pz2ULb4RGD@infradead.org/ [1]
Link: https://lore.kernel.org/linux-mm/20230322135013.197076-1-p.raghav@samsung.com/ [2]
Link: https://lore.kernel.org/linux-mm/8adb0770-6124-e11f-2551-6582db27ed32@samsung.com/ [3]
Link: https://lkml.kernel.org/r/20230403132221.94921-2-p.raghav@samsung.com
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Martin Brandenburg <martin@omnibond.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Marshall <hubcap@omnibond.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/block/zram/zram_drv.c |   16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

--- a/drivers/block/zram/zram_drv.c~zram-always-chain-bio-to-the-parent-in-read_from_bdev_async
+++ a/drivers/block/zram/zram_drv.c
@@ -606,15 +606,6 @@ static void free_block_bdev(struct zram
 	atomic64_dec(&zram->stats.bd_count);
 }
 
-static void zram_page_end_io(struct bio *bio)
-{
-	struct page *page = bio_first_page_all(bio);
-
-	page_endio(page, op_is_write(bio_op(bio)),
-			blk_status_to_errno(bio->bi_status));
-	bio_put(bio);
-}
-
 /*
  * Returns 1 if the submission is successful.
  */
@@ -634,11 +625,10 @@ static int read_from_bdev_async(struct z
 		return -EIO;
 	}
 
-	if (!parent)
-		bio->bi_end_io = zram_page_end_io;
-	else
-		bio_chain(bio, parent);
+	if (WARN_ON_ONCE(!parent))
+		return -EINVAL;
 
+	bio_chain(bio, parent);
 	submit_bio(bio);
 	return 1;
 }
_

Patches currently in -mm which might be from p.raghav@samsung.com are

zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch
orangefs-use-folios-in-orangefs_readahead.patch
mpage-split-bi_end_io-callback-for-reads-and-writes.patch
mpage-use-folios-in-bio-end_io-handler.patch
filemap-remove-page_endio.patch


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

* Re: + zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch added to mm-unstable branch
  2023-04-03 20:42 + zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch added to mm-unstable branch Andrew Morton
@ 2023-04-04  2:00 ` Sergey Senozhatsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2023-04-04  2:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mm-commits, willy, viro, senozhatsky, minchan, mcgrof, martin,
	hubcap, hch, brauner, axboe, p.raghav

On (23/04/03 13:42), Andrew Morton wrote:
[..]
> zram_bvec_read() is called with the bio set to NULL only in
> writeback_store() function.  When a writeback is triggered,
> zram_bvec_read() is called only if ZRAM_WB flag is not set.  That will
> result only calling zram_read_from_zspool() in __zram_bvec_read().
> 
> rw_page callback used to call read_from_bdev_async with a NULL parent bio
> but that has been removed since commit 3222d8c2a7f8 ("block: remove
> ->rw_page").
> 
> We can now safely always call bio_chain() as read_from_bdev_async() will
> be called with a parent bio set.  A WARN_ON_ONCE is added if this function
> is called with parent set to NULL.
> 
> Link: https://lore.kernel.org/linux-mm/ZBHcl8Pz2ULb4RGD@infradead.org/ [1]
> Link: https://lore.kernel.org/linux-mm/20230322135013.197076-1-p.raghav@samsung.com/ [2]
> Link: https://lore.kernel.org/linux-mm/8adb0770-6124-e11f-2551-6582db27ed32@samsung.com/ [3]
> Link: https://lkml.kernel.org/r/20230403132221.94921-2-p.raghav@samsung.com
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Luis Chamberlain <mcgrof@kernel.org>
> Cc: Martin Brandenburg <martin@omnibond.com>
> Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
> Cc: Mike Marshall <hubcap@omnibond.com>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>

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

end of thread, other threads:[~2023-04-04  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03 20:42 + zram-always-chain-bio-to-the-parent-in-read_from_bdev_async.patch added to mm-unstable branch Andrew Morton
2023-04-04  2:00 ` Sergey Senozhatsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.