mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_02_182-bcache-reduce-MAX_IO-to-256.patch

c63e28
 WHATS_NEW           |  1 +
c63e28
 lib/device/bcache.c | 10 +++++++++-
c63e28
 2 files changed, 10 insertions(+), 1 deletion(-)
c63e28
c63e28
diff --git a/WHATS_NEW b/WHATS_NEW
c63e28
index 47db4a3..8063364 100644
c63e28
--- a/WHATS_NEW
c63e28
+++ b/WHATS_NEW
c63e28
@@ -10,6 +10,7 @@ Version 2.02.182 -
c63e28
   Fix change of monitoring in clustered volumes.
c63e28
   Fix lvconvert striped/raid0/raid0_meta -> raid6 regression.
c63e28
   Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
c63e28
+  Reduce max concurrent aios to avoid EMFILE with many devices.
c63e28
   Fix lvconvert conversion attempts to linear.
c63e28
   Fix lvconvert raid0/raid0_meta -> striped regression.
c63e28
   Fix lvconvert --splitmirror for mirror type (2.02.178).
c63e28
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
c63e28
index 6886b74..7384a32 100644
c63e28
--- a/lib/device/bcache.c
c63e28
+++ b/lib/device/bcache.c
c63e28
@@ -253,7 +253,15 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,
c63e28
 	return true;
c63e28
 }
c63e28
 
c63e28
-#define MAX_IO 1024
c63e28
+/*
c63e28
+ * MAX_IO is returned to the layer above via bcache_max_prefetches() which
c63e28
+ * tells the caller how many devices to submit io for concurrently.  There will
c63e28
+ * be an open file descriptor for each of these, so keep it low enough to avoid
c63e28
+ * reaching the default max open file limit (1024) when there are over 1024
c63e28
+ * devices being scanned.
c63e28
+ */
c63e28
+
c63e28
+#define MAX_IO 256
c63e28
 #define MAX_EVENT 64
c63e28
 
c63e28
 static bool _async_wait(struct io_engine *ioe, io_complete_fn fn)