Re: percpu: Implement this_cpu_add,sub,dec,inc_return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 19 Nov 2010, Eric Dumazet wrote:

> By the way, is your patch really ok ?
>
> xadd %0,foo   returns in %0 the previous value of the memory, not the
> value _after_ the operation.
>
> This is why we do in arch/x86/include/asm/atomic.h :
>
> static inline int atomic_add_return(int i, atomic_t *v)
> ...
>
>         __i = i;
>         asm volatile(LOCK_PREFIX "xaddl %0, %1"
>                      : "+r" (i), "+m" (v->counter)
>                      : : "memory");
>         return i + __i;
> ...

Ok so rename the macros to this_cpu_return_inc/dec/add/sub?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]