public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH] repair: warn if running in low memory mode
Date: Tue,  4 Jan 2011 17:12:43 +1100	[thread overview]
Message-ID: <1294121563-17150-1-git-send-email-david@fromorbit.com> (raw)

From: Dave Chinner <dchinner@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@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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2011-01-04  6:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04  6:12 Dave Chinner [this message]
2011-01-04  9:52 ` [PATCH] repair: warn if running in low memory mode Christoph Hellwig
2011-01-05 22:25 ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294121563-17150-1-git-send-email-david@fromorbit.com \
    --to=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox