]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
md/raid1/raid10: add a cond_resched
authorNeilBrown <neilb@suse.de>
Fri, 16 Oct 2009 04:55:32 +0000 (15:55 +1100)
committerNeilBrown <neilb@suse.de>
Fri, 16 Oct 2009 04:55:32 +0000 (15:55 +1100)
During 'check' of a raid1 or raid10 it is possible for the management
thread to spend a lot of time running 'memcmp' on blocks from
different devices, so make sure the thread has a chance to schedule.
raid5d already has a cond_resched (in process_stripe).

Reported-By: Lee Howard <faxguy@howardsilvan.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c

index d1b9bd5fd4f6cad04f4037ece137f43904f50de6..71a01a2e19381b08050ed19c2ebb2e1210f653bd 100644 (file)
@@ -1683,6 +1683,7 @@ static void raid1d(mddev_t *mddev)
                                generic_make_request(bio);
                        }
                }
+               cond_resched();
        }
        if (unplug)
                unplug_slaves(mddev);
index 51c4c5c4d87add417a297714f7873df95979001d..69fc76caa469a9424a218db4e1217310919b4b17 100644 (file)
@@ -1632,6 +1632,7 @@ static void raid10d(mddev_t *mddev)
                                generic_make_request(bio);
                        }
                }
+               cond_resched();
        }
        if (unplug)
                unplug_slaves(mddev);