From owner-cvs-src@FreeBSD.ORG Fri Apr 9 10:44:12 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8E1C16A4CF for ; Fri, 9 Apr 2004 10:44:12 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 587D543D69 for ; Fri, 9 Apr 2004 10:44:12 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 49019 invoked by uid 1000); 9 Apr 2004 17:44:13 -0000 Date: Fri, 9 Apr 2004 10:44:13 -0700 (PDT) From: Nate Lawson To: Peter Edwards In-Reply-To: <4076DFB7.8040508@freebsd.org> Message-ID: <20040409104203.M48723@root.org> References: <20040409152753.148A716A500@hub.freebsd.org> <20040409102528.C48723@root.org> <4076DFB7.8040508@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_linker.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2004 17:44:12 -0000 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