summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-12-20 17:28:26 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:37 (GMT)
commita473767a5b67bc7b0196a61e9e26aec5298c1928 (patch)
treeeca0cea7fb59d22d76229c47ae5ebeaa10f66d86 /block
parentecb0069c91d00cf11a9b60eab0c81b24604ba4f3 (diff)
downloadlinux-fsl-qoriq-a473767a5b67bc7b0196a61e9e26aec5298c1928.tar.xz
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
Diffstat (limited to 'block')
-rw-r--r--block/blk-ioc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 46cd7bd..899d3e4 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;
}
}