Re: [PATCH] New cpu macro and i386 cleanup

From: Chuck Ebbert (76306.1226@compuserve.com)
Date: Sat Apr 05 2003 - 05:24:39 EST


Robert Love wrote:

> I like, although I am not hot on the name, but that is just taste.

I found myself wishing for C++ just for the function overloading so
it could be 'is_current(cpu)' or similar.

> One minor nit: it is not preempt-safe.

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.)

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?

> Maybe put a comment above it like:

How about one for the whole kernel?

        /**********
         * WARNING: Use preempt at your own risk.
         **********/

--
 Chuck
 I am not a number!
-
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:25 EST