Skip to content

Commit c08acff

Browse files
committed
Merge branch 'for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu changes from Tejun Heo: "Two smallish changes for percpu. Two patches to remove unused this_cpu_xor() and one to fix a bug in percpu init failure path so that it can reach the proper BUG() instead of oopsing earlier" * 'for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: x86: remove this_cpu_xor() implementation percpu: remove this_cpu_xor() implementation percpu: fix bootmem error handling in pcpu_page_first_chunk()
2 parents 10d0c97 + 90f2492 commit c08acff

3 files changed

Lines changed: 3 additions & 42 deletions

File tree

‎arch/x86/include/asm/percpu.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,6 @@ do { \
378378
#define __this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val)
379379
#define __this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val)
380380
#define __this_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val)
381-
#define __this_cpu_xor_1(pcp, val) percpu_to_op("xor", (pcp), val)
382-
#define __this_cpu_xor_2(pcp, val) percpu_to_op("xor", (pcp), val)
383-
#define __this_cpu_xor_4(pcp, val) percpu_to_op("xor", (pcp), val)
384381
#define __this_cpu_xchg_1(pcp, val) percpu_xchg_op(pcp, val)
385382
#define __this_cpu_xchg_2(pcp, val) percpu_xchg_op(pcp, val)
386383
#define __this_cpu_xchg_4(pcp, val) percpu_xchg_op(pcp, val)
@@ -400,9 +397,6 @@ do { \
400397
#define this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val)
401398
#define this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val)
402399
#define this_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val)
403-
#define this_cpu_xor_1(pcp, val) percpu_to_op("xor", (pcp), val)
404-
#define this_cpu_xor_2(pcp, val) percpu_to_op("xor", (pcp), val)
405-
#define this_cpu_xor_4(pcp, val) percpu_to_op("xor", (pcp), val)
406400
#define this_cpu_xchg_1(pcp, nval) percpu_xchg_op(pcp, nval)
407401
#define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval)
408402
#define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval)
@@ -447,7 +441,6 @@ do { \
447441
#define __this_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
448442
#define __this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
449443
#define __this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val)
450-
#define __this_cpu_xor_8(pcp, val) percpu_to_op("xor", (pcp), val)
451444
#define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
452445
#define __this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval)
453446
#define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)
@@ -457,7 +450,6 @@ do { \
457450
#define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val)
458451
#define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val)
459452
#define this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val)
460-
#define this_cpu_xor_8(pcp, val) percpu_to_op("xor", (pcp), val)
461453
#define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val)
462454
#define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval)
463455
#define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval)

‎include/linux/percpu.h‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -375,22 +375,6 @@ do { \
375375
# define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val))
376376
#endif
377377

378-
#ifndef this_cpu_xor
379-
# ifndef this_cpu_xor_1
380-
# define this_cpu_xor_1(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
381-
# endif
382-
# ifndef this_cpu_xor_2
383-
# define this_cpu_xor_2(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
384-
# endif
385-
# ifndef this_cpu_xor_4
386-
# define this_cpu_xor_4(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
387-
# endif
388-
# ifndef this_cpu_xor_8
389-
# define this_cpu_xor_8(pcp, val) _this_cpu_generic_to_op((pcp), (val), ^=)
390-
# endif
391-
# define this_cpu_xor(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val))
392-
#endif
393-
394378
#define _this_cpu_generic_add_return(pcp, val) \
395379
({ \
396380
typeof(pcp) ret__; \
@@ -629,22 +613,6 @@ do { \
629613
# define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val))
630614
#endif
631615

632-
#ifndef __this_cpu_xor
633-
# ifndef __this_cpu_xor_1
634-
# define __this_cpu_xor_1(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
635-
# endif
636-
# ifndef __this_cpu_xor_2
637-
# define __this_cpu_xor_2(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
638-
# endif
639-
# ifndef __this_cpu_xor_4
640-
# define __this_cpu_xor_4(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
641-
# endif
642-
# ifndef __this_cpu_xor_8
643-
# define __this_cpu_xor_8(pcp, val) __this_cpu_generic_to_op((pcp), (val), ^=)
644-
# endif
645-
# define __this_cpu_xor(pcp, val) __pcpu_size_call(__this_cpu_xor_, (pcp), (val))
646-
#endif
647-
648616
#define __this_cpu_generic_add_return(pcp, val) \
649617
({ \
650618
__this_cpu_add(pcp, val); \

‎mm/percpu.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,8 +1706,9 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
17061706

17071707
out_free_areas:
17081708
for (group = 0; group < ai->nr_groups; group++)
1709-
free_fn(areas[group],
1710-
ai->groups[group].nr_units * ai->unit_size);
1709+
if (areas[group])
1710+
free_fn(areas[group],
1711+
ai->groups[group].nr_units * ai->unit_size);
17111712
out_free:
17121713
pcpu_free_alloc_info(ai);
17131714
if (areas)

0 commit comments

Comments
 (0)