]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm snapshot: reduce default memory allocation
authorMilan Broz <mbroz@redhat.com>
Thu, 24 Apr 2008 20:42:36 +0000 (21:42 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Fri, 25 Apr 2008 12:26:35 +0000 (13:26 +0100)
Limit the amount of memory allocated per snapshot on systems
with a large page size.  (The larger default chunk size on
these systems compensates for the smaller number of pages reserved.)

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-snap.c

index 4dc8a43c034b0242422399a15a7d6a271f97da3d..08047fb1cac9fdc4d06fbd7d113b13a1fb99447c 100644 (file)
@@ -36,9 +36,9 @@
 #define SNAPSHOT_COPY_PRIORITY 2
 
 /*
- * Each snapshot reserves this many pages for io
+ * Reserve 1MB for each snapshot initially (with minimum of 1 page).
  */
-#define SNAPSHOT_PAGES 256
+#define SNAPSHOT_PAGES (((1UL << 20) >> PAGE_SHIFT) ? : 1)
 
 static struct workqueue_struct *ksnapd;
 static void flush_queued_bios(struct work_struct *work);