mirror of https://github.com/schoebel/mars
if: remove kick_sem
This was very old provisionary code from the first prototype in 2010. It was leading to the following deadlock on newer kernels: Oct 1 02:44:02 istore-test-bs1 kernel: : INFO: task umount:1040 blocked for more than 120 seconds. Oct 1 02:44:02 istore-test-bs1 kernel: : Tainted: G C 4.3.0-rc3-next-20150929+ #6 Oct 1 02:44:02 istore-test-bs1 kernel: : "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Oct 1 02:44:02 istore-test-bs1 kernel: : umount D ffff880313164300 0 1040 919 0x00000000 Oct 1 02:44:02 istore-test-bs1 kernel: : ffff8801b3c979d8 0000000000000082 ffff880313164300 ffff8802fe8c6880 Oct 1 02:44:02 istore-test-bs1 kernel: : ffff8801b3c98000 ffff88030fec7650 7fffffffffffffff 0000000000000002 Oct 1 02:44:02 istore-test-bs1 kernel: : 0000000000000000 ffff8801b3c979f0 ffffffff8140917d 7fffffffffffffff Oct 1 02:44:02 istore-test-bs1 kernel: : Call Trace: Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140917d>] schedule+0x76/0x8b Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140c1fc>] schedule_timeout+0x24/0xe0 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140c945>] ? _raw_spin_unlock_irq+0x27/0x32 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff81066dcd>] ? trace_hardirqs_on_caller+0x171/0x18d Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff81066df6>] ? trace_hardirqs_on+0xd/0xf Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140c945>] ? _raw_spin_unlock_irq+0x27/0x32 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140b824>] __down_common+0x8e/0xcf Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140b87d>] __down+0x18/0x1a Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff81064097>] down+0x28/0x38 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffffa03b1493>] if_make_request+0x2d4/0x93d [mars] Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8140c899>] ? _raw_spin_unlock+0x22/0x2c Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff8120c93b>] ? create_task_io_context+0x11b/0x12e Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff812083b4>] ? create_io_context+0x51/0x66 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff812086c1>] generic_make_request+0x97/0xd6 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff812087eb>] submit_bio+0xeb/0xf6 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff811ba82f>] _xfs_buf_ioapply+0x2c5/0x327 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff811bb65e>] xfs_buf_submit+0x68/0x9b Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff811d1aa9>] xlog_bdstrat+0x48/0x4f Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff811d35dc>] xlog_sync+0x269/0x339 Oct 1 02:44:02 istore-test-bs1 kernel: : [<ffffffff811d373c>] xlog_state_release_iclog+0x90/0xa0 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff811d4139>] _xfs_log_force+0xfb/0x1bc Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff811d4209>] xfs_log_force+0xf/0x30 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff811cd804>] xfs_fs_sync_fs+0x1d/0x3b Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810fbedc>] sync_filesystem+0x7a/0x8e Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810d96c7>] generic_shutdown_super+0x22/0xe5 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810d9921>] kill_block_super+0x22/0x65 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810d9a09>] deactivate_locked_super+0x36/0x63 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810d9d27>] deactivate_super+0x31/0x34 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810f0422>] cleanup_mnt+0x53/0x71 Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810f0474>] __cleanup_mnt+0xd/0xf Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff81050974>] task_work_run+0x62/0x8e Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff8100105f>] prepare_exit_to_usermode+0x8c/0x9d Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff810010f2>] syscall_return_slowpath+0x82/0x8c Oct 1 02:44:03 istore-test-bs1 kernel: : [<ffffffff8140d0b1>] int_ret_from_sys_call+0x25/0x9f Oct 1 02:44:03 istore-test-bs1 kernel: : 1 lock held by umount/1040: Oct 1 02:44:03 istore-test-bs1 kernel: : #0: (&type->s_umount_key#24){++++++}, at: [<ffffffff810d9d1f>] deactivate_super+0x29/0x34
This commit is contained in:
parent
731d0f0b06
commit
8002a30373
|
@ -254,7 +254,6 @@ void _if_unplug(struct if_input *input)
|
|||
might_sleep();
|
||||
#endif
|
||||
|
||||
down(&input->kick_sem);
|
||||
spin_lock_irqsave(&input->req_lock, flags);
|
||||
if (!list_empty(&input->plug_anchor)) {
|
||||
// move over the whole list
|
||||
|
@ -262,7 +261,6 @@ void _if_unplug(struct if_input *input)
|
|||
atomic_set(&input->plugged_count, 0);
|
||||
}
|
||||
spin_unlock_irqrestore(&input->req_lock, flags);
|
||||
up(&input->kick_sem);
|
||||
|
||||
while (!list_empty(&tmp_list)) {
|
||||
struct if_mref_aspect *mref_a;
|
||||
|
@ -477,8 +475,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
|||
brick_msleep(100);
|
||||
}
|
||||
|
||||
down(&input->kick_sem);
|
||||
|
||||
bio_for_each_segment(bvec, bio, i) {
|
||||
// remove_this
|
||||
#ifdef HAS_BVEC_ITER
|
||||
|
@ -573,7 +569,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
|||
mref = if_alloc_mref(brick);
|
||||
mref_a = if_mref_get_aspect(brick, mref);
|
||||
if (unlikely(!mref_a)) {
|
||||
up(&input->kick_sem);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@ -605,7 +600,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
|||
|
||||
error = GENERIC_INPUT_CALL(input, mref_get, mref);
|
||||
if (unlikely(error < 0)) {
|
||||
up(&input->kick_sem);
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
@ -665,8 +659,6 @@ void if_make_request(struct request_queue *q, struct bio *bio)
|
|||
} // while bv_len > 0
|
||||
} // foreach bvec
|
||||
|
||||
up(&input->kick_sem);
|
||||
|
||||
if (likely(!total_len)) {
|
||||
error = 0;
|
||||
} else {
|
||||
|
@ -1178,7 +1170,6 @@ static int if_input_construct(struct if_input *input)
|
|||
INIT_LIST_HEAD(&input->hash_table[i].hash_anchor);
|
||||
}
|
||||
INIT_LIST_HEAD(&input->plug_anchor);
|
||||
sema_init(&input->kick_sem, 1);
|
||||
spin_lock_init(&input->req_lock);
|
||||
atomic_set(&input->flying_count, 0);
|
||||
atomic_set(&input->read_flying_count, 0);
|
||||
|
|
|
@ -85,7 +85,6 @@ struct if_input {
|
|||
atomic_t total_mref_read_count;
|
||||
atomic_t total_mref_write_count;
|
||||
spinlock_t req_lock;
|
||||
struct semaphore kick_sem;
|
||||
struct if_hash_anchor *hash_table;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue