From: Paul Menage Date: Mon, 16 Jul 2007 06:40:11 +0000 (-0700) Subject: Reduce cpuset.c write_lock_irq() to read_lock() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2aef333c98b41eeb0f0d55b7faa7d4625a6160b;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git Reduce cpuset.c write_lock_irq() to read_lock() 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 Acked-by: Paul Jackson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4c49188cc49b..824b1c01f410 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -981,10 +981,10 @@ static int update_nodemask(struct cpuset *cs, char *buf) 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); } @@ -1006,7 +1006,7 @@ static int update_nodemask(struct cpuset *cs, char *buf) 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