NetBSD-Bugs archive

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

Re: port-amd64/43438: x86 module map size is limited



The following reply was made to PR port-amd64/43438; it has been noted by GNATS.

From: Nicolas Joly <njoly%pasteur.fr@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-amd64/43438: x86 module map size is limited
Date: Wed, 9 Jun 2010 14:14:23 +0200

 --3V7upXqbjpZ4EhLz
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Wed, Jun 09, 2010 at 02:55:00AM +0000, mrg%eterna.com.au@localhost wrote:
 > >Number:         43438
 > >Category:       port-amd64
 > >Synopsis:       x86 module map size is limited
 [...]
 >      trying to load the "solaris" and "zfs" kmodules into an amd64
 >      GENERIC kernel results in ENOMEM being returned by the zfs load
 >      attempt.  i tracked this down to the x86 module_map being 
 >      sized at 20MB - size of kernel + rodata.  in my case, the module
 >      map was only left about 3MB or space, and it could not satisfy
 >      the modload attempts.
 
 I hit the same problem quite some time ago while playing with
 compat_linux modules ... At least for me, the problem is that modules
 for a MKDEBUG=yes,COPTS=-g build are gigantic. The attached patch,
 which remove debugging symbols from modules to be installed (but keeps
 a .gdb copy handy just in case ...) solved the problem.
 
 Unstripped:
 njoly@lanfeust [dest/amd64]> du -sh stand/amd64/5.99.30 
 42M     stand/amd64/5.99.30
 Stripped:
 njoly@lanfeust [dest/amd64]> du -sh stand/amd64/5.99.30
 6.5M    stand/amd64/5.99.30
 
 -- 
 Nicolas Joly
 
 Biological Software and Databanks.
 Institut Pasteur, Paris.
 
 --3V7upXqbjpZ4EhLz
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="netbsd-stripkmod.diff"
 
 Index: share/mk/bsd.kmodule.mk
 ===================================================================
 RCS file: /cvsroot/src/share/mk/bsd.kmodule.mk,v
 retrieving revision 1.24
 diff -u -p -r1.24 bsd.kmodule.mk
 --- share/mk/bsd.kmodule.mk    18 Jan 2010 23:39:07 -0000      1.24
 +++ share/mk/bsd.kmodule.mk    9 Jun 2010 11:54:48 -0000
 @@ -48,6 +48,14 @@ KMODSCRIPT= ${DESTDIR}/usr/libdata/ldscr
  OBJS+=                ${SRCS:N*.h:N*.sh:R:S/$/.o/g}
  PROG?=                ${KMOD}.kmod
  
 +.if ${MKDEBUG} != "no"
 +KMODDEBUG=    mv ${PROG} ${PROG}.gdb && \
 +              ${STRIP} --strip-debug -o ${PROG} ${PROG}.gdb
 +CLEANFILES+=  ${PROG}.gdb
 +.else
 +KMODDEBUG=    true
 +.endif
 +
  ##### Build rules
  realall:      ${PROG}
  
 @@ -57,6 +65,7 @@ ${PROG}: ${OBJS} ${DPADD}
        ${_MKTARGET_LINK}
        ${CC} ${LDFLAGS} -nostdlib -r -Wl,-T,${KMODSCRIPT},-d \
                -o ${.TARGET} ${OBJS}
 +      ${KMODDEBUG}
  
  ##### Install rules
  .if !target(kmodinstall)
 @@ -88,7 +97,7 @@ ${_PROG}:    .MADE                                   # no 
build at instal
        done
        ${INSTALL_DIR} ${KMODULEDIR}
        ${INSTALL_FILE} -o ${KMODULEOWN} -g ${KMODULEGRP} -m ${KMODULEMODE} \
 -              ${.ALLSRC} ${.TARGET}
 +              ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
  
  kmodinstall:: ${_PROG}
  .PHONY:               kmodinstall
 
 --3V7upXqbjpZ4EhLz--
 


Home | Main Index | Thread Index | Old Index