]> 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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 8 Dec 2009 18:20:58 +0000 (10:20 -0800)
commit 1d9d52416c0445019ccc1f0fddb9a227456eb61b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c

index 8726fd7ebce5d7bebfb48012db4785fe4b612c56..67cd1d9fa4ba33a4af8164f24d815a65acb6a37f 100644 (file)
@@ -1676,6 +1676,7 @@ static void raid1d(mddev_t *mddev)
                                generic_make_request(bio);
                        }
                }
+               cond_resched();
        }
        if (unplug)
                unplug_slaves(mddev);
index 3d9020cf6f6e4482c857644f721366fb8102f3d3..6a5a5fb18b30a9257eecd924d32a9b408f218b4f 100644 (file)
@@ -1630,6 +1630,7 @@ static void raid10d(mddev_t *mddev)
                                generic_make_request(bio);
                        }
                }
+               cond_resched();
        }
        if (unplug)
                unplug_slaves(mddev);