From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Woodhouse Subject: Re: [PATCH 0/7] Discard requests, v2 Date: Sun, 10 Aug 2008 11:25:46 +0100 Message-ID: <1218363946.5063.25.camel@pmac.infradead.org> References: <1218299181.26926.88.camel@pmac.infradead.org> <87abflrejb.fsf@devron.myhome.or.jp> 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: OGAWA Hirofumi Return-path: Received: from bombadil.infradead.org ([18.85.46.34]:35437 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752758AbYHJK1A (ORCPT ); Sun, 10 Aug 2008 06:27:00 -0400 In-Reply-To: <87abflrejb.fsf@devron.myhome.or.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun, 2008-08-10 at 07:48 +0900, OGAWA Hirofumi wrote: > I wonder about I/O schedule impact... > > Currently it seems we schedule data direction as READ (no flags). > Although I'm not sure, we might want to schedule it as WRITE? (I guess > WRITE can be allowed delay more than READ...) I'm not sure it matters much -- this is mostly going to be used on devices which aren't affected by I/O scheduling at all and should probably be using the no-op scheduler. But we could do it fairly easily -- we just have to make sure it's done before blk_alloc_request() shows it to elv_set_request(), which means we can't just do it in init_request_from_bio() because that's too late. diff --git a/block/blk-core.c b/block/blk-core.c index 0c8ed97..b92e8aa 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1489,6 +1489,8 @@ void submit_bio(int rw, struct bio *bio) { int count = bio_sectors(bio); + if (rw & (1 << BIO_RW_DISCARD)) + rw |= WRITE; bio->bi_rw |= rw; /* -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation