[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-tech-kern
Subject:    Re: Memory leak?
From:       Bill Studenmund <wrstuden () nas ! nasa ! gov>
Date:       1999-11-18 22:23:56
[Download RAW message or body]

On 18 Nov 1999, Michael Graff wrote:

> Is there any reason vnodes are kept on a private free list, rather
> than being given back to the memory pool like ffsinodes are?

As Jason mentioned, the fact that we're doing lazy reclamation is why.

We do lazy reclamation as there are a lot of times when we will re-use a
vnode. Think about the vnode for the directory "usr" in your root
filesystem. It (and its assosciated inode) got allocated the first time a
program looked in /usr. A name cache entry got allocated at the same time.
Once that name lookup was done, the vnode went onto the free list. Then
next time a path lookup crossed /usr, that vnode was reactivated, used,
and then put on the free list. Lazy reclamation permits us to not need to
read the disk each name lookup. ;-)

VOP_INACTIVE happens when a vnode goes on the free list, and VOP_RECLAIM
happens when it comes off to be used as something else.

Take care,

Bill

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic