[CRIU] [PATCH 0/5] Switch to kernel's atomic ops protos, v2

Alexander Kartashov alekskartashov at parallels.com
Thu Aug 15 07:34:22 EDT 2013


On 08/15/2013 12:14 PM, Cyrill Gorcunov wrote:
> Diff from v1 -- fix arm part. Alexander, please review.
Everything OK except minor problems with applying the patches #2 and #3.
The following hunk in the patch #2

-static inline unsigned int atomic_inc(atomic_t *v) { return atomic_add_return(1, v) - 1; }
+static inline int atomic_inc(atomic_t *v) { return atomic_add_return(1, v) - 1; }
  
-static inline unsigned int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1; }
+static inline int atomic_dec(atomic_t *v) { return atomic_sub_return(1, v) + 1; }


doesn't since the patched code looks in the following way:


[arch/arm/include/asm/atomic.h]

static inline unsigned int atomic_inc(atomic_t *v) { return 
atomic_add_return(1, v) - 1; }

static inline unsigned int atomic_add(atomic_t *v, unsigned int val) { 
return atomic_add_return(val, v) - val; }

static inline unsigned int atomic_dec(atomic_t *v) { return 
atomic_sub_return(1, v) + 1; }


Nevertheless

Tested-by: Alexander Kartashov <alekskartashov at parallels.com>

>
> Cyrill Gorcunov (5):
>    x86: asm -- Add cmpxchg helpers
>    arm: atomic -- Use signed types for
>      atomic_add_return/atomic_sub_return
>    x86: atomic -- Switch to linux kernel templates
>    arm: atomic -- Add atomic_read/atomic_set helpers
>    atomic: Use atomic_read instead of atomic_get
>
>   arch/arm/include/asm/atomic.h  |  28 ++++++----
>   arch/x86/include/asm/atomic.h  | 117 ++++++++++++++++++++++-------------------
>   arch/x86/include/asm/cmpxchg.h |  45 ++++++++++++++++
>   include/lock.h                 |  30 +++++------
>   stats.c                        |   6 +--
>   5 files changed, 146 insertions(+), 80 deletions(-)
>   create mode 100644 arch/x86/include/asm/cmpxchg.h
>


-- 
Sincerely yours,
Alexander Kartashov

Intern
Core team

www.parallels.com

Skype: aleksandr.kartashov
Email: alekskartashov at parallels.com



More information about the CRIU mailing list