Re: [PATCH] New cpu macro and i386 cleanup

From: Robert Love (rml@tech9.net)
Date: Sat Apr 05 2003 - 13:56:06 EST


On Sat, 2003-04-05 at 05:24, Chuck Ebbert wrote:

> I was wondering whether the code I converted was running with preempt
> disabled or not but didn't check. (The very thought of preempt on
> SMP scares me anyway, so I avoid it.)

On a glance, it looked like at least some of them were.

> smp_processor_id() is not preempt-safe either, since the id could
> change before you even get a chance to use the value. How many
> thousands of lines of code remain that were written assuming things
> would not change underneath them in kernel mode?

Code that needs the processor number to remain fixed now uses get_cpu()
and put_cpu() which disable preemption.

> > Maybe put a comment above it like:
>
>
> How about one for the whole kernel?
>
> /**********
> * WARNING: Use preempt at your own risk.
> **********/

No :)

        Robert Love

-
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/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:26 EST