Re: [PATCH] realtime-preempt patch-2.6.15-rt19 compile error (was: realtime-preempt patch-2.6.15-rt18 issues)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* karsten wiese <[email protected]> wrote:

> 
> --- Rui Nuno Capela <[email protected]> schrieb:
> > - The SLAB related usb-storage crash on disconnect is
> > still there:
> 
> and its still in up to rc6-rt3, unless you apply attached patch. My 
> uniprocessor behaves with it.

ah, indeed!

> Ingo, what exactly needs fixing here?

smp_call_function() will call things in a hardirq context, so calling 
do_drain() from there [which uses preemptible spinlocks, etc.] is 
unsafe. (it will work most of the time, but not all of the time) It 
should rather be done from some per-CPU task.

a better fix would be the one below - it still does the call on the 
current CPU, and skips other CPUs (on SMP). Does this solve the problem 
on your box too?

	Ingo

Index: linux-rt.q/mm/slab.c
===================================================================
--- linux-rt.q.orig/mm/slab.c
+++ linux-rt.q/mm/slab.c
@@ -2192,19 +2192,20 @@ static void check_spinlock_acquired_node
  */
 static void smp_call_function_all_cpus(void (*func)(void *arg), void *arg)
 {
-	unsigned long flags;
+	unsigned int this_cpu;
 
 	check_irq_on();
-	preempt_disable();
+//	preempt_disable();
 
-	slab_irq_disable(flags);
+	slab_irq_disable(this_cpu);
 	func(arg);
-	slab_irq_enable(flags);
+	slab_irq_enable(this_cpu);
 
-	if (smp_call_function(func, arg, 1, 1))
-		BUG();
+// FIXME
+//	if (smp_call_function(func, arg, 1, 1))
+//		BUG();
 
-	preempt_enable();
+//	preempt_enable();
 }
 
 static void drain_array_locked(struct kmem_cache *cachep, struct array_cache *ac,
@@ -2231,8 +2232,7 @@ static void drain_cpu_caches(struct kmem
 	int this_cpu;
 	int node;
 
-// FIXME:
-//	smp_call_function_all_cpus(do_drain, cachep);
+	smp_call_function_all_cpus(do_drain, cachep);
 	check_irq_on();
 	for_each_online_node(node) {
 		l3 = cachep->nodelists[node];
-
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/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux