Re: [PATCH 0/7] Discard requests, v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx                              Intel Corporation



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux