diff options
author | Christoph Lameter <cl@linux.com> | 2011-07-06 10:46:18 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2011-07-07 15:24:30 -0400 |
commit | ea6bd8ee1a2ccdffc38b2b1fcfe941addfafaade (patch) | |
tree | d8f98147ed392a6b49d89f6cfe5885b059a58538 /include | |
parent | 9da4714a2d44ff48618a8d375dd81873e858803d (diff) |
SLUB: Fix build breakage in linux/mm_types.h
On Wed, 6 Jul 2011, Jonathan Cameron wrote:
> Getting:
>
> CHK include/linux/version.h
> CHK include/generated/utsrelease.h
> make[1]: `include/generated/mach-types.h' is up to date.
> CC arch/arm/kernel/asm-offsets.s
> In file included from include/linux/sched.h:64:0,
> from arch/arm/kernel/asm-offsets.c:13:
> include/linux/mm_types.h:74:15: error: duplicate member '_count'
> make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
> make: *** [prepare0] Error 2
>
> Issue looks to have been introduced by
>
> mm: Rearrange struct page
>
> fc9bb8c768abe7ae10861c3510e01a95f98d5933
>
> Guessing it's a known issue, but just thought I'd flag it up in case
> it's something very specific about my build.
>
> gcc-2.6 armv7a
>
> Reverting that patch works, but given I don't know the history, I'm
> not proposing doing that in general!
Well _count exists in two unionized structs but always has the same offset
within the larger struct. Maybe ARM creates different offsets there for
some reason?
The following is a patch to restructure the union / structs combo in such
a way that only a single definition of _count
Reported-by: Jonathan Cameron <jic23@cam.ac.uk>
Tested-by: Piotr Hosowicz <piotr@hosowicz.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm_types.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 3d76a433d52..6dc6413f5de 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -49,32 +49,27 @@ struct page { | |||
49 | * see PAGE_MAPPING_ANON below. | 49 | * see PAGE_MAPPING_ANON below. |
50 | */ | 50 | */ |
51 | /* Second double word */ | 51 | /* Second double word */ |
52 | union { | 52 | struct { |
53 | struct { | 53 | union { |
54 | pgoff_t index; /* Our offset within mapping. */ | 54 | pgoff_t index; /* Our offset within mapping. */ |
55 | void *freelist; /* slub first free object */ | ||
56 | }; | ||
57 | |||
58 | union { | ||
55 | atomic_t _mapcount; /* Count of ptes mapped in mms, | 59 | atomic_t _mapcount; /* Count of ptes mapped in mms, |
56 | * to show when page is mapped | 60 | * to show when page is mapped |
57 | * & limit reverse map searches. | 61 | * & limit reverse map searches. |
58 | */ | 62 | */ |
59 | atomic_t _count; /* Usage count, see below. */ | ||
60 | }; | ||
61 | 63 | ||
62 | struct { /* SLUB cmpxchg_double area */ | 64 | /* Used for cmpxchg_double in slub */ |
63 | void *freelist; | 65 | unsigned long counters; |
64 | union { | 66 | struct { |
65 | unsigned long counters; | ||
66 | struct { | ||
67 | unsigned inuse:16; | 67 | unsigned inuse:16; |
68 | unsigned objects:15; | 68 | unsigned objects:15; |
69 | unsigned frozen:1; | 69 | unsigned frozen:1; |
70 | /* | ||
71 | * Kernel may make use of this field even when slub | ||
72 | * uses the rest of the double word! | ||
73 | */ | ||
74 | atomic_t _count; | ||
75 | }; | ||
76 | }; | 70 | }; |
77 | }; | 71 | }; |
72 | atomic_t _count; /* Usage count, see below. */ | ||
78 | }; | 73 | }; |
79 | 74 | ||
80 | /* Third double word block */ | 75 | /* Third double word block */ |