add display of hours remaining to finish resync
PATCH 1/1 add display of hours remaining to finish resync
This is my first patch, so please be gentle.
This patch adds the display of the number of hours till the completion of resync of an array in the /proc/mdstat display.
Example: [>....................] resync = 3.3% (98633240/2928311808) finish=1026.1min (17h) speed=45957K/sec
# diff -Naru drivers/md/md.c-orig drivers/md/md.c
--- drivers/md/md.c-orig 2011-10-25 01:11:12.000000000 -0400
+++ drivers/md/md.c 2011-11-01 17:37:35.000000000 -0400
@@ -6351,8 +6351,8 @@
rt *= dt;
rt >>= 5;- seq_printf(seq, " finish=%lu.%lumin", (unsigned long)rt / 60,
- ((unsigned long)rt % 60)/6);
+ seq_printf(seq, " finish=%lu.%lumin (%luh)", (unsigned long)rt /
60,
+ ((unsigned long)rt % 60)/6, (unsigned long)rt / 60 /
60);
seq_printf(seq, " speed=%ldK/sec", db/2/dt);
}
Quoted 1 line · On Tue, 01 Nov 2011 17:53:47 -0400 Krzysztof Adamski <[email protected]> wrote:
This is my first patch, so please be gentle.
Always.
Quoted 6 lines
This patch adds the display of the number of hours till the completion of resync of an array in the
/proc/mdstatdisplay.Example: [>....................] resync = 3.3% (98633240/2928311808) finish=1026.1min (17h) speed=45957K/sec
Thanks.
While I can see the attraction of this I am always cautious of making unnecessary changes to /proc/mdstat.
It is very likely that people have ad-hoc scripts and programs which parse the output and do something with it.
While I think it is unlikely that the change you have suggested will break any such script, I cannot be at all sure that it won't break one. And I really don't like breaking things.
There certainly is value in having a way to see at a glance the over-all status of md. Currently that is
watch cat /proc/mdstat
(I run that whenever I am testing).
However if we want to improve it, I think it would be best to write a separate program that gathers data from there /proc/mdstat and/or /sys/block/md*/md/ and presents nicely-formatted output.
mdtop??
Thanks,
NeilBrown
Quoted 26 lines
Signed-off-by Krzysztof Adamski <[email protected]># diff -Naru drivers/md/md.c-orig drivers/md/md.cmd/md.c 2011-11-01 17:37:35.000000000 -0400 renamed from md/md.c-orig 2011-10-25 01:11:12.000000000 -0400 +2
-2@@ -6351,8 +6351,8 @@ rt *= dt; rt >>= 5; - seq_printf(seq, " finish=%lu.%lumin", (unsigned long)rt / 60, - ((unsigned long)rt % 60)/6); + seq_printf(seq, " finish=%lu.%lumin (%luh)", (unsigned long)rt / 60, + ((unsigned long)rt % 60)/6, (unsigned long)rt / 60 / 60);seq_printf(seq, " speed=%ldK/sec", db/2/dt);}
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Dear Krzysztof,
Am Dienstag, den 01.11.2011, 17:53 -0400 schrieb Krzysztof Adamski:
Quoted 1 line
This is my first patch, so please be gentle.
thank you for your patch. The line above does not belong to the commit message. You can put that below the commit message after »---« or on top and separate the patch using »--- 8< ----«. (See git help am for more information.
Quoted 9 lines
This patch adds the display of the number of hours till the completion of resync of an array in the
/proc/mdstatdisplay.Example: [>....................] resync = 3.3% (98633240/2928311808) finish=1026.1min (17h) speed=45957K/sec
Signed-off-by Krzysztof Adamski <[email protected]># diff -Naru drivers/md/md.c-orig drivers/md/md.c
It would be easier if you used git commit and for example
git format-patch -1 -s
and then sent it using git send-email or your MUA (see below).
md/md.c 2011-11-01 17:37:35.000000000 -0400 line 6357
Quoted 12 lines
md/md.c 2011-11-01 17:37:35.000000000 -0400 renamed from md/md.c-orig 2011-10-25 01:11:12.000000000 -0400 +2
-2@@ -6351,8 +6351,8 @@ rt *= dt; rt >>= 5; - seq_printf(seq, " finish=%lu.%lumin", (unsigned long)rt / 60, - ((unsigned long)rt % 60)/6); + seq_printf(seq, " finish=%lu.%lumin (%luh)", (unsigned long)rt / 60, + ((unsigned long)rt % 60)/6, (unsigned long)rt / 60 / 60);
Unfortunately your mailer mangled the patch. You should choose pre formatted, so automatic line breaks do not happen, which prevent the application of the patch.
Quoted 3 lines
md/md.c 2011-11-01 17:37:35.000000000 -0400 renamed from md/md.c-orig 2011-10-25 01:11:12.000000000 -0400 +0
-0seq_printf(seq, " speed=%ldK/sec", db/2/dt);}
Please resend this patch as v2.
git format-patch --subject-prefix="PATCH v2"
I am not sure if it should be a reply to the same thread or a new message.
You can add the following line to the the commit message.
(Different address on purpose.)
Thanks,
Paul