upcoming percpu changes

From: Stephen Rothwell
Date: Fri Feb 05 2010 - 00:17:04 EST


Hi Linus,

The percpu tree currently in linux-next
(git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git#for-next)
contains a patch to remove the "per_cpu_" prefix from percpu variables
followed by a set of patches to annotate all the percpu variables (and
accessing variables) with a __percpu tag to put them into a separate
sparse name space. These latter patches are causing some merge conflicts
with a couple of trees (and will most likely cause more before the merge
window). A solution to this is for you to accept the patch below into
your tree now and then the annotating patches can be sent to the
respective maintainers directly.

Of course, this assumes that you will accept the percpu changes during
the next merge window (and they are not completely without controversy)
and the proponents actually submit them :-).

What do you think?

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Fri, 5 Feb 2010 16:09:11 +1100
Subject: [PATCH] percpu: add __percpu for sparse

This is to make the annotation of percpu variables during the next merge
window less painfull.

Extracted from a patch by Rusty Russell.

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
include/linux/compiler.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 5be3dab..188fcae 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -15,6 +15,7 @@
# define __acquire(x) __context__(x,1)
# define __release(x) __context__(x,-1)
# define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0)
+# define __percpu __attribute__((noderef, address_space(3)))
extern void __chk_user_ptr(const volatile void __user *);
extern void __chk_io_ptr(const volatile void __iomem *);
#else
@@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);
# define __acquire(x) (void)0
# define __release(x) (void)0
# define __cond_lock(x,c) (c)
+# define __percpu
#endif

#ifdef __KERNEL__
--
1.6.6.1

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature