From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Woodhouse Subject: Re: [PATCH 1/5] [BLOCK] Add 'discard' request handling Date: Fri, 08 Aug 2008 13:05:16 +0100 Message-ID: <1218197116.12232.135.camel@pmac.infradead.org> References: <1217953741.3454.784.camel@pmac.infradead.org> <1217957140.3454.800.camel@pmac.infradead.org> <1218014703.5111.35.camel@pmac.infradead.org> <20080807184155.GE20055@kernel.dk> <1218187995.12232.95.camel@pmac.infradead.org> <20080808103041.GM20055@kernel.dk> <1218192731.12232.110.camel@pmac.infradead.org> <20080808110934.GO20055@kernel.dk> <20080808111829.GP20055@kernel.dk> <1218194997.12232.124.camel@pmac.infradead.org> <20080808114409.GR20055@kernel.dk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com To: Jens Axboe Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:36184 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbYHHMFY (ORCPT ); Fri, 8 Aug 2008 08:05:24 -0400 In-Reply-To: <20080808114409.GR20055@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 2008-08-08 at 13:44 +0200, Jens Axboe wrote: > > Sigh indeed, ->issue_flush_fn() was the actual issuer, not the preparer. > Let me send a new diff. This adds the ->prepare_discard_fn() to do the > transformation, and also extends blkdev_issue_flush() to return error if > the IO was never queued because of some device in the stack not > supporting it. I think we still want the DISCARD flag in rq->cmd_flags. We can't rely on rq->cmd_type == REQ_TYPE_DISCARD because that may well be changed to something else (like REQ_TYPE_BLOCK_PC). I was thinking of REQ_TYPE_DISCARD as a special case for some block devices, just as REQ_TYPE_FLUSH is a special case for the ps3disk.c driver (nobody else uses it). In fact, perhaps both of them should be switched to REQ_TYPE_LINUX_BLOCK or REQ_TYPE_SPECIAL? I was actually tempted to leave REQ_TYPE_DISCARD out of the original patch 1/5 completely, and add it only as part of the FTL patch. I don't think it's something for the core code to be caring about -- let the flag in rq->cmd_flags do that. > Until we have overlap detection, I think we should make the discard > request a explicit barrier. Otherwise we could have problems with a > discard being passed by a write request and such. I think that making it an explicit barrier is a reasonable thing to do for now. We can work on merges as a next step. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation