[PATCH 2/3] bcache: Avoid hung task happen.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Because after kthread_create, the state of kthread is TASK_UNINTERRUPTIBLE.
If we don't wake up dc->writeback_thread, the thread will be hung-task.
For those reasons, we don't wake up writeback_thread:
A:only create backed device
B:create backed device and cache device, but don't write at once
C:write without writeback poliy

So like the way of create gc_thread, after creating writeback_thread, i
set the state is TASK_INTERRUPTIBLE.

Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx>
---
 drivers/md/bcache/writeback.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 6c44fe0..7fbc22a 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -499,6 +499,8 @@ int bch_cached_dev_writeback_init(struct cached_dev *dc)
 	if (IS_ERR(dc->writeback_thread))
 		return PTR_ERR(dc->writeback_thread);
 
+	set_task_state(dc->writeback_thread, TASK_INTERRUPTIBLE);
+
 	INIT_DELAYED_WORK(&dc->writeback_rate_update, update_writeback_rate);
 	schedule_delayed_work(&dc->writeback_rate_update,
 			      dc->writeback_rate_update_seconds * HZ);
-- 
1.7.10.4
ÿôèº{.nÇ+?·?®?­?+%?Ëÿ±éݶ¥?wÿº{.nÇ+?·¥?{±ý·rÿ?{ayºÊ?Ú?ë,j­¢f£¢·h??ï?êÿ?êçz_è®(­é???Ý¢j"?ú¶m§ÿÿ¾«þG«?éÿ¢¸??¨è­Ú&£ø§~?á





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux