All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maneesh Soni <maneesh@in.ibm.com>
To: "Adam J. Richter" <adam@yggdrasil.com>
Cc: gjwucherpfennig@gmx.net, greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: Kernel thoughts of a Linux user
Date: Mon, 22 Nov 2004 14:21:45 -0600	[thread overview]
Message-ID: <20041122202144.GA12858@in.ibm.com> (raw)
In-Reply-To: <200411221454.iAMEs1t02247@freya.yggdrasil.com>

On Mon, Nov 22, 2004 at 10:54:01PM +0800, Adam J. Richter wrote:
> I wrote:
> >        Please correct me if I am wrong, but, as far as I can tell,
> >in 2.6.10-rc2-bk6, a struct dentry is held for each node in the sysfs
> >tree at all times.  I infer this from noticing that sysfs_drop_dentry
> >and sysfs_hash_and_remove in fs/sysfs/inode.c only seem to be called
> >on operations to delete a node.  If I've missed something and the dentry
> >structures are all or mostly released, I would love to be corrected about
> >it as that would be really good news to me.
> 

The new code doesnot pin the leaf nodes but still pins (by having an extra 
ref count will creation) the non-leaf nodes or directory dentry and inode. 
The non-directory (leaf nodes) dentry and inodes are freed as per the normal 
VFS/dcache cache eviction policies. Dentries not in use, will be pruned under 
memory pressure and eventually evict inodes also.

> 	I should correct myself, although this correction suggests
> that sysfs currently uses slightly _more_ memory than I previously
> thought in the case of my computer (1100 directories and 2305
> non-directories in sysfs).
> 
> 	In 2.6.10-rc2-bk6, it looks like sysfs releases the dname
> structures as well in the case of a file (attribute) or symlink,
> but keeps these structures *and* a struct inode for every directory
> (kobject).  So, it looks like the non-swappable memory usage of my
> /sys is actually about 900kB.
> 
> 			directories		non-directories
> 	dentry		144			0
> 	inode		344			0
> 	sysfs_dirent	36			36
> 
> 	Bytes per:	524			36
> 	#of nodes:	1100			2305
> 	Subtotal:	576,400			82,980
> 
> 	Total:		659,380 bytes
> 
> 
> 	Perhaps the code that allows non-directories in sysfs to free
> their inode and dname structures will in the future be extended to allow
> directories do so also, which would reduce that total to 122kB.

Extending this to directories introduces lots of race conditions in 
maintaining the coherancy between VFS dentry tree and sysfs_dirent
based tree. It could be doable but not without complications.

Thanks
Maneesh

-- 
Maneesh Soni
Linux Technology Center, 
IBM Austin
email: maneesh@in.ibm.com
Phone: 1-512-838-1896 Fax: 
T/L : 6781896

  reply	other threads:[~2004-11-22 20:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-22 14:54 Kernel thoughts of a Linux user Adam J. Richter
2004-11-22 20:21 ` Maneesh Soni [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-12-14 18:02 Jan Engelhardt
2004-11-22 15:32 Adam J. Richter
2004-11-22  9:54 Adam J. Richter
2004-11-20 10:31 Gerold J. Wucherpfennig
2004-11-21 18:29 ` Greg KH
2004-11-22 21:33   ` Gerold J. Wucherpfennig
2004-11-22 18:40     ` Greg KH
2004-11-22 18:52     ` Måns Rullgård
2004-11-18 17:59 Gerold J. Wucherpfennig
2004-11-18 18:50 ` Greg KH
2004-11-18 20:00 ` Tomas Carnecky
2004-11-18 20:46   ` Jan Engelhardt
2004-11-18 20:52     ` Tomas Carnecky
2004-11-18 21:05       ` Jan Engelhardt
2004-11-18 21:15     ` Chris Friesen
2004-11-18 21:17       ` Jan Engelhardt
2004-11-18 21:29         ` Chris Friesen
2004-11-19 12:02         ` Paulo Marques
2004-11-19 12:05           ` Jan Engelhardt
2004-11-20  2:14           ` Alan Cox
2004-11-22  8:07   ` Helge Hafting
2004-11-22  8:38     ` Jan Engelhardt
2004-11-24 10:23       ` Helge Hafting
2004-11-22 11:17     ` Tomas Carnecky
2004-11-24 10:20       ` Helge Hafting
2004-11-24 11:31         ` Tomas Carnecky
2004-11-28 19:10           ` Helge Hafting
2004-11-19  5:04 ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041122202144.GA12858@in.ibm.com \
    --to=maneesh@in.ibm.com \
    --cc=adam@yggdrasil.com \
    --cc=gjwucherpfennig@gmx.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.