Add "--mem-usage" support for s390x

Michael Holzheu holzheu at linux.vnet.ibm.com
Wed Sep 24 08:19:04 PDT 2014


On Tue, 23 Sep 2014 10:40:58 +0800
Baoquan He <bhe at redhat.com> wrote:

> On 09/22/14 at 05:02pm, Michael Holzheu wrote:
> > Hello Baoquan,
> > 
> > I looked into your patches and tried to add s390x support.
> > 
> > My naive approach was to just enable the is_vmalloc_addr()
> > for s390x:
> > 
> > --- a/makedumpfile.h
> > +++ b/makedumpfile.h
> > @@ -814,13 +814,15 @@ unsigned long long vaddr_to_paddr_ppc(un
> >  #endif          /* powerpc32 */
> > 
> >  #ifdef __s390x__ /* s390x */
> > +int is_vmalloc_addr_s390x(ulong vaddr);
> >  int get_machdep_info_s390x(void);
> >  unsigned long long vaddr_to_paddr_s390x(unsigned long vaddr);
> >  #define get_phys_base()        TRUE
> >  #define get_machdep_info()     get_machdep_info_s390x()
> >  #define get_versiondep_info()  TRUE
> >  #define vaddr_to_paddr(X)      vaddr_to_paddr_s390x(X)
> > -#define is_vmalloc_addr(X)     TRUE
> > +#define is_vmalloc_addr(X)     is_vmalloc_addr_s390x(X)
> >  #endif          /* s390x */
> > 
> >  #ifdef __ia64__ /* ia64 */
> 
> Hi Michael, 
> 
> Please alse provide a get_versiondep_info_s390x since page_offset is
> needed in set_kcore_vmcoreinfo() and other information need it too, such
> as VMALLOC_START/VMEMMAP_START/MODULES_VADDR, if you want to provide a
> is_vmalloc_addr_s390x before initial() is called.

Hello Baoquan,

Thanks for the hint! I looked into the x86_64 implementation of 
get_versiondep_info() where version dependent constants are used
for vmalloc_start and others.

For s390x this is not so easy because vmalloc_start is dependent
on the memory size of the system (see setup_memory_end()
in arch/s390/kernel/setup.c). Unfortunately "info->max_mapnr"
is not set at that time.

Any ideas?

Michael




More information about the kexec mailing list