diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-12-20 18:28:26 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-01-23 19:23:42 -0500 |
commit | a3635ef528674c84a34cde564c57b0e7140cbc5e (patch) | |
tree | 992446d18443017e7a2af330e3f9f59541ccdbea | |
parent | 0ce7f7750179d16d4cd3a395813acd04abebe474 (diff) |
block: Use cpu_chill() for retry loops
Retry loops on RT might loop forever when the modifying side was
preempted. Steven also observed a live lock when there was a
concurrent priority boosting going on.
Use cpu_chill() instead of cpu_relax() to let the system
make progress.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
-rw-r--r-- | block/blk-ioc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-ioc.c b/block/blk-ioc.c index fb95dd2f889a..6b542018ed1e 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -8,6 +8,7 @@ #include <linux/blkdev.h> #include <linux/bootmem.h> /* for max_pfn/max_low_pfn */ #include <linux/slab.h> +#include <linux/delay.h> #include "blk.h" @@ -110,7 +111,7 @@ static void ioc_release_fn(struct work_struct *work) spin_unlock(q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); - cpu_relax(); + cpu_chill(); spin_lock_irqsave_nested(&ioc->lock, flags, 1); } } @@ -188,7 +189,7 @@ retry: spin_unlock(icq->q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); - cpu_relax(); + cpu_chill(); goto retry; } } |