From 83cb8557e8d2c8e5eddc64840c437299343a7960 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Fri, 26 Jun 2015 17:21:28 -0400 Subject: percpu: update incorrect comment for this_cpu_*() operations this_cpu_*() ops have been protected against both preemption and interrupts for quite a while now. We apparently forgot to update the comment. Fix it. Signed-off-by: Tejun Heo Cc: Christoph Lameter diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 57f3a1c..8f16299 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h @@ -488,10 +488,8 @@ do { \ #define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) /* - * Operations with implied preemption protection. These operations can be - * used without worrying about preemption. Note that interrupts may still - * occur while an operation is in progress and if the interrupt modifies - * the variable too then RMW actions may not be reliable. + * Operations with implied preemption/interrupt protection. These + * operations can be used without worrying about preemption or interrupt. */ #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp) #define this_cpu_write(pcp, val) __pcpu_size_call(this_cpu_write_, pcp, val) -- cgit v0.10.2 From 292c24a073ee34c629966eec8b48d54b0a206667 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Mon, 20 Jul 2015 22:55:28 +0800 Subject: percpu: clean up of schunk->map[] assignment in pcpu_setup_first_chunk The original assignment is a little redundent. Signed-off-by: Baoquan He Acked-by: Christoph Lameter Signed-off-by: Tejun Heo diff --git a/mm/percpu.c b/mm/percpu.c index 2dd7448..a63b4d8 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1668,9 +1668,8 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai, schunk->map[1] = ai->static_size; schunk->map_used = 1; if (schunk->free_size) - schunk->map[++schunk->map_used] = 1 | (ai->static_size + schunk->free_size); - else - schunk->map[1] |= 1; + schunk->map[++schunk->map_used] = ai->static_size + schunk->free_size; + schunk->map[schunk->map_used] |= 1; /* init dynamic chunk if necessary */ if (dyn_size) { -- cgit v0.10.2