diff options
| -rw-r--r-- | include/linux/percpu-refcount.h | 8 | ||||
| -rw-r--r-- | mm/percpu.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h index dba35c411e8c..5d8920e23073 100644 --- a/include/linux/percpu-refcount.h +++ b/include/linux/percpu-refcount.h | |||
| @@ -110,7 +110,7 @@ static inline void percpu_ref_get(struct percpu_ref *ref) | |||
| 110 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 110 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); |
| 111 | 111 | ||
| 112 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | 112 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) |
| 113 | __this_cpu_inc(*pcpu_count); | 113 | this_cpu_inc(*pcpu_count); |
| 114 | else | 114 | else |
| 115 | atomic_inc(&ref->count); | 115 | atomic_inc(&ref->count); |
| 116 | 116 | ||
| @@ -136,7 +136,7 @@ static inline bool percpu_ref_tryget(struct percpu_ref *ref) | |||
| 136 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 136 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); |
| 137 | 137 | ||
| 138 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | 138 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { |
| 139 | __this_cpu_inc(*pcpu_count); | 139 | this_cpu_inc(*pcpu_count); |
| 140 | ret = true; | 140 | ret = true; |
| 141 | } else { | 141 | } else { |
| 142 | ret = atomic_inc_not_zero(&ref->count); | 142 | ret = atomic_inc_not_zero(&ref->count); |
| @@ -171,7 +171,7 @@ static inline bool percpu_ref_tryget_live(struct percpu_ref *ref) | |||
| 171 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 171 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); |
| 172 | 172 | ||
| 173 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { | 173 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) { |
| 174 | __this_cpu_inc(*pcpu_count); | 174 | this_cpu_inc(*pcpu_count); |
| 175 | ret = true; | 175 | ret = true; |
| 176 | } | 176 | } |
| 177 | 177 | ||
| @@ -196,7 +196,7 @@ static inline void percpu_ref_put(struct percpu_ref *ref) | |||
| 196 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); | 196 | pcpu_count = ACCESS_ONCE(ref->pcpu_count); |
| 197 | 197 | ||
| 198 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) | 198 | if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) |
| 199 | __this_cpu_dec(*pcpu_count); | 199 | this_cpu_dec(*pcpu_count); |
| 200 | else if (unlikely(atomic_dec_and_test(&ref->count))) | 200 | else if (unlikely(atomic_dec_and_test(&ref->count))) |
| 201 | ref->release(ref); | 201 | ref->release(ref); |
| 202 | 202 | ||
diff --git a/mm/percpu.c b/mm/percpu.c index 63e24fb4387b..2ddf9a990dbd 100644 --- a/mm/percpu.c +++ b/mm/percpu.c | |||
| @@ -610,7 +610,7 @@ static struct pcpu_chunk *pcpu_alloc_chunk(void) | |||
| 610 | chunk->map = pcpu_mem_zalloc(PCPU_DFL_MAP_ALLOC * | 610 | chunk->map = pcpu_mem_zalloc(PCPU_DFL_MAP_ALLOC * |
| 611 | sizeof(chunk->map[0])); | 611 | sizeof(chunk->map[0])); |
| 612 | if (!chunk->map) { | 612 | if (!chunk->map) { |
| 613 | kfree(chunk); | 613 | pcpu_mem_free(chunk, pcpu_chunk_struct_size); |
| 614 | return NULL; | 614 | return NULL; |
| 615 | } | 615 | } |
| 616 | 616 | ||
