]> git.hungrycats.org Git - linux/commitdiff
[PATCH] remove get_cpu_ptr()
authorAndrew Morton <akpm@osdl.org>
Wed, 6 Oct 2004 01:11:41 +0000 (18:11 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 01:11:41 +0000 (18:11 -0700)
Ingo points out that it's unusable anyway, because with some configs the
get_cpu() is evaluated and with others it is not.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/percpu.h
mm/slab.c

index 6aedd71cc02cada494a277c00e6d253093494ded..a493e372201eb565fadb4e8de872cd89371e7978 100644 (file)
@@ -58,26 +58,4 @@ static inline void free_percpu(const void *ptr)
 #define alloc_percpu(type) \
        ((type *)(__alloc_percpu(sizeof(type), __alignof__(type))))
 
-/* 
- * Use these with alloc_percpu. If
- * 1. You want to operate on memory allocated by alloc_percpu (dereference
- *    and read/modify/write)  AND 
- * 2. You want "this cpu's version" of the object AND 
- * 3. You want to do this safely since:
- *    a. On multiprocessors, you don't want to switch between cpus after 
- *    you've read the current processor id due to preemption -- this would 
- *    take away the implicit  advantage to not have any kind of traditional 
- *    serialization for per-cpu data
- *    b. On uniprocessors, you don't want another kernel thread messing
- *    up with the same per-cpu data due to preemption
- *    
- * So, Use get_cpu_ptr to disable preemption and get pointer to the 
- * local cpu version of the per-cpu object. Use put_cpu_ptr to enable
- * preemption.  Operations on per-cpu data between get_ and put_ is
- * then considered to be safe. And ofcourse, "Thou shalt not sleep between 
- * get_cpu_ptr and put_cpu_ptr"
- */
-#define get_cpu_ptr(ptr) per_cpu_ptr(ptr, get_cpu())
-#define put_cpu_ptr(ptr) put_cpu()
-
 #endif /* __LINUX_PERCPU_H */
index 92777dae06f24b984185c8f4eb3c2b5f1ee5007b..3b00d4499b3e50f633acf350dac1ea91e5f64d3b 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2435,8 +2435,7 @@ EXPORT_SYMBOL(__kmalloc);
 /**
  * __alloc_percpu - allocate one copy of the object for every present
  * cpu in the system, zeroing them.
- * Objects should be dereferenced using per_cpu_ptr/get_cpu_ptr
- * macros only.
+ * Objects should be dereferenced using the per_cpu_ptr macro only.
  *
  * @size: how many bytes of memory are required.
  * @align: the alignment, which can't be greater than SMP_CACHE_BYTES.