scheduling while atomic in fs/file.c
PATCH 1/1 scheduling while atomic in fs/file.c
In free_fdtable_rcu() it does the following,
} else {
fddef = &get_cpu_var(fdtable_defer_list);
spin_lock(&fddef->lock);
...
spin_unlock(&fddef->lock);
put_cpu_var(fdtable_defer_list);
}I've never seen a scheduling while atomic, but seems like it could happen . Not much contention on this lock though.
fs/file.c +1 -2
@@ -137,7 +137,7 @@ static void free_fdtable_rcu(struct rcu_kfree (fdt->fd);kfree (fdt); }else { - fddef = &get_cpu_var (fdtable_defer_list); + fddef = &__get_cpu_var (fdtable_defer_list);spin_lock (&fddef->lock); fdt->next = fddef->next; fddef->next = fdt;
@@ -149,7 +149,6 @@ static void free_fdtable_rcu(struct rcu_if (!schedule_work (&fddef->wq))mod_timer (&fddef->timer,5 );spin_unlock (&fddef->lock); -put_cpu_var (fdtable_defer_list); } }
fs/file.c static void free_fdtable_rcu(struct rcu_ · line 140
Quoted 2 lines · Daniel Walker
fs/file.c +1
-1- fddef = &get_cpu_var (fdtable_defer_list); + fddef = &__get_cpu_var (fdtable_defer_list);
ok, the bug you found is real - but i dont like the fix: now we will be using smp_processor_id() in preemptible code, which will trip up under DEBUG_PREEMPT. Since in this particular case any CPU is fine, per_cpu(...,raw_smp_processor_id()) ought to do the trick. Mind to update the patch?
Ingo
Quoted 10 lines · Ingo Molnar
fs/file.c static void free_fdtable_rcu(struct rcu_ · line 140
Quoted 2 lines · Daniel Walker
fs/file.c +1
-1- fddef = &get_cpu_var (fdtable_defer_list); + fddef = &__get_cpu_var (fdtable_defer_list);ok, the bug you found is real - but i dont like the fix: now we will be using
smp_processor_id()in preemptible code, which will trip up underDEBUG_PREEMPT. Since in this particular case any CPU is fine, per_cpu(...,raw_smp_processor_id()) ought to do the trick. Mind to update the patch?
Sure I can do it, not exactly high priority considering it's never been observed ..
Daniel