linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Daeho Jeong <daeho.jeong@samsung.com>
Cc: Jan Kara <jack@suse.cz>, "jack@suse.com" <jack@suse.com>,
	"tytso@mit.edu" <tytso@mit.edu>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: Re: [PATCH] ext4: release discard bio after sending discard commands
Date: Wed, 2 Aug 2017 10:18:34 +0200	[thread overview]
Message-ID: <20170802081834.GC2732@quack2.suse.cz> (raw)
In-Reply-To: <20170801233138epcms1p4e0d111bd6757201e7df26a281c9d7dd4@epcms1p4>

On Tue 01-08-17 23:31:38, Daeho Jeong wrote:
> 
> > > We've changed the discard command handling into parallel manner.
> > > But, in this change, I forgot decreasing the usage count of the bio
> > > which was used to send discard request. I'm sorry about that.
> > > 
> > > Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
> > > Fixes: a015434480dc ("ext4: send parallel discards on commit
> > > completions")
>  
> > Why do you think this is needed? submit_bio_wait() consumes the reference
> > that you've got from __blkdev_issue_discard()...
> >  
> >                                                                Honza
> 
> Hi Jan,
> 
> I thought like you, but submit_bio_wait() doesn't consume the reference
> of the bio and the bio cannot be released after the I/O has been completed.
> The caller of submit_bio_wait() should invoke bio_put() in person.
> You can see what we have to do after calling submit_bio_wait() in
> fs/crypto/bio.c.
> 
> Actually, in our device, I can see that the slab memory grows gradually
> because of the unreleased discard bios.

Ah, good point. I had a deeper look now and indeed submit_bio_wait() uses
it's own end_io function which does not drop the bio reference. So I
retract my objection and feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2017-08-02  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170801022917epcas2p49ee3e7d5ac5cba8746253429888b6d1c@epcas2p4.samsung.com>
2017-08-01  2:29 ` [PATCH] ext4: release discard bio after sending discard commands Daeho Jeong
2017-08-01  9:09   ` Jan Kara
     [not found]   ` <CGME20170801022917epcas2p49ee3e7d5ac5cba8746253429888b6d1c@epcms1p4>
2017-08-01 23:31     ` Daeho Jeong
2017-08-02  8:18       ` Jan Kara [this message]

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=20170802081834.GC2732@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=daeho.jeong@samsung.com \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).