NetBSD-Bugs archive

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

Re: kern/38374: fdfile leak



The following reply was made to PR kern/38374; it has been noted by GNATS.

From: Thomas Klausner <wiz%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: yamt%NetBSD.org@localhost
Subject: Re: kern/38374: fdfile leak
Date: Tue, 8 Apr 2008 23:05:51 +0200

 On Mon, Apr 07, 2008 at 05:00:09AM +0000, YAMAMOTO Takashi wrote:
 > From: yamt%mwd.biglobe.ne.jp@localhost (YAMAMOTO Takashi)
 > To: gnats-bugs%NetBSD.org@localhost
 > Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost, 
 > netbsd-bugs%netbsd.org@localhost
 > Subject: Re: kern/38374: fdfile leak
 > Date: Mon,  7 Apr 2008 13:57:39 +0900 (JST)
 > 
 >  > Maybe fd_lastfile is not being updated correctly?
 >  
 >  fd_lastfile shrinks without freeing fdfile_t.
 >  
 >  YAMAMOTO Takashi
 >  
 >  Index: kern_descrip.c
 >  ===================================================================
 >  RCS file: /cvsroot/src/sys/kern/kern_descrip.c,v
 >  retrieving revision 1.174
 >  diff -u -p -r1.174 kern_descrip.c
 >  --- kern_descrip.c  27 Mar 2008 18:33:39 -0000      1.174
 >  +++ kern_descrip.c  7 Apr 2008 04:56:22 -0000
 >  @@ -1475,7 +1475,7 @@ fd_free(void)
 >      /*
 >       * Close any files that the process holds open.
 >       */
 >  -   for (fd = 0, lastfd = fdp->fd_lastfile; fd <= lastfd; fd++) {
 >  +   for (fd = 0, lastfd = fdp->fd_nfiles - 1; fd <= lastfd; fd++) {
 >              ff = fdp->fd_ofiles[fd];
 >              KASSERT(fd >= NDFDFILE ||
 >                  ff == (fdfile_t *)fdp->fd_dfdfile[fd]);
 >  
 
 I was seeing a leak too (fdfile in vmstat -m went up to 26mio after
 two days of bulk building, see
 fdfile        64 26758557    0     4544 424667    0 424667 424667   0 inf    0
 and the patch improves the situation, after a few hours of bulk build
 it's still in a reasonable range:
 fdfile        64     5312    0     4637    19     5    14    17     0 inf    0
 
  Thomas
 


Home | Main Index | Thread Index | Old Index