From: Al Viro <viro@zeniv.linux.org.uk>
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 20:38:48 +0100 [thread overview]
Message-ID: <20191002193848.GE26530@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CA+i3KrYpvd4X7uD_GMAp8UZMbR_DhmWvgzw2bHuSQ7iBvpsJQg@mail.gmail.com>
On Wed, Oct 02, 2019 at 05:30:21PM +0900, Daegyu Han wrote:
> Hi linux file system experts,
>
> I'm so sorry that I've asked again the general question about Linux
> file systems.
>
> For example, if there is a file a.txt in the path /foo/ bar,
> what should I do to completely evict(remove) the inode of bar
> directory from memory and read the inode via disk access?
>
> A few weeks ago. I asked a question about dentry and Ted told me that
> there is a negative dentry on Linux.
>
> I tried to completely evict(remove) the dentry cache using FS API in
> include/fs.h and dcache.h, and also evict the inode from memory, but I
> failed.
>
> The FS API I used is:
> dput() // to drop usage count and remove from dentry cache
> iput() // to drop usage count and remove from inode cache.
>
> To be honest, I'm confused about which API to cope with my question.
>
> As far as I know, even though metadata is released from the file
> system cache, it is managed as an LRU list.
>
> I also saw some code related to CPU cacheline.
> When I look at the superblock structure, there are also inodes, dcache
> lists, and LRUs.
>
> How can I completely evict the inode from memory and make disk access
> as mentioned above?
In general you simply can't. Not if there is anyone who'd opened the file
in question. As long as the sucker is opened, struct inode *WILL* remain
in memory.
What are you trying to achieve?
prev parent reply other threads:[~2019-10-02 19:38 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
2019-10-03 1:42 ` Daegyu Han
2019-10-02 19:38 ` Al Viro [this message]
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=20191002193848.GE26530@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--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.