From: David Woodhouse Subject: Re: [PATCH 0/7] Discard requests, v2 Date: Wed, 13 Aug 2008 11:20:19 +0100 Message-ID: <1218622819.2977.254.camel@pmac.infradead.org> References: <20080812181055.GB21341@shareable.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Jens Axboe , Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com, matthew@wil.cx To: Jamie Lokier Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:40512 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753893AbYHMKUh (ORCPT ); Wed, 13 Aug 2008 06:20:37 -0400 In-Reply-To: <20080812181055.GB21341@shareable.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, 2008-08-12 at 19:10 +0100, Jamie Lokier wrote: > Wouldn't an explicit barrier be (a) slow if it's a hard-barrier, and > (b) as a soft-barrier, overly constrain scheduling, because the only > ordering required is against a subsequent overlapping write? Yes, a soft barrier is more than we need -- but unless we do a lot of work in the schedulers to ensure that writes can't cross discards, that's the best option we have. > Explicit soft or hard barrier *before* DISCARD does need to be an > option. Think of journalling: Step 1 = commit "deleted file" to > journal, 2 = hard barrier, 3 = DISCARD file data. Barrier after does > not seem to be required. The barrier afterwards is to protect against immediate reallocation of these blocks to a new inode, and the associated data write getting scheduled _before_ the discard. -- dwmw2