diff options
-rw-r--r-- | block/blktrace.c | 2 | ||||
-rw-r--r-- | include/linux/percpu.h | 5 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/block/blktrace.c b/block/blktrace.c index 39cc3bfe56e4..487766237d28 100644 --- a/block/blktrace.c +++ b/block/blktrace.c | |||
@@ -363,7 +363,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, | |||
363 | if (!bt->sequence) | 363 | if (!bt->sequence) |
364 | goto err; | 364 | goto err; |
365 | 365 | ||
366 | bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG); | 366 | bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char)); |
367 | if (!bt->msg_data) | 367 | if (!bt->msg_data) |
368 | goto err; | 368 | goto err; |
369 | 369 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index c80cfe1260ec..1fdaee93c04d 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -108,9 +108,10 @@ static inline void percpu_free(void *__pdata) | |||
108 | 108 | ||
109 | /* (legacy) interface for use without CPU hotplug handling */ | 109 | /* (legacy) interface for use without CPU hotplug handling */ |
110 | 110 | ||
111 | #define __alloc_percpu(size) percpu_alloc_mask((size), GFP_KERNEL, \ | 111 | #define __alloc_percpu(size, align) percpu_alloc_mask((size), GFP_KERNEL, \ |
112 | cpu_possible_map) | 112 | cpu_possible_map) |
113 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type)) | 113 | #define alloc_percpu(type) (type *)__alloc_percpu(sizeof(type), \ |
114 | __alignof__(type)) | ||
114 | #define free_percpu(ptr) percpu_free((ptr)) | 115 | #define free_percpu(ptr) percpu_free((ptr)) |
115 | /* | 116 | /* |
116 | * Use this to get to a cpu's version of the per-cpu object dynamically | 117 | * Use this to get to a cpu's version of the per-cpu object dynamically |
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 743f5542d65a..3a3dad801354 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1375,10 +1375,10 @@ EXPORT_SYMBOL_GPL(snmp_fold_field); | |||
1375 | int snmp_mib_init(void *ptr[2], size_t mibsize) | 1375 | int snmp_mib_init(void *ptr[2], size_t mibsize) |
1376 | { | 1376 | { |
1377 | BUG_ON(ptr == NULL); | 1377 | BUG_ON(ptr == NULL); |
1378 | ptr[0] = __alloc_percpu(mibsize); | 1378 | ptr[0] = __alloc_percpu(mibsize, __alignof__(unsigned long long)); |
1379 | if (!ptr[0]) | 1379 | if (!ptr[0]) |
1380 | goto err0; | 1380 | goto err0; |
1381 | ptr[1] = __alloc_percpu(mibsize); | 1381 | ptr[1] = __alloc_percpu(mibsize, __alignof__(unsigned long long)); |
1382 | if (!ptr[1]) | 1382 | if (!ptr[1]) |
1383 | goto err1; | 1383 | goto err1; |
1384 | return 0; | 1384 | return 0; |