lkml.org 
[lkml]   [2006]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] asm-i386/atomic.h: local_irq_save should be used instead of local_irq_disable
Hi!
When I read the kernel codes, I think this perhaps be a little
bug, What do you think about this?

See the following patch (against 2.6.16.3)

Signed-off-by: Lepton Wu <ytht.net@gmail.com>

diff -pru linux-2.6-curr.orig/include/asm-i386/atomic.h linux-2.6-curr.lepton/include/asm-i386/atomic.h
--- linux-2.6-curr.orig/include/asm-i386/atomic.h 2006-04-06 09:21:53.000000000 +0800
+++ linux-2.6-curr.lepton/include/asm-i386/atomic.h 2006-04-11 20:47:39.000000000 +0800
@@ -189,6 +189,7 @@ static __inline__ int atomic_add_return(
{
int __i;
#ifdef CONFIG_M386
+ unsigned long flags;
if(unlikely(boot_cpu_data.x86==3))
goto no_xadd;
#endif
@@ -202,10 +203,10 @@ static __inline__ int atomic_add_return(

#ifdef CONFIG_M386
no_xadd: /* Legacy 386 processor */
- local_irq_disable();
+ local_irq_save(flags);
__i = atomic_read(v);
atomic_set(v, i + __i);
- local_irq_enable();
+ local_irq_restore(flags);
return i + __i;
#endif
}
-
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: 2006-04-11 15:03    [W:0.054 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site