Skip to contentSkip to conversation

md/raid5: Tune judgements order.

PATCH Applied majianpeng 2 participants 2 messages Feb 28, 2013 – Mar 4, 2013 MD RAID

lore
Share & tools
lore

majianpeng

author
#0 lore raw

PATCH 2/4 md/raid5: Tune judgements order.

To reduce the unnecessary function call in certain condtitions,it should tune judgements order.

---
 drivers/md/raid5.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/raid5.c +4 -3
index 59c0569..bd49623 100644
@@ -4665,9 +4665,10 @@ static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int
 		*skipped = 1;
 		return rv;
 	}
-	if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
-	    !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
-	    !conf->fullsync && sync_blocks >= STRIPE_SECTORS) {
+	if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
+		!conf->fullsync &&
+		!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
+		sync_blocks >= STRIPE_SECTORS) {
 		/* we can skip this block, and probably more */
 		sync_blocks /= STRIPE_SECTORS;
 		*skipped = 1;
Signature · 1 line
1.7.9.5
Applied
#1 lore raw
Quoted 16 lines · On Thu, 28 Feb 2013 15:50:47 +0800 majianpeng <[email protected]> wrote:

To reduce the unnecessary function call in certain condtitions,it should tune judgements order.

---
 drivers/md/raid5.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/md/raid5.c +0 -0
index 59c0569..bd49623 100644
@@ -4665,9 +4665,10 @@ static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int
 		*skipped = 1;
 		return rv;
 	}

drivers/md/raid5.c static inline sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int · line 4674

Quoted 10 lines
drivers/md/raid5.c +4 -3
-	if (!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
-	    !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
-	    !conf->fullsync && sync_blocks >= STRIPE_SECTORS) {
+	if (!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
+		!conf->fullsync &&
+		!bitmap_start_sync(mddev->bitmap, sector_nr, &sync_blocks, 1) &&
+		sync_blocks >= STRIPE_SECTORS) {
 		/* we can skip this block, and probably more */
 		sync_blocks /= STRIPE_SECTORS;
 		*skipped = 1;

applied, thanks (after fixing up the formatting).

NeilBrown