[lkml]   [2003]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [patch] epoll for 2.4.20 updated ...

On 2003.01.25 Davide Libenzi wrote:
> I updated the 2.4.20 patch with the changes posted today and I fixed a
> little error about the wait queue function prototype :

Mixing epoll ontop of current aa, I found this:

#define add_wait_queue_cond(q, wait, cond) \
({ \
unsigned long flags; \
int _raced = 0; \
wq_write_lock_irqsave(&(q)->lock, flags); \
(wait)->flags = 0; \
__add_wait_queue((q), (wait)); \
mb(); \
if (!(cond)) { \
_raced = 1; \
__remove_wait_queue((q), (wait)); \
} \
wq_write_unlock_irqrestore(&(q)->lock, flags); \
_raced; \

this is the -aa version. Version from epoll uses just a rmb() barrier
(afaik, just a _read_ barrier). In -aa they are just the same, but I also
use a patch that does this:

+#define mb() __asm__ __volatile__ ("mfence": : :"memory")
#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+#define rmb() __asm__ __volatile__ ("lfence": : :"memory")
#define rmb() mb()

so for modern processors they are different, and can affect performance and
correctness. So which one it the correct one for the above code snipet ?


J.A. Magallon <> \ Software is like sex: \ It's better when it's free
Mandrake Linux release 9.1 (Cooker) for i586
Linux 2.4.21-pre3-jam3 (gcc 3.2.1 (Mandrake Linux 9.1 3.2.1-3mdk))
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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