From 09a1468a82ab1f0f2de0c1dfeac37aee6a2fb53e Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 5 Oct 2004 18:11:41 -0700 Subject: [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: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/percpu.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'include/linux/percpu.h') diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 6aedd71cc02c..a493e372201e 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -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 */ -- cgit v1.2.3 From 8cda68f9f35b2a047d848366709b140e7d33a9de Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Sat, 9 Oct 2004 01:05:26 -0700 Subject: [PATCH] Remove get_cpu_ptr() comment reference Since get_cpu_ptr() went away, we probably shouldn't tease developers by telling them to use it in the comments. Signed-off-by: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/percpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/percpu.h') diff --git a/include/linux/percpu.h b/include/linux/percpu.h index a493e372201e..5451eb1e781d 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -24,8 +24,8 @@ struct percpu_data { /* * Use this to get to a cpu's version of the per-cpu object allocated using - * alloc_percpu. If you want to get "this cpu's version", maybe you want - * to use get_cpu_ptr... + * alloc_percpu. Non-atomic access to the current CPU's version should + * probably be combined with get_cpu()/put_cpu(). */ #define per_cpu_ptr(ptr, cpu) \ ({ \ -- cgit v1.2.3