diff options
author | jiangyiwen <jiangyiwen@huawei.com> | 2016-03-15 17:52:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-15 19:55:16 -0400 |
commit | 4d548f61d61fcaa5b5e14b8d250de9604bdb61bf (patch) | |
tree | 943fa3d4653fad7331c1bfea3584e7d144af479a /fs | |
parent | e928f35061a6f3ead993b230b01d9ca6b4f495ca (diff) |
ocfs2/cluster: replace the interrupt safe spinlocks with common ones
There actually no hardware or software interrupts in the context which
using o2hb_live_lock, so we don't need to worry about race conditions
caused by irq/softirq with spinlock held. Turning off irq is not good
for system performance after all. Just replace them with a non
interrupt safe function.
Signed-off-by: Yiwen Jiang <jiangyiwen@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index a76b9ea7722e..ef6a2ec494de 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -287,7 +287,6 @@ struct o2hb_bio_wait_ctxt { | |||
287 | static void o2hb_write_timeout(struct work_struct *work) | 287 | static void o2hb_write_timeout(struct work_struct *work) |
288 | { | 288 | { |
289 | int failed, quorum; | 289 | int failed, quorum; |
290 | unsigned long flags; | ||
291 | struct o2hb_region *reg = | 290 | struct o2hb_region *reg = |
292 | container_of(work, struct o2hb_region, | 291 | container_of(work, struct o2hb_region, |
293 | hr_write_timeout_work.work); | 292 | hr_write_timeout_work.work); |
@@ -297,14 +296,14 @@ static void o2hb_write_timeout(struct work_struct *work) | |||
297 | jiffies_to_msecs(jiffies - reg->hr_last_timeout_start)); | 296 | jiffies_to_msecs(jiffies - reg->hr_last_timeout_start)); |
298 | 297 | ||
299 | if (o2hb_global_heartbeat_active()) { | 298 | if (o2hb_global_heartbeat_active()) { |
300 | spin_lock_irqsave(&o2hb_live_lock, flags); | 299 | spin_lock(&o2hb_live_lock); |
301 | if (test_bit(reg->hr_region_num, o2hb_quorum_region_bitmap)) | 300 | if (test_bit(reg->hr_region_num, o2hb_quorum_region_bitmap)) |
302 | set_bit(reg->hr_region_num, o2hb_failed_region_bitmap); | 301 | set_bit(reg->hr_region_num, o2hb_failed_region_bitmap); |
303 | failed = bitmap_weight(o2hb_failed_region_bitmap, | 302 | failed = bitmap_weight(o2hb_failed_region_bitmap, |
304 | O2NM_MAX_REGIONS); | 303 | O2NM_MAX_REGIONS); |
305 | quorum = bitmap_weight(o2hb_quorum_region_bitmap, | 304 | quorum = bitmap_weight(o2hb_quorum_region_bitmap, |
306 | O2NM_MAX_REGIONS); | 305 | O2NM_MAX_REGIONS); |
307 | spin_unlock_irqrestore(&o2hb_live_lock, flags); | 306 | spin_unlock(&o2hb_live_lock); |
308 | 307 | ||
309 | mlog(ML_HEARTBEAT, "Number of regions %d, failed regions %d\n", | 308 | mlog(ML_HEARTBEAT, "Number of regions %d, failed regions %d\n", |
310 | quorum, failed); | 309 | quorum, failed); |
@@ -2425,11 +2424,10 @@ EXPORT_SYMBOL_GPL(o2hb_check_node_heartbeating); | |||
2425 | int o2hb_check_node_heartbeating_no_sem(u8 node_num) | 2424 | int o2hb_check_node_heartbeating_no_sem(u8 node_num) |
2426 | { | 2425 | { |
2427 | unsigned long testing_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; | 2426 | unsigned long testing_map[BITS_TO_LONGS(O2NM_MAX_NODES)]; |
2428 | unsigned long flags; | ||
2429 | 2427 | ||
2430 | spin_lock_irqsave(&o2hb_live_lock, flags); | 2428 | spin_lock(&o2hb_live_lock); |
2431 | o2hb_fill_node_map_from_callback(testing_map, sizeof(testing_map)); | 2429 | o2hb_fill_node_map_from_callback(testing_map, sizeof(testing_map)); |
2432 | spin_unlock_irqrestore(&o2hb_live_lock, flags); | 2430 | spin_unlock(&o2hb_live_lock); |
2433 | if (!test_bit(node_num, testing_map)) { | 2431 | if (!test_bit(node_num, testing_map)) { |
2434 | mlog(ML_HEARTBEAT, | 2432 | mlog(ML_HEARTBEAT, |
2435 | "node (%u) does not have heartbeating enabled.\n", | 2433 | "node (%u) does not have heartbeating enabled.\n", |