* [PATCH] repair: warn if running in low memory mode
@ 2011-01-04 6:12 Dave Chinner
2011-01-04 9:52 ` Christoph Hellwig
2011-01-05 22:25 ` Alex Elder
0 siblings, 2 replies; 3+ messages in thread
From: Dave Chinner @ 2011-01-04 6:12 UTC (permalink / raw)
To: xfs
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] repair: warn if running in low memory mode
2011-01-04 6:12 [PATCH] repair: warn if running in low memory mode Dave Chinner
@ 2011-01-04 9:52 ` Christoph Hellwig
2011-01-05 22:25 ` Alex Elder
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2011-01-04 9:52 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Tue, Jan 04, 2011 at 05:12:43PM +1100, Dave Chinner wrote:
> 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>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
> + 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));
Maybe but the strings on a separate line to be easier readable and
greppable, e.g.:
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."),
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] repair: warn if running in low memory mode
2011-01-04 6:12 [PATCH] repair: warn if running in low memory mode Dave Chinner
2011-01-04 9:52 ` Christoph Hellwig
@ 2011-01-05 22:25 ` Alex Elder
1 sibling, 0 replies; 3+ messages in thread
From: Alex Elder @ 2011-01-05 22:25 UTC (permalink / raw)
To: Dave Chinner; +Cc: xfs
On Tue, 2011-01-04 at 17:12 +1100, Dave Chinner wrote:
> 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.
This looks good.
If someone specifies a maximum memory amount using -m,
but that amount exceeds the memory available and/or the
process' address space rlimit, it is silently reduced
to the maximum possible. That may then be followed by
the "...please increase it..." message, which might be
confusing and possibly annoying. Maybe a single message
that was a bit more informative would suffice, whether
or not max_mem was specified.
Just a thought. Your change looks fine.
Reviewed-by: Alex Elder <aelder@sgi.com>
> 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 {
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-05 22:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 6:12 [PATCH] repair: warn if running in low memory mode Dave Chinner
2011-01-04 9:52 ` Christoph Hellwig
2011-01-05 22:25 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox