Re: [RFC PATCH] Dynamic sched domains (v0.5)

Dinakar Guniguntala
2005-05-03T14:52:13Z

> >On Mon, May 02, 2005 at 07:44:05PM +1000, Nick Piggin wrote:
>
> What are you protecting against, though? synchroinze_kernel can
> sleep, so local_irq_disable is probably the wrong thing to do as well.

Paul, any reason why code marked "####" (fn cpuset_rmdir) is under
the dentry lock ??

spin_lock(&cs->dentry->d_lock);
parent = cs->parent; ####
set_bit(CS_REMOVED, &cs->flags); ####
if (is_cpu_exclusive(cs))
update_cpu_domains(cs);
list_del(&cs->sibling); /* delete my sibling from parent->children */
if (list_empty(&parent->children))
check_for_release(parent);
d = dget(cs->dentry); <----
cs->dentry = NULL; <----
spin_unlock(&d->d_lock);

As far as I can see only the ones marked "<----" should be under the
dentry lock, considering the fact that it already holds the cpuset_sem
all the while.

I saw that calling update_cpu_domains with the dentry lock held,
causes it to oops with preempt turned on. (Scheduling while atomic)

-Dinakar