Re: [PATCH] New cpu macro and i386 cleanup

From: Robert Love (rml@tech9.net)
Date: Fri Apr 04 2003 - 20:05:00 EST


On Fri, 2003-04-04 at 19:29, Chuck Ebbert wrote:
> This annoyed me just enough to try and fix it. I'd
> fix all the rest but I know how annoyed people get at
> massive changes:

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

One minor nit: it is not preempt-safe. But then again, neither is any
code that calls it without disabling preemption first. Maybe put a
comment above it like:

        /*
         * is_current_cpu() - are we running on the given processor?
         *
         * Note this is not preempt-safe: you need to explicitly
         * disable preemption before calling this if you care
         * about any consistency in the result
         */

The problem is not so much the call itself, but the use of the results.
Anywhere you care that 'cpu' is the current processor, kernel preemption
needs to remain disabled.

        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:25 EST