]> git.karo-electronics.de Git - linux-beck.git/commitdiff
alloc_percpu: add align argument to __alloc_percpu.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 20 Feb 2009 07:29:08 +0000 (16:29 +0900)
committerTejun Heo <tj@kernel.org>
Fri, 20 Feb 2009 07:29:08 +0000 (16:29 +0900)
This prepares for a real __alloc_percpu, by adding an alignment argument.
Only one place uses __alloc_percpu directly, and that's for a string.

tj: af_inet also uses __alloc_percpu(), update it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>
block/blktrace.c
include/linux/percpu.h
net/ipv4/af_inet.c

index 39cc3bfe56e41055793a804e1461dad39045b264..487766237d285bd4dca463befc077f012041e56e 100644 (file)
@@ -363,7 +363,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
        if (!bt->sequence)
                goto err;
 
-       bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG);
+       bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
        if (!bt->msg_data)
                goto err;
 
index c80cfe1260eca75975d01b7ddb99d2da16104aa5..1fdaee93c04d105108bec595749a878812a3e4df 100644 (file)
@@ -108,9 +108,10 @@ static inline void percpu_free(void *__pdata)
 
 /* (legacy) interface for use without CPU hotplug handling */
 
-#define __alloc_percpu(size)   percpu_alloc_mask((size), GFP_KERNEL, \
+#define __alloc_percpu(size, align)    percpu_alloc_mask((size), GFP_KERNEL, \
                                                  cpu_possible_map)
-#define alloc_percpu(type)     (type *)__alloc_percpu(sizeof(type))
+#define alloc_percpu(type)     (type *)__alloc_percpu(sizeof(type), \
+                                                      __alignof__(type))
 #define free_percpu(ptr)       percpu_free((ptr))
 /*
  * Use this to get to a cpu's version of the per-cpu object dynamically
index 743f5542d65a6385c7ae423ddb49d4c69daaeaee..3a3dad8013548d5581ae8e9250f8e818a2a3a122 100644 (file)
@@ -1375,10 +1375,10 @@ EXPORT_SYMBOL_GPL(snmp_fold_field);
 int snmp_mib_init(void *ptr[2], size_t mibsize)
 {
        BUG_ON(ptr == NULL);
-       ptr[0] = __alloc_percpu(mibsize);
+       ptr[0] = __alloc_percpu(mibsize, __alignof__(unsigned long long));
        if (!ptr[0])
                goto err0;
-       ptr[1] = __alloc_percpu(mibsize);
+       ptr[1] = __alloc_percpu(mibsize, __alignof__(unsigned long long));
        if (!ptr[1])
                goto err1;
        return 0;