[Crash-utility] kmem -s issue (gdb can't get offest of struct page lru member)

Michael Holzheu holzheu at linux.vnet.ibm.com
Tue Jan 10 10:14:23 UTC 2012


Hi Dave,

On Mon, 2012-01-09 at 14:06 -0500, Dave Anderson wrote:

[snip]

> > 
> > crash> struct page.lru
> > struct: invalid data structure reference: page.lru
> > 
> > Any idea why we do not get the offset from gdb?
> > Perhaps a problem with the anonymous union?
> 
> Right -- it's due to commit 49e2258586b423684f03c278149ab46d8f8b6700,
> which moved the page.lru field into an anonymous structure:
> 
>           /* Third double word block */
>   -       struct list_head lru;           /* Pageout list, eg. active_list
>   +       union {
>   +               struct list_head lru;   /* Pageout list, eg. active_list
>                                            * protected by zone->lru_lock !
>                                            */
>   +               struct {                /* slub per cpu partial pages */
>   +                       struct page *next;      /* Next partial slab */
>   +#ifdef CONFIG_64BIT
>   +                       int pages;      /* Nr of partial slabs left */
>   +                       int pobjects;   /* Approximate # of objects */
>   +#else
>   +                       short int pages;
>   +                       short int pobjects;
>   +#endif
>   +               };
>   +       };
> 
> And see https://www.redhat.com/archives/crash-utility/2012-January/msg00023.html
> for the gdb-related details.
>   
> Can you try a patch like this to vm_init():
> 
>         MEMBER_OFFSET_INIT(page_lru, "page", "lru");
> +	if (INVALID_MEMBER(page_lru))
> +               ANON_MEMBER_OFFSET_INIT(page_lru, "page", "lru");

This patch works, thanks!

Michael




More information about the Crash-utility mailing list