All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Daegyu Han <dgswsk@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: How can I completely evict(remove) the inode from memory and access the disk next time?
Date: Wed, 2 Oct 2019 15:39:53 -0400	[thread overview]
Message-ID: <20191002193953.GA777@mit.edu> (raw)
In-Reply-To: <CA+i3KrYvp1pXbpCb_WJDCRx0COU2KCFT_Nfsgcn1mLGrVzErvA@mail.gmail.com>

On Wed, Oct 02, 2019 at 11:42:47PM +0900, Daegyu Han wrote:
> Thank you for your consideration.
> 
> Okay, I will check ocfs2 out.
> 
> By the way, is there any possibility to implement this functionality
> in the vfs layer?
> 
> I looked at the dcache.c, inode.c, and mm/vmscan.c code and looked at
> several functions,
> and as you said, they seem to have way complex logic.
> 
> The logic I thought was to release the desired dentry, dentry_kill()
> the negative dentry, and break the inodes of the file that had that
> dentry.

The short version is that objects have dependencies on other objects.
For example, a file descriptor object has a reference to the dentry of
the file which is open.  A file dentry or directory dentry object
references its parent directory's dentry object, etc.  You can not
evict an object when other objects have references on it --- otherwise
those references become dangling pointers, Which Would Be Bad.

There are solutions for remote file systems (network, clustered, and
shared disk file systems).  So the VFS layer can support these file
systems quite well.  Look at ceph, nfs, ofs2, and gfs for examples for
that.  But it's *complicated* because doing it in a way which is
highly performant, both for remote file systems, and as well as
supporting high-performance local disk file systems, is a lot more
than your very simple-minded, "just kill the dentry/inode structures
and reread them from disk".

Are you trying to do this for a university class project or some such?
If so, we're not here to do your homework for you.  If you want a
practical solution, please use an existing shared-disk or networked
file system.

Best regards,

					- Ted

  parent reply	other threads:[~2019-10-02 19:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  8:30 How can I completely evict(remove) the inode from memory and access the disk next time? Daegyu Han
2019-10-02 12:46 ` Theodore Y. Ts'o
2019-10-02 14:42   ` Daegyu Han
2019-10-02 19:18     ` Eric W. Biederman
2019-10-02 19:39     ` Theodore Y. Ts'o [this message]
2019-10-03  1:42       ` Daegyu Han
2019-10-02 19:38 ` Al Viro

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=20191002193953.GA777@mit.edu \
    --to=tytso@mit.edu \
    --cc=dgswsk@gmail.com \
    --cc=linux-fsdevel@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.