From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@fb.com>,
James Bottomley <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Mike Snitzer <snitzer@redhat.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Subject: [PATCH 1/3] kernel/kthread.c: Avoid CPU lockups
Date: Mon, 28 Mar 2016 14:48:45 -0700 [thread overview]
Message-ID: <56F9A6BD.8080208@sandisk.com> (raw)
In-Reply-To: <56F9A692.2090704@sandisk.com>
Avoid that complaints similar to the one below are reported against
a debug kernel:
NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [kdmwork-25 4:2:23313]
irq event stamp: 16320042
hardirqs last enabled at (16320041): [<ffffffff815992c7>] _raw_spin_unlock_irq+0x27/0x40
hardirqs last disabled at (16320042): [<ffff8803ffbe3cd8>] 0xffff8803ffbe3cd8
softirqs last enabled at (16319960): [<ffffffff8105bcdb>] __do_softirq+0x1cb/0x230
softirqs last disabled at (16319715): [<ffffffff8105bec8>] irq_exit+0xa8/0xb0
CPU: 1 PID: 23313 Comm: kdmwork-254:2
RIP: 0010:[<ffffffff815992cf>] [<ffffffff815992cf>] _raw_spin_unlock_irq+0x2f/0x40
Call Trace:
[<ffffffff813f702f>] scsi_request_fn+0x11f/0x630
[<ffffffff812977fe>] __blk_run_queue+0x2e/0x40
[<ffffffff81297065>] __elv_add_request+0x75/0x1f0
[<ffffffff8129ba91>] blk_insert_cloned_request+0x101/0x190
[<ffffffffa0189f1a>] map_request+0x16a/0x1b0 [dm_mod]
[<ffffffffa0189f7d>] map_tio_request+0x1d/0x40 [dm_mod]
[<ffffffff81077812>] kthread_worker_fn+0x82/0x1a0
[<ffffffff8107771a>] kthread+0xea/0x100
[<ffffffff81599b72>] ret_from_fork+0x22/0x40
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
---
kernel/kthread.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 9ff173d..516ca6b 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -593,6 +593,7 @@ repeat:
if (work) {
__set_current_state(TASK_RUNNING);
work->func(work);
+ cond_resched_rcu_qs();
} else if (!freezing(current))
schedule();
--
2.7.3
next prev parent reply other threads:[~2016-03-28 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 21:48 [PATCH 0/3] Improve block layer scheduling fairness Bart Van Assche
2016-03-28 21:48 ` Bart Van Assche [this message]
2016-03-28 21:49 ` [PATCH 2/3] block: Limit work processed in softirq context Bart Van Assche
2016-03-28 21:50 ` [PATCH 3/3] Avoid that I/O completion processing triggers lockup complaints Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56F9A6BD.8080208@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=axboe@fb.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=snitzer@redhat.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.