diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2012-12-20 18:28:26 +0100 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2016-02-13 00:36:20 +0100 |
commit | 293e933a6e132d9224862cc85a99da0e8cec91ea (patch) | |
tree | bdf115467ec26ca0ab92e2bb0286992951f9b6ea | |
parent | 8eafe69195ef561b3940146db38ed5bd0d71915f (diff) | |
download | rt-linux-293e933a6e132d9224862cc85a99da0e8cec91ea.tar.gz |
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>
-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 381cb50a673c3..dc8785233d94b 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c @@ -7,6 +7,7 @@ #include <linux/bio.h> #include <linux/blkdev.h> #include <linux/slab.h> +#include <linux/delay.h> #include "blk.h" @@ -109,7 +110,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); } } @@ -187,7 +188,7 @@ retry: spin_unlock(icq->q->queue_lock); } else { spin_unlock_irqrestore(&ioc->lock, flags); - cpu_relax(); + cpu_chill(); goto retry; } } |