Commit 09a1468a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove get_cpu_ptr()

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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c4695119
......@@ -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 */
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment