Date: Fri, 9 Apr 2004 10:44:13 -0700 (PDT) From: Nate Lawson <nate@root.org> To: Peter Edwards <peadar@freebsd.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_linker.c Message-ID: <20040409104203.M48723@root.org> In-Reply-To: <4076DFB7.8040508@freebsd.org> References: <20040409152753.148A716A500@hub.freebsd.org> <20040409102528.C48723@root.org> <4076DFB7.8040508@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 9 Apr 2004, Peter Edwards wrote: > Nate Lawson wrote: > >On Fri, 9 Apr 2004, Peter Edwards wrote: > >>peadar 2004/04/09 08:27:38 PDT > >> > >> FreeBSD src repository > >> > >> Modified files: > >> sys/kern kern_linker.c > >> Log: > >> Plug minor memory leak of module_t structures when unloading a file > >> from the kernel. > >> > >> Reviewed By: Doug Rabson (dfr@) > >> > >> Revision Changes Path > >> 1.110 +3 -1 src/sys/kern/kern_linker.c > > > >Excellent! In stress testing some attach/detach routines with > >load/unload, I noticed memory allocation slowly increasing but couldn't > >find a problem with my driver. Are there any other observable leaks? > > As far as I can tell, that was the only leak. I was updating NFS > client/server to allow safe loads/unloads, and with the patch, 2 minutes > running this: > > > while true > > do > > kldload nfsclient > > kldunload nfsclient > > done > > made no noticable difference to the wired memory reported in top, or any > of the "InUse" counts from vmstat -m. Great. You might also want to artificially introduce an error in the attach routine at the end to make sure it really cleans up resources correctly. I basically did an artificial "error = ENXIO; goto out;" after a successful attach to test the resource cleanup. Then load/unload like above. I wasn't sure if it was a leak in resource handling or the driver. Perhaps this bug is the only one but if you have time to check, that would be nice. -Nate
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040409104203.M48723>