On Sun, 1 Feb 2015 21:08:12 -0800 Linus Torvalds
On Sun, Feb 1, 2015 at 3:03 PM, NeilBrown <neilb(a)suse.de>
> I guess I could
> somewhere to defeat the warning, and add a comment explaining why.
> Would that be a good thing?
Use "sched_annotate_sleep()" instead, but yes, add a comment about why it's
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
OK - following patch is queued to appear in a pull request tomorrow (I hope).
From: NeilBrown <neilb(a)suse.de>
Date: Mon, 2 Feb 2015 17:08:03 +1100
Subject: [PATCH] md/bitmap: fix a might_sleep() warning.
sched: Debug nested sleeps
causes false-positive warnings in RAID5 code.
This annotation removes them and adds a comment
explaining why there is no real problem.
Reported-by: Fengguang Wu <fengguang.wu(a)intel.com>
Signed-off-by: NeilBrown <neilb(a)suse.de>
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index da3604e73e8a..1695ee5f3ffc 100644
@@ -72,6 +72,19 @@ __acquires(bitmap->lock)
/* this page has not been allocated yet */
+ /* It is possible that this is being called inside a
+ * prepare_to_wait/finish_wait loop from raid5c:make_request().
+ * In general it is not permitted to sleep in that context as it
+ * can cause the loop to spin freely.
+ * That doesn't apply here as we can only reach this point
+ * once with any loop.
+ * When this function completes, either bp[page].map or
+ * bp[page].hijacked. In either case, this function will
+ * abort before getting to this point again. So there is
+ * no risk of a free-spin, and so it is safe to assert
+ * that sleeping here is allowed.
mappage = kzalloc(PAGE_SIZE, GFP_NOIO);