diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2013-05-01 16:38:23 -0400 |
---|---|---|
committer | Matthew Wilcox <matthew.r.wilcox@intel.com> | 2013-05-01 16:40:27 -0400 |
commit | 564a232c059913d91b491e04c2b2d670b8f94615 (patch) | |
tree | f0f83ea760a81c9c2d05d23f39af419fcf462f5b | |
parent | 5e82e952f04681c10f35e02ee0a4a43ec027137a (diff) |
NVMe: Set TASK_INTERRUPTIBLE before processing queues
The kthread has two tasks; handling timeouts (for which it runs once per
second), and submitting queued BIOs. If a BIO happens to be queued after
the thread has processed the queue but before it calls schedule_timeout(),
the thread will sleep for a second before submitting it, which can cause
performance problems in some rare cases (that will become more common in
a subsequent patch).
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Tested-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
-rw-r--r-- | drivers/block/nvme-core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c index 40908a06bd5e..358d17700c20 100644 --- a/drivers/block/nvme-core.c +++ b/drivers/block/nvme-core.c | |||
@@ -1291,7 +1291,7 @@ static int nvme_kthread(void *data) | |||
1291 | struct nvme_dev *dev; | 1291 | struct nvme_dev *dev; |
1292 | 1292 | ||
1293 | while (!kthread_should_stop()) { | 1293 | while (!kthread_should_stop()) { |
1294 | __set_current_state(TASK_RUNNING); | 1294 | set_current_state(TASK_INTERRUPTIBLE); |
1295 | spin_lock(&dev_list_lock); | 1295 | spin_lock(&dev_list_lock); |
1296 | list_for_each_entry(dev, &dev_list, node) { | 1296 | list_for_each_entry(dev, &dev_list, node) { |
1297 | int i; | 1297 | int i; |
@@ -1308,7 +1308,6 @@ static int nvme_kthread(void *data) | |||
1308 | } | 1308 | } |
1309 | } | 1309 | } |
1310 | spin_unlock(&dev_list_lock); | 1310 | spin_unlock(&dev_list_lock); |
1311 | set_current_state(TASK_INTERRUPTIBLE); | ||
1312 | schedule_timeout(round_jiffies_relative(HZ)); | 1311 | schedule_timeout(round_jiffies_relative(HZ)); |
1313 | } | 1312 | } |
1314 | return 0; | 1313 | return 0; |