Skip to contentSkip to conversation

scheduling while atomic in fs/file.c

PATCH Applied Daniel Walker 2 participants 2 messages May 16, 2006 – May 18, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scheduling while atomic in fs/file.c

Quite the smp_processor_id() warnings. The timer was pinned before, but the spinlock protection is such that the timer can migrate with out issues. Allowing the timers to migrate (although not often) will allow them to move off busy cpu's , and potentially follow the work queue that they wake up.

fs/file.c +3 -2
Index: linux-2.6.16/fs/file.c
===================================================================
@@ -137,7 +137,9 @@ static void free_fdtable_rcu(struct rcu_
 		kfree(fdt->fd);
 		kfree(fdt);
 	} else {
-		fddef = &get_cpu_var(fdtable_defer_list);
+
+		fddef = &per_cpu(fdtable_defer_list, raw_smp_processor_id());
+
 		spin_lock(&fddef->lock);
 		fdt->next = fddef->next;
 		fddef->next = fdt;
@@ -149,7 +151,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);
 	}
 }
 
Applied
#1 lore raw
Quoted 5 lines · Daniel Walker

Quite the smp_processor_id() warnings. The timer was pinned before, but the spinlock protection is such that the timer can migrate with out issues. Allowing the timers to migrate (although not often) will allow them to move off busy cpu's , and potentially follow the work queue that they wake up.

thanks, applied.

Ingo