aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2012-07-30 20:05:44 -0400
committerNeilBrown <neilb@suse.de>2012-07-30 20:05:44 -0400
commit895e3c5c58a80bb9e4e05d9ac38b4f30e0f97d80 (patch)
tree0376aaaaf8166e07a052067e5f825ab5b914d758 /drivers/md
parentb7219ccb33aa0df9949a60c68b5e9f712615e56f (diff)
md/raid5: For odirect-write performance, do not set STRIPE_PREREAD_ACTIVE.
'sync' writes set both REQ_SYNC and REQ_NOIDLE. O_DIRECT writes set REQ_SYNC but not REQ_NOIDLE. We currently assume that a REQ_SYNC request will not be followed by more requests and so set STRIPE_PREREAD_ACTIVE to expedite the request. This is appropriate for sync requests, but not for O_DIRECT requests. So make the setting of STRIPE_PREREAD_ACTIVE conditional on REQ_NOIDLE rather than REQ_SYNC. This is consistent with the documented meaning of REQ_NOIDLE: __REQ_NOIDLE, /* don't anticipate more IO after this one */ Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 29493982dbf5..259f519814ca 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4135,7 +4135,7 @@ static void make_request(struct mddev *mddev, struct bio * bi)
4135 finish_wait(&conf->wait_for_overlap, &w); 4135 finish_wait(&conf->wait_for_overlap, &w);
4136 set_bit(STRIPE_HANDLE, &sh->state); 4136 set_bit(STRIPE_HANDLE, &sh->state);
4137 clear_bit(STRIPE_DELAYED, &sh->state); 4137 clear_bit(STRIPE_DELAYED, &sh->state);
4138 if ((bi->bi_rw & REQ_SYNC) && 4138 if ((bi->bi_rw & REQ_NOIDLE) &&
4139 !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state)) 4139 !test_and_set_bit(STRIPE_PREREAD_ACTIVE, &sh->state))
4140 atomic_inc(&conf->preread_active_stripes); 4140 atomic_inc(&conf->preread_active_stripes);
4141 mddev_check_plugged(mddev); 4141 mddev_check_plugged(mddev);