mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
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
>
> fc9bb8c768
>
> 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>
This commit is contained in:
parent
9da4714a2d
commit
ea6bd8ee1a
|
|
@ -49,32 +49,27 @@ struct page {
|
||||||
* see PAGE_MAPPING_ANON below.
|
* see PAGE_MAPPING_ANON below.
|
||||||
*/
|
*/
|
||||||
/* Second double word */
|
/* Second double word */
|
||||||
union {
|
struct {
|
||||||
struct {
|
union {
|
||||||
pgoff_t index; /* Our offset within mapping. */
|
pgoff_t index; /* Our offset within mapping. */
|
||||||
|
void *freelist; /* slub first free object */
|
||||||
|
};
|
||||||
|
|
||||||
|
union {
|
||||||
atomic_t _mapcount; /* Count of ptes mapped in mms,
|
atomic_t _mapcount; /* Count of ptes mapped in mms,
|
||||||
* to show when page is mapped
|
* to show when page is mapped
|
||||||
* & limit reverse map searches.
|
* & limit reverse map searches.
|
||||||
*/
|
*/
|
||||||
atomic_t _count; /* Usage count, see below. */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct { /* SLUB cmpxchg_double area */
|
/* Used for cmpxchg_double in slub */
|
||||||
void *freelist;
|
unsigned long counters;
|
||||||
union {
|
struct {
|
||||||
unsigned long counters;
|
|
||||||
struct {
|
|
||||||
unsigned inuse:16;
|
unsigned inuse:16;
|
||||||
unsigned objects:15;
|
unsigned objects:15;
|
||||||
unsigned frozen:1;
|
unsigned frozen:1;
|
||||||
/*
|
|
||||||
* Kernel may make use of this field even when slub
|
|
||||||
* uses the rest of the double word!
|
|
||||||
*/
|
|
||||||
atomic_t _count;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
atomic_t _count; /* Usage count, see below. */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Third double word block */
|
/* Third double word block */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user