Re: [RFC PATCH 4/4] mm: change slob's struct page definition to accomodate struct page changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 03 Jul 2012 at 03:57 GMT, Jiang Liu <jiang.liu@xxxxxxxxxx> wrote:
> Changeset fc9bb8c768abe7ae10861c3510e01a95f98d5933 "mm: Rearrange struct page"
> rearranges fields in struct page, so change slob's "struct page" definition
> to accomodate the changes.
>

struct page gets changed too after that commit.

>  	union {
>  		struct {
>  			unsigned long flags;	/* mandatory */
> -			atomic_t _count;	/* mandatory */
> -			slobidx_t units;	/* free units left in page */
> -			unsigned long pad[2];
> +			unsigned long pad1;
>  			slob_t *free;		/* first free slob_t in page */
> +			slobidx_t units;	/* free units left in page */
> +			atomic_t _count;	/* mandatory */
>  			struct list_head list;	/* linked list of free pages */
>  		};
>  		struct page page;

I think we should put two BUILD_ON()'s for this, to prevent future breakage,
something like:

BUILD_BUG_ON(offsetof(struct slob_page, _count) != offsetof(struct
page, _count));
BUILD_BUG_ON(offsetof(struct slob_page, flags) != offsetof(struct
page, flags));


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]