linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: UZAIR LAKHANI <uzairr_bs1b@yahoo.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: How long can an inode structure reside in the inode_cache?
Date: Sun, 11 Jun 2006 15:35:19 +1000	[thread overview]
Message-ID: <17547.43927.481788.53647@cse.unsw.edu.au> (raw)
In-Reply-To: message from UZAIR LAKHANI on Saturday June 10

On Saturday June 10, uzairr_bs1b@yahoo.com wrote:
> 
> Hello All,
> 
> Continuing the above discusssion I want to ask one
> question. If a file system allocated new inodes using
> new_inode() then after this uses d_add or
> d_instantiate to attach this inode to a dentry, then
> what will happen when we get short of memory.

 Maybe you should spend a week reading the code?  It can be a lot of
fun, and you might even find a bug or two...

 Each dentry hold a reference on it's parent, and on it's inode.
Neither a dentry nor an inode can be freed when anyone holds a
reference on it.

 From this it is fairly easy to deduce that the first things to go
when there is memory pressure are the leaf dentries.  Once these are
gone, the inodes they referred to, and the parents of the dentries
will become available for being discarded.

NeilBrown


> 
> In other words since new_inode() alolocates the memory
> for the inode in the inode cache and since we are
> getting short of memory so we can loose this inode but
> we already have attached this inode with a dentry.
> Then how the kernel will get the inode for this dentry
> since we already have loose the inode for this dentry.
> 
> Similarly the file system allocates the memory for
> dentries using d_alloc; is this can also create
> problems like for the inodes.
> 
> Thanks,
> Uzair Lakhani,
> Karachi, Pakistan.

  reply	other threads:[~2006-06-11  5:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-10  0:10 How long can an inode structure reside in the inode_cache? Xin Zhao
2006-06-10 12:13 ` Matthew Wilcox
2006-06-10 17:12   ` Xin Zhao
2006-06-10 19:01     ` Jeff Mahoney
2006-06-11  5:21       ` UZAIR LAKHANI
2006-06-11  5:35         ` Neil Brown [this message]
2006-06-12 18:20           ` How long can an inode structure reside in the inode_cache? - read the code Bryan Henderson
2006-06-12 23:28             ` Neil Brown
2006-06-13 23:25               ` Nate Diller
2006-07-05  0:41                 ` Andrew Morton

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=17547.43927.481788.53647@cse.unsw.edu.au \
    --to=neilb@suse.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=uzairr_bs1b@yahoo.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).