[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] [PATCH 4/7] Don't optimize for failure case
- From: Mikulas Patocka <mpatocka redhat com>
- To: Alasdair G Kergon <agk redhat com>
- Cc: dm-devel redhat com
- Subject: [dm-devel] [PATCH 4/7] Don't optimize for failure case
- Date: Wed, 18 Nov 2009 07:12:28 -0500 (EST)
Don't optimize for failure case.
should_wake is just an optimization to avoid waking the thread up when
there's already something to do. Don't do this optimization in failure
handling code. It is totally pointless to optimize failures.
Signed-off-by: Mikulas Patocka <mpatocka redhat com>
---
drivers/md/dm-raid1.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
Index: linux-2.6.31-fast-new/drivers/md/dm-raid1.c
===================================================================
--- linux-2.6.31-fast-new.orig/drivers/md/dm-raid1.c 2009-10-06 18:15:17.000000000 +0200
+++ linux-2.6.31-fast-new/drivers/md/dm-raid1.c 2009-10-06 18:15:20.000000000 +0200
@@ -529,7 +529,6 @@ static void write_callback(unsigned long
struct bio *bio = (struct bio *) context;
struct mirror_set *ms;
int uptodate = 0;
- int should_wake = 0;
unsigned long flags;
ms = bio_get_m(bio)->ms;
@@ -561,12 +560,9 @@ static void write_callback(unsigned long
* the main thread.
*/
spin_lock_irqsave(&ms->lock, flags);
- if (!ms->failures.head)
- should_wake = 1;
bio_list_add(&ms->failures, bio);
spin_unlock_irqrestore(&ms->lock, flags);
- if (should_wake)
- wakeup_mirrord(ms);
+ wakeup_mirrord(ms);
return;
}
out:
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]