linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: "Ted Ts'o" <tytso@mit.edu>,
	hughd@google.com, hirofumi@mail.parknet.co.jp,
	chris.mason@oracle.com, linux-fsdevel@vger.kernel.org,
	jaxboe@fusionio.com, martin.petersen@oracle.com
Subject: Re: discard and barriers
Date: Tue, 17 Aug 2010 11:59:20 +0100	[thread overview]
Message-ID: <1282042760.2507.11.camel@localhost> (raw)
In-Reply-To: <20100816112615.GA10273@lst.de>

Hi,

On Mon, 2010-08-16 at 13:26 +0200, Christoph Hellwig wrote:
> On Mon, Aug 16, 2010 at 10:41:51AM +0100, Steven Whitehouse wrote:
> > GFS2 has a similar concept, which compares two bit maps to generate the
> > extent list to generate the discards. This is done after each resource
> > group has been committed to the journal, and just before the resource
> > group bitmap is updated with the newly freed blocks (and marked dirty).
> > 
> > Any remote node wanting to use that new space will cause a further
> > journal flush when it requests the resource group lock (as well as in
> > place write back of that resource group, of course).
> > 
> > If the local node wants to reuse the recently freed space, then that can
> > happen as soon as the log commit has finished, so in this case the
> > barrier and the waiting are required.
> 
> I don't think you need the barrier for that.  The wait means the
> discard has finished, and from that point writes to the blocks discarded
> are safe.  There's no need to flush the volatile write cache after
> a discard either.  The big question is if you need the drain before
> the discard.  Given that you did a log commit before I suspect not
> as the log commit waits on all I/Os related to this commit.
> 

Yes, that sounds reasonable in that case. I didn't know there were
reordering guarantees with discards vs normal I/O so, in that case there
is no need for the barrier. I don't think anything more is required in
this case, so we should be good to go,

Steve.



  reply	other threads:[~2010-08-17 10:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-14 11:56 discard and barriers Christoph Hellwig
2010-08-14 14:14 ` Ted Ts'o
2010-08-14 14:52   ` Christoph Hellwig
2010-08-14 15:46     ` Chris Mason
2010-08-14 17:22       ` Christoph Hellwig
2010-08-14 20:11       ` Hugh Dickins
2010-08-15 17:39     ` Ted Ts'o
2010-08-15 19:02       ` Christoph Hellwig
2010-08-15 21:25         ` Ted Ts'o
2010-08-15 21:30           ` Christoph Hellwig
2010-08-16  9:41     ` Steven Whitehouse
2010-08-16 11:26       ` Christoph Hellwig
2010-08-17 10:59         ` Steven Whitehouse [this message]
2010-08-23 16:42 ` Christoph Hellwig

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=1282042760.2507.11.camel@localhost \
    --to=swhiteho@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=hch@lst.de \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=hughd@google.com \
    --cc=jaxboe@fusionio.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --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).