]> err.no Git - linux-2.6/commitdiff
ocfs2_dlm: Call cond_resched_lock() once per hash bucket scan
authorSunil Mushran <sunil.mushran@oracle.com>
Tue, 17 Apr 2007 20:32:20 +0000 (13:32 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Thu, 26 Apr 2007 20:33:11 +0000 (13:33 -0700)
In dlm_migrate_all_locks(), we currently call cond_resched_lock() after
processing each lockres in a hash bucket. Move it outside the loop so as to
call it only after the entire hash bucket has been processed.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dlm/dlmdomain.c

index c558442a0b447fa449a1ba1e3118bc17d6b30ab9..5b9c6089082a47dbba4ff86b9b7e99c9f3d1e448 100644 (file)
@@ -430,11 +430,10 @@ redo_bucket:
 
                        dlm_lockres_put(res);
 
-                       cond_resched_lock(&dlm->spinlock);
-
                        if (dropped)
                                goto redo_bucket;
                }
+               cond_resched_lock(&dlm->spinlock);
                num += n;
                mlog(0, "%s: touched %d lockreses in bucket %d "
                     "(tot=%d)\n", dlm->name, n, i, num);