cpuset.c:update_nodemask() uses a write_lock_irq() on tasklist_lock to
block concurrent forks; a read_lock() suffices and is less intrusive.

Signed-off-by: Paul Menage<[EMAIL PROTECTED]>

---
 kernel/cpuset.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: scratch-2.6.22-rc1-mm1/kernel/cpuset.c
===================================================================
--- scratch-2.6.22-rc1-mm1.orig/kernel/cpuset.c
+++ scratch-2.6.22-rc1-mm1/kernel/cpuset.c
@@ -923,10 +923,10 @@ static int update_nodemask(struct cpuset
                mmarray = kmalloc(ntasks * sizeof(*mmarray), GFP_KERNEL);
                if (!mmarray)
                        goto done;
-               write_lock_irq(&tasklist_lock);         /* block fork */
+               read_lock(&tasklist_lock);              /* block fork */
                if (atomic_read(&cs->count) <= ntasks)
                        break;                          /* got enough */
-               write_unlock_irq(&tasklist_lock);       /* try again */
+               read_unlock(&tasklist_lock);    /* try again */
                kfree(mmarray);
        }
 
@@ -948,7 +948,7 @@ static int update_nodemask(struct cpuset
                        continue;
                mmarray[n++] = mm;
        } while_each_thread(g, p);
-       write_unlock_irq(&tasklist_lock);
+       read_unlock(&tasklist_lock);
 
        /*
         * Now that we've dropped the tasklist spinlock, we can

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to