[PATCH] repair: warn if running in low memory mode
Dave Chinner
david at fromorbit.com
Tue Jan 4 00:12:43 CST 2011
From: Dave Chinner <dchinner at redhat.com>
When checking large filesystems, xfs_repair makes an estimate of how
much RAM it will need to execute effectively. If the amount of RAM
is less than this, it reduces the bhash size and turns of
prefetching, which will substantially slow down the repair process.
Add a warning that indicates this is happening, along with a
recommendation of how much RAM repair calculates it needs to run
with prefetching enabled.
Signed-off-by: Dave Chinner <dchinner at redhat.com>
---
repair/xfs_repair.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index e36eeae..eea1b34 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -650,12 +650,20 @@ main(int argc, char **argv)
* Turn off prefetch and minimise libxfs cache if
* physical memory is deemed insufficient
*/
- if (max_mem_specified)
+ if (max_mem_specified) {
do_abort(_("Required memory for repair is "
"greater that the maximum specified "
"with the -m option. Please increase "
"it to at least %lu.\n"),
mem_used / 1024);
+ } else {
+ do_warn(_("Not enough RAM available for repair "
+ "to enable prefetching. This will be "
+ "_slow_.\n"
+ "You need at least %luMB RAM to run "
+ "with prefetching enabled."),
+ mem_used * 1280 / (1024 * 1024));
+ }
do_prefetch = 0;
libxfs_bhash_size = 64;
} else {
--
1.7.2.3
More information about the xfs
mailing list