From: Rusty Russell <rusty@rustcorp.com.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-next@vger.kernel.org, Mike Travis <travis@sgi.com>,
Ingo Molnar <mingo@elte.hu>, Christoph Lameter <clameter@sgi.com>
Subject: Re: linux-next: manual merge of the rr tree
Date: Mon, 5 Jan 2009 19:11:52 +1030 [thread overview]
Message-ID: <200901051911.52923.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090105143239.08b1a060.sfr@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 4487 bytes --]
On Monday 05 January 2009 14:02:39 Stephen Rothwell wrote:
> Similarly with init/main.c, include/linux/percpu.h,
> include/asm-generic/percpu.h and arch/x86/include/asm/percpu.h (though
> against different commits/trees, of course).
OK, here's the merge as I did it. I've also attached a tarball of the files
post-merge.
Cheers,
Rusty.
diff --cc arch/x86/include/asm/percpu.h
index 5c0ef60,313b3d6..0000000
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
diff --cc include/asm-generic/percpu.h
index 627b446,1c02250..0000000
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@@ -117,11 -75,10 +117,15 @@@ extern void setup_per_cpu_areas(void)
#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var)))
#define __get_cpu_var(var) per_cpu_var(var)
#define __raw_get_cpu_var(var) per_cpu_var(var)
+#define read_percpu_var(var) (0, per_cpu_var(var))
+#define per_cpu_ptr(ptr, cpu) (ptr)
+#define __get_cpu_ptr(ptr) (ptr)
+#define __raw_get_cpu_ptr(ptr) (ptr)
+#define read_percpu_ptr(ptr) (0, *(ptr))
+ #ifndef SHIFT_PERCPU_PTR
+ # define SHIFT_PERCPU_PTR(__p, __offset) (__p)
+ #endif
+ #define per_cpu_offset(x) 0L
#endif /* SMP */
diff --cc include/linux/percpu.h
index dad0070,e1f8708..0000000
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@@ -26,25 -26,46 +26,40 @@@
#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
__attribute__((__section__(".data.percpu.page_aligned"))) \
- PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
+ PER_CPU_ATTRIBUTES __typeof__(type) __percpu name
+
+ #ifdef CONFIG_HAVE_ZERO_BASED_PER_CPU
+ #define DEFINE_PER_CPU_FIRST(type, name) \
+ __attribute__((__section__(".data.percpu.first"))) \
- PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
++ PER_CPU_ATTRIBUTES __typeof__(type) __percpu name
#else
+ #define DEFINE_PER_CPU_FIRST(type, name) \
+ DEFINE_PER_CPU(type, name)
+ #endif
+
+ #else /* !CONFIG_SMP */
+
#define DEFINE_PER_CPU(type, name) \
- PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name
+ PER_CPU_ATTRIBUTES __typeof__(type) __percpu name
#define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \
DEFINE_PER_CPU(type, name)
#define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \
DEFINE_PER_CPU(type, name)
- #endif
+
+ #define DEFINE_PER_CPU_FIRST(type, name) \
+ DEFINE_PER_CPU(type, name)
+
+ #endif /* !CONFIG_SMP */
-#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
-#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var)
+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var)
-/* Enough to cover all DEFINE_PER_CPUs in kernel, including modules. */
#ifndef PERCPU_ENOUGH_ROOM
-#ifdef CONFIG_MODULES
-#define PERCPU_MODULE_RESERVE 8192
-#else
-#define PERCPU_MODULE_RESERVE 0
-#endif
+extern unsigned int percpu_reserve;
-#define PERCPU_ENOUGH_ROOM \
- (__per_cpu_end - __per_cpu_start + PERCPU_MODULE_RESERVE)
+#define PERCPU_ENOUGH_ROOM (__per_cpu_end - __per_cpu_start + percpu_reserve)
#endif /* PERCPU_ENOUGH_ROOM */
/*
diff --cc init/main.c
index 8a2d82c,d1c5b8b..0000000
--- a/init/main.c
+++ b/init/main.c
diff --cc kernel/module.c
index 99d1756,9712c52..0000000
--- a/kernel/module.c
+++ b/kernel/module.c
diff --git a/mm/allocpercpu.c b/mm/allocpercpu.c
index fa7f356..e77284f 100644
--- a/mm/allocpercpu.c
+++ b/mm/allocpercpu.c
@@ -61,7 +61,7 @@ void *__alloc_percpu(unsigned long size, unsigned long align)
if (WARN_ON(align > PAGE_SIZE))
align = PAGE_SIZE;
- ptr = __per_cpu_start;
+ ptr = __per_cpu_load;
for (i = 0; i < pcpu_num_used; ptr += block_size(pcpu_size[i]), i++) {
/* Extra for alignment requirement. */
extra = ALIGN((unsigned long)ptr, align) - (unsigned long)ptr;
@@ -107,7 +107,7 @@ EXPORT_SYMBOL_GPL(__alloc_percpu);
void free_percpu(void *freeme)
{
unsigned int i;
- void *ptr = __per_cpu_start + block_size(pcpu_size[0]);
+ void *ptr = __per_cpu_load + block_size(pcpu_size[0]);
if (!freeme)
return;
@@ -147,7 +147,7 @@ void __init percpu_alloc_init(void)
pcpu_size = kmalloc(sizeof(pcpu_size[0]) * pcpu_num_allocated,
GFP_KERNEL);
/* Static in-kernel percpu data (used). */
- pcpu_size[0] = -(__per_cpu_end-__per_cpu_start);
+ pcpu_size[0] = -__per_cpu_size;
/* Free room. */
pcpu_size[1] = PERCPU_ENOUGH_ROOM + pcpu_size[0];
BUG_ON(pcpu_size[1] < 0);
[-- Attachment #2: files.tar.bz2 --]
[-- Type: application/x-bzip-compressed-tar, Size: 27310 bytes --]
next prev parent reply other threads:[~2009-01-05 8:42 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 3:32 linux-next: manual merge of the rr tree Stephen Rothwell
2009-01-05 6:57 ` Rusty Russell
2009-01-05 12:47 ` Ingo Molnar
2009-01-06 8:51 ` Rusty Russell
2009-01-06 9:20 ` Ingo Molnar
2009-01-06 13:13 ` Mike Travis
2009-01-06 13:19 ` Ingo Molnar
2009-01-06 14:21 ` Mike Travis
2009-01-06 14:59 ` Ingo Molnar
2009-01-07 2:46 ` Rusty Russell
2009-01-05 15:29 ` Christoph Lameter
2009-01-06 1:04 ` Rusty Russell
2009-01-06 15:05 ` Christoph Lameter
2009-01-07 2:47 ` Rusty Russell
2009-01-07 16:11 ` Christoph Lameter
2009-01-07 17:20 ` Andi Kleen
2009-01-07 19:01 ` Christoph Lameter
2009-01-08 20:48 ` Andi Kleen
2009-01-08 20:50 ` Andrew Morton
2009-01-08 21:15 ` Christoph Lameter
2009-01-08 21:49 ` Andi Kleen
2009-01-08 22:21 ` Christoph Lameter
2009-01-08 22:25 ` David Miller
2009-01-09 14:42 ` Christoph Lameter
2009-01-09 22:54 ` David Miller
2009-01-05 19:46 ` Mike Travis
2009-01-05 8:41 ` Rusty Russell [this message]
2009-01-06 3:46 ` Stephen Rothwell
2009-01-06 13:26 ` Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2009-01-09 1:53 Stephen Rothwell
2009-01-06 3:11 Stephen Rothwell
2008-12-29 7:51 Stephen Rothwell
2008-12-29 7:47 Stephen Rothwell
2008-12-29 8:02 ` Stephen Rothwell
2008-12-22 6:32 Stephen Rothwell
2008-12-22 7:58 ` Rusty Russell
2008-12-22 8:45 ` Mark McLoughlin
2009-01-04 23:30 ` Stephen Rothwell
2009-01-05 4:36 ` Greg KH
2009-01-05 5:56 ` Stephen Rothwell
2008-12-16 5:29 Stephen Rothwell
2008-12-15 6:15 Stephen Rothwell
2008-11-24 3:20 Stephen Rothwell
2008-11-20 3:24 Stephen Rothwell
2008-11-20 4:28 ` Rusty Russell
2008-11-14 4:13 Stephen Rothwell
2008-11-14 4:20 ` Stephen Rothwell
2008-11-14 4:30 ` David Miller
2008-11-14 4:36 ` Stephen Rothwell
2008-11-14 4:41 ` David Miller
2008-11-14 5:06 ` Stephen Rothwell
2008-11-14 6:42 ` David Miller
2008-11-15 22:32 ` Rusty Russell
2008-11-17 2:57 ` David Miller
2008-11-07 5:01 Stephen Rothwell
2008-10-29 4:28 Stephen Rothwell
2008-10-29 4:33 ` Stephen Rothwell
2008-10-29 22:42 ` Rusty Russell
2008-10-28 2:55 Stephen Rothwell
2008-10-28 7:19 ` Heiko Carstens
2008-10-28 7:24 ` Stephen Rothwell
2008-10-27 3:32 Stephen Rothwell
2008-10-24 2:21 Stephen Rothwell
2008-10-23 4:12 Stephen Rothwell
2008-10-23 5:16 ` Rusty Russell
2008-10-23 12:26 ` Rusty Russell
2008-10-23 12:50 ` Mike Travis
2008-10-23 4:01 Stephen Rothwell
2008-10-23 7:17 ` Peter Zijlstra
2008-10-23 13:32 ` Rusty Russell
2008-10-23 3:56 Stephen Rothwell
2008-10-23 12:25 ` Rusty Russell
2008-09-12 21:53 Stephen Rothwell
2008-07-28 3:16 Stephen Rothwell
2008-07-28 3:13 Stephen Rothwell
2008-07-28 3:09 Stephen Rothwell
2008-07-22 4:58 Stephen Rothwell
2008-07-22 14:21 ` Mike Travis
2008-07-16 8:15 Stephen Rothwell
2008-07-17 5:46 ` Max Krasnyansky
2008-07-18 4:31 ` Rusty Russell
2008-07-14 6:52 Stephen Rothwell
2008-07-03 5:03 Stephen Rothwell
2008-07-03 5:56 ` Ingo Molnar
2008-07-03 8:07 ` Stephen Rothwell
2008-07-03 8:19 ` Ingo Molnar
2008-07-04 0:45 ` Rusty Russell
2008-07-04 0:29 ` Rusty Russell
2008-06-25 6:27 Stephen Rothwell
2008-06-25 6:38 ` Christian Borntraeger
2008-06-25 15:23 ` Stephen Rothwell
2008-06-25 6:27 Stephen Rothwell
2008-06-25 7:47 ` Ingo Molnar
2008-06-25 8:33 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901051911.52923.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=clameter@sgi.com \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=sfr@canb.auug.org.au \
--cc=travis@sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).