lkml.org 
[lkml]   [2003]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] New cpu macro and i386 cleanup
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/

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