Re: Linux MD Raid Bug(?) w/Kernel sync_speed_min Option

2007-05-09 Thread Neil Brown
On Tuesday May 8, [EMAIL PROTECTED] wrote:
 
 Neil, awesome patch-- what are the chances of it getting merged into 
 2.6.22?
 

Probably.  I want to think it through a bit more - to make sure I can
write a coherent and correct changelog entry.

NeilBrown
-
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


Linux MD Raid Bug(?) w/Kernel sync_speed_min Option

2007-05-08 Thread Justin Piszcz

Kernel: 2.6.21.1

Here is the bug:

md2: RAID1 (works fine)
md3: RAID5 (only syncs at the sync_speed_min set by the kernel)

If I do not run this command:
echo 55000  /sys/block/md3/md/sync_speed_min

I will get 2 megabytes per second check speed for RAID 5.

However, the odd part is I can leave it the default for RAID1 and it will 
use the maximum IO available between both drives to run the check.


I think there is some kind of bug, essentially with RAID5 check's-- it 
only runs at the minimum value set (default in the kernel for raid5 is 
~2mb/s).


md2 : active raid1 sdb3[1] sda3[0]
  55681216 blocks [2/2] [UU]
  [===.]  check = 59.1% (32937536/55681216) 
finish=7.4min speed=50947K/sec


md3 : active raid5 sdl1[9] sdk1[8] sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] 
sde1[

2] sdd1[1] sdc1[0]
  1318686336 blocks level 5, 128k chunk, algorithm 2 [10/10] 
[UU]
  []  check = 24.2% (35578816/146520704) 
finish=33.3min speed=55464K/sec


Set to default kernel settings, either 2000 or 2100:

echo 2000  /sys/block/md3/md/sync_speed_min

Then,

md3 : active raid5 sdl1[9] sdk1[8] sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] 
sde1[

2] sdd1[1] sdc1[0]
  1318686336 blocks level 5, 128k chunk, algorithm 2 [10/10] 
[UU]
  [==..]  check = 31.5% (46191744/146520704) 
finish=715.7min speed=2335K/sec


There is some kind of nasty bug going on here with RAID 5 devices in the 
kernel.  Also, incase you wondered, there is little to no I/O on the RAID 
5 device when this check is being run, same for the root volume.


Justin.
-
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


Re: Linux MD Raid Bug(?) w/Kernel sync_speed_min Option

2007-05-08 Thread Neil Brown
On Tuesday May 8, [EMAIL PROTECTED] wrote:
 Kernel: 2.6.21.1
 
 Here is the bug:
 
 md2: RAID1 (works fine)
 md3: RAID5 (only syncs at the sync_speed_min set by the kernel)
 
 If I do not run this command:
 echo 55000  /sys/block/md3/md/sync_speed_min
 
 I will get 2 megabytes per second check speed for RAID 5.

I can only reproduce this if I set the stripe_cache_size somewhat
larger than the default of 256 - did you do this?

This code (is_mddev_idle) has always been a bit fragile, particularly
so since the block layer started account IO when it finished rather
than when it started.

This patch might help though.  Let me know if it does what you expect.

Thanks,
NeilBrown


Signed-off-by: Neil Brown [EMAIL PROTECTED]

### Diffstat output
 ./drivers/md/md.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c   2007-05-07 17:47:15.0 +1000
+++ ./drivers/md/md.c   2007-05-08 22:57:51.0 +1000
@@ -5095,7 +5095,7 @@ static int is_mddev_idle(mddev_t *mddev)
 *
 * Note: the following is an unsigned comparison.
 */
-   if ((curr_events - rdev-last_events + 4096)  8192) {
+   if ((long)curr_events - (long)rdev-last_events  8192) {
rdev-last_events = curr_events;
idle = 0;
}
-
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


Re: Linux MD Raid Bug(?) w/Kernel sync_speed_min Option

2007-05-08 Thread Justin Piszcz



On Tue, 8 May 2007, Neil Brown wrote:


On Tuesday May 8, [EMAIL PROTECTED] wrote:

Kernel: 2.6.21.1

Here is the bug:

md2: RAID1 (works fine)
md3: RAID5 (only syncs at the sync_speed_min set by the kernel)

If I do not run this command:
echo 55000  /sys/block/md3/md/sync_speed_min

I will get 2 megabytes per second check speed for RAID 5.


I can only reproduce this if I set the stripe_cache_size somewhat
larger than the default of 256 - did you do this?

This code (is_mddev_idle) has always been a bit fragile, particularly
so since the block layer started account IO when it finished rather
than when it started.

This patch might help though.  Let me know if it does what you expect.

Thanks,
NeilBrown


Signed-off-by: Neil Brown [EMAIL PROTECTED]

### Diffstat output
./drivers/md/md.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c   2007-05-07 17:47:15.0 +1000
+++ ./drivers/md/md.c   2007-05-08 22:57:51.0 +1000
@@ -5095,7 +5095,7 @@ static int is_mddev_idle(mddev_t *mddev)
 *
 * Note: the following is an unsigned comparison.
 */
-   if ((curr_events - rdev-last_events + 4096)  8192) {
+   if ((long)curr_events - (long)rdev-last_events  8192) {
rdev-last_events = curr_events;
idle = 0;
}
-
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




I can only reproduce this if I set the stripe_cache_size somewhat
larger than the default of 256 - did you do this?

Yes, upon bootup I use:
echo 16384  /sys/block/md3/md/stripe_cache_size

I have applied this patch and will test it now.

Justin.

-
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