linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Raghav <p.raghav@samsung.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <senozhatsky@chromium.org>, <viro@zeniv.linux.org.uk>,
	<axboe@kernel.dk>, <willy@infradead.org>, <brauner@kernel.org>,
	<akpm@linux-foundation.org>, <minchan@kernel.org>,
	<hubcap@omnibond.com>, <martin@omnibond.com>, <mcgrof@kernel.org>,
	<devel@lists.orangefs.org>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org>,
	<linux-block@vger.kernel.org>, <gost.dev@samsung.com>
Subject: Re: [RFC v2 1/5] zram: remove zram_page_end_io function
Date: Thu, 23 Mar 2023 16:50:49 +0100	[thread overview]
Message-ID: <8adb0770-6124-e11f-2551-6582db27ed32@samsung.com> (raw)
In-Reply-To: <ZBwrfT8TA5GC5+RH@infradead.org>

On 2023-03-23 11:35, Christoph Hellwig wrote:
> On Wed, Mar 22, 2023 at 02:50:09PM +0100, Pankaj Raghav wrote:
>> -	if (!parent)
>> -		bio->bi_end_io = zram_page_end_io;
>> -	else
>> +	if (parent)
> 
> I don't think a non-chained bio without and end_io handler can work.

Hmm. Is it because in the case of non-chained bio, zram driver owns the bio,
and it is the responsibility of the driver to call bio_put in the end_io handler?

> This !parent case seems to come from writeback_store, and as far as
> I can tell is broken already in the current code as it just fires
> off an async read without ever waiting for it, using an on-stack bio
> just to make things complicated.
> 
> The bvec reading code in zram is a mess, but I have an idea how
> to clean it up with a little series that should also help with
> this issue.
Sounds good.

As a part of this series, should I just have an end_io which has a
call to bio_put then?

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index b7bb52f8dfbd..faa78fce327e 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -608,10 +608,6 @@ static void free_block_bdev(struct zram *zram, unsigned long blk_idx)

 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);
 }


  reply	other threads:[~2023-03-23 15:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230322135015eucas1p2ff980e76159f0ceef7bf66934580bd6c@eucas1p2.samsung.com>
2023-03-22 13:50 ` [RFC v2 0/5] remove page_endio() Pankaj Raghav
     [not found]   ` <CGME20230322135015eucas1p1bd186e83b322213cc852c4ad6eb47090@eucas1p1.samsung.com>
2023-03-22 13:50     ` [RFC v2 1/5] zram: remove zram_page_end_io function Pankaj Raghav
2023-03-23 10:35       ` Christoph Hellwig
2023-03-23 15:50         ` Pankaj Raghav [this message]
     [not found]   ` <CGME20230322135016eucas1p2ee1b64175f621ee425f7f48cb908dc20@eucas1p2.samsung.com>
2023-03-22 13:50     ` [RFC v2 2/5] orangefs: use folios in orangefs_readahead Pankaj Raghav
     [not found]   ` <CGME20230322135017eucas1p1350c6e130fa367263432fa35894bdf1e@eucas1p1.samsung.com>
2023-03-22 13:50     ` [RFC v2 3/5] mpage: split bi_end_io callback for reads and writes Pankaj Raghav
     [not found]   ` <CGME20230322135017eucas1p2d29ffaf8dbbd79761ba56e8198d9c933@eucas1p2.samsung.com>
2023-03-22 13:50     ` [RFC v2 4/5] mpage: use folios in bio end_io handler Pankaj Raghav
2023-03-22 14:19       ` Matthew Wilcox
     [not found]   ` <CGME20230322135018eucas1p2dd82762cf7d2c0c5b5482a1d150ba369@eucas1p2.samsung.com>
2023-03-22 13:50     ` [RFC v2 5/5] filemap: remove page_endio() Pankaj Raghav
2023-03-22 19:09   ` [RFC v2 0/5] " Matthew Wilcox
2023-03-23 15:00     ` Pankaj Raghav
2023-03-23 15:33       ` Matthew Wilcox
2023-03-23 16:16         ` Pankaj Raghav
2023-03-23 14:30   ` Mike Marshall
2023-03-23 16:22     ` Pankaj Raghav

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8adb0770-6124-e11f-2551-6582db27ed32@samsung.com \
    --to=p.raghav@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=devel@lists.orangefs.org \
    --cc=gost.dev@samsung.com \
    --cc=hch@infradead.org \
    --cc=hubcap@omnibond.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=martin@omnibond.com \
    --cc=mcgrof@kernel.org \
    --cc=minchan@kernel.org \
    --cc=senozhatsky@chromium.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox