lkml.org 
[lkml]   [2002]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] misc. kernel preemption bits
Robert Love wrote:
>
> ...
> - we have a debug check in preempt_schedule that, even
> on detecting a schedule with irqs disabled, still goes
> ahead and reschedules. We should return. (me)
>

OK, but that warning will still come out of the mess in mm/slab.c.

Reminder:

CPU0: CPU1:
local_irq_disable(); resched_task(task on CPU0)
spin_lock();
... p->need_resched = 1;
spin_unlock(); // reschedules
local_irq_enable();

There is one code path in slab which fixes this with _raw_spin_unlock()
and a subsequent preempt_disable(), but there are quite a lot of other
code paths which need the same treatment. Fixing them is messy.

So unless you guys hit me with a brick, I'll create:

#ifdef CONFIG_SMP
#define preempt_disable_irqsave(flags)
do {
preempt_disable();
local_irq_save(flags);
} while (0)
#define preempt_enable_irqrestore(flags)
do {
local_irq_restore(flags);
preempt_enable();
} while (0)
#else
#define preempt_disable_irqsave(flags)
do {
local_irq_save(flags);
} while (0)
#define preempt_enable_irqrestore(flags)
do {
local_irq_restore(flags);
} while (0)
#endif

and use that in slab.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.058 / U:1.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site