diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:17:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:17:16 -0500 |
commit | c08acff0544c5dadf892e3908799a5ca1d98e592 (patch) | |
tree | 52fbb693a523ef7c6eeb33dd58c6a95f6feb1ea5 | |
parent | 10d0c9705e80bbd3d587c5fad24599aabaca6688 (diff) | |
parent | 90f2492cf9c84fd414ecfd2f40685fb5291a484e (diff) |
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()
-rw-r--r-- | arch/x86/include/asm/percpu.h | 8 | ||||
-rw-r--r-- | include/linux/percpu.h | 32 | ||||
-rw-r--r-- | mm/percpu.c | 5 |
3 files changed, 3 insertions, 42 deletions
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index b3e18f800302..94220d14d5cc 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -378,9 +378,6 @@ do { \ | |||
378 | #define __this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val) | 378 | #define __this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val) |
379 | #define __this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val) | 379 | #define __this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val) |
380 | #define __this_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val) | 380 | #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) | ||
384 | #define __this_cpu_xchg_1(pcp, val) percpu_xchg_op(pcp, val) | 381 | #define __this_cpu_xchg_1(pcp, val) percpu_xchg_op(pcp, val) |
385 | #define __this_cpu_xchg_2(pcp, val) percpu_xchg_op(pcp, val) | 382 | #define __this_cpu_xchg_2(pcp, val) percpu_xchg_op(pcp, val) |
386 | #define __this_cpu_xchg_4(pcp, val) percpu_xchg_op(pcp, val) | 383 | #define __this_cpu_xchg_4(pcp, val) percpu_xchg_op(pcp, val) |
@@ -400,9 +397,6 @@ do { \ | |||
400 | #define this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val) | 397 | #define this_cpu_or_1(pcp, val) percpu_to_op("or", (pcp), val) |
401 | #define this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val) | 398 | #define this_cpu_or_2(pcp, val) percpu_to_op("or", (pcp), val) |
402 | #define this_cpu_or_4(pcp, val) percpu_to_op("or", (pcp), val) | 399 | #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) | ||
406 | #define this_cpu_xchg_1(pcp, nval) percpu_xchg_op(pcp, nval) | 400 | #define this_cpu_xchg_1(pcp, nval) percpu_xchg_op(pcp, nval) |
407 | #define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval) | 401 | #define this_cpu_xchg_2(pcp, nval) percpu_xchg_op(pcp, nval) |
408 | #define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval) | 402 | #define this_cpu_xchg_4(pcp, nval) percpu_xchg_op(pcp, nval) |
@@ -447,7 +441,6 @@ do { \ | |||
447 | #define __this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) | 441 | #define __this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) |
448 | #define __this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) | 442 | #define __this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) |
449 | #define __this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) | 443 | #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) | ||
451 | #define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) | 444 | #define __this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) |
452 | #define __this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) | 445 | #define __this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) |
453 | #define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) | 446 | #define __this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) |
@@ -457,7 +450,6 @@ do { \ | |||
457 | #define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) | 450 | #define this_cpu_add_8(pcp, val) percpu_add_op((pcp), val) |
458 | #define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) | 451 | #define this_cpu_and_8(pcp, val) percpu_to_op("and", (pcp), val) |
459 | #define this_cpu_or_8(pcp, val) percpu_to_op("or", (pcp), val) | 452 | #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) | ||
461 | #define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) | 453 | #define this_cpu_add_return_8(pcp, val) percpu_add_return_op(pcp, val) |
462 | #define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) | 454 | #define this_cpu_xchg_8(pcp, nval) percpu_xchg_op(pcp, nval) |
463 | #define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) | 455 | #define this_cpu_cmpxchg_8(pcp, oval, nval) percpu_cmpxchg_op(pcp, oval, nval) |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index c74088ab103b..9e4761caa80c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -375,22 +375,6 @@ do { \ | |||
375 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) | 375 | # define this_cpu_or(pcp, val) __pcpu_size_call(this_cpu_or_, (pcp), (val)) |
376 | #endif | 376 | #endif |
377 | 377 | ||
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 | |||
394 | #define _this_cpu_generic_add_return(pcp, val) \ | 378 | #define _this_cpu_generic_add_return(pcp, val) \ |
395 | ({ \ | 379 | ({ \ |
396 | typeof(pcp) ret__; \ | 380 | typeof(pcp) ret__; \ |
@@ -629,22 +613,6 @@ do { \ | |||
629 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) | 613 | # define __this_cpu_or(pcp, val) __pcpu_size_call(__this_cpu_or_, (pcp), (val)) |
630 | #endif | 614 | #endif |
631 | 615 | ||
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 | |||
648 | #define __this_cpu_generic_add_return(pcp, val) \ | 616 | #define __this_cpu_generic_add_return(pcp, val) \ |
649 | ({ \ | 617 | ({ \ |
650 | __this_cpu_add(pcp, val); \ | 618 | __this_cpu_add(pcp, val); \ |
diff --git a/mm/percpu.c b/mm/percpu.c index 8c8e08f3a692..0d10defe951e 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
@@ -1706,8 +1706,9 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, | |||
1706 | 1706 | ||
1707 | out_free_areas: | 1707 | out_free_areas: |
1708 | for (group = 0; group < ai->nr_groups; group++) | 1708 | for (group = 0; group < ai->nr_groups; group++) |
1709 | free_fn(areas[group], | 1709 | if (areas[group]) |
1710 | ai->groups[group].nr_units * ai->unit_size); | 1710 | free_fn(areas[group], |
1711 | ai->groups[group].nr_units * ai->unit_size); | ||
1711 | out_free: | 1712 | out_free: |
1712 | pcpu_free_alloc_info(ai); | 1713 | pcpu_free_alloc_info(ai); |
1713 | if (areas) | 1714 | if (areas) |