aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2009-01-05 22:04:54 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-01-05 22:04:54 -0500
commit90fa1527bddc7147dc0d590ee6184ca88bc50ecf (patch)
treea6b692b5a7ef777cbd8f2927783f593234b091d1 /drivers
parenta1b51e98676932d031f5eec1325b2df4bbdc8f26 (diff)
dm snapshot: change yield to msleep
Change yield() to msleep(1). If the thread had realtime priority, yield() doesn't really yield, so the yielding process would loop indefinitely and cause machine lockup. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-snap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 6c96db26b87c..4ceedd4f22af 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -9,6 +9,7 @@
9#include <linux/blkdev.h> 9#include <linux/blkdev.h>
10#include <linux/ctype.h> 10#include <linux/ctype.h>
11#include <linux/device-mapper.h> 11#include <linux/device-mapper.h>
12#include <linux/delay.h>
12#include <linux/fs.h> 13#include <linux/fs.h>
13#include <linux/init.h> 14#include <linux/init.h>
14#include <linux/kdev_t.h> 15#include <linux/kdev_t.h>
@@ -735,7 +736,7 @@ static void snapshot_dtr(struct dm_target *ti)
735 unregister_snapshot(s); 736 unregister_snapshot(s);
736 737
737 while (atomic_read(&s->pending_exceptions_count)) 738 while (atomic_read(&s->pending_exceptions_count))
738 yield(); 739 msleep(1);
739 /* 740 /*
740 * Ensure instructions in mempool_destroy aren't reordered 741 * Ensure instructions in mempool_destroy aren't reordered
741 * before atomic_read. 742 * before atomic_read.
@@ -888,10 +889,10 @@ static void pending_complete(struct dm_snap_pending_exception *pe, int success)
888 889
889 /* 890 /*
890 * Check for conflicting reads. This is extremely improbable, 891 * Check for conflicting reads. This is extremely improbable,
891 * so yield() is sufficient and there is no need for a wait queue. 892 * so msleep(1) is sufficient and there is no need for a wait queue.
892 */ 893 */
893 while (__chunk_is_tracked(s, pe->e.old_chunk)) 894 while (__chunk_is_tracked(s, pe->e.old_chunk))
894 yield(); 895 msleep(1);
895 896
896 /* 897 /*
897 * Add a proper exception, and remove the 898 * Add a proper exception, and remove the