From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: discard and barriers Date: Sun, 15 Aug 2010 21:02:30 +0200 Message-ID: <20100815190230.GA11416@lst.de> References: <20100814115625.GA15902@lst.de> <20100814141451.GB14960@thunk.org> <20100814145210.GA23126@lst.de> <20100815173906.GA20124@thunk.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , hughd@google.com, hirofumi@mail.parknet.co.jp, chris.mason@oracle.com, swhiteho@redhat.com, linux-fsdevel@vger.kernel.org, jaxboe@fusionio.com, martin.petersen@oracle.com To: "Ted Ts'o" Return-path: Received: from verein.lst.de ([213.95.11.210]:43336 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217Ab0HOTDA (ORCPT ); Sun, 15 Aug 2010 15:03:00 -0400 Content-Disposition: inline In-Reply-To: <20100815173906.GA20124@thunk.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, Aug 15, 2010 at 01:39:06PM -0400, Ted Ts'o wrote: > So after these ordering flush/ordering change that have been proposed, > if the block device layer is free to reorder the discard and a > subsequent write to a discard block, I will need to add a *new* wait > for the discard to complete before I can free the busy extent list. > And this will be true for all file systems that are currently issuing > discards. Again, am I missing something? The above is correct, except for the *new* part. sb_issue_discard at the moment is synchronous, so you're already waiting for it to finish. > So that means we need to add the end-io callbacks to the discard > operations *first*, before we remove the implicit flush/ordering > guarantees. Doing the discard asynchronous and with and end_io callback defintivel is an optimization over waiting for it synchronously, and it's in fact what I'm doing in XFS. It's however unrelated to getting rid of the barriers.