linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Hahn <pmhahn+lkml@pmhahn.de>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>
Subject: Prevent inode/dentry trashing?
Date: Mon, 7 Jun 2021 14:39:35 +0200	[thread overview]
Message-ID: <ce330972-78e6-4347-9735-72ee7bb21ef5@pmhahn.de> (raw)

Hello,

Similar to 
<https://unix.stackexchange.com/questions/202586/limit-the-inode-cache-used-by-a-command> 
I would like to prevent certain programs from trashing the inode/dentry 
cache, which is a shared resource for all processes:

- For example the nightly <man:updatedb(8)> used <man:find(1) > to 
recursively walk the complete file system. As long as `d_name` and the 
`d_type` information from <man:readdir(3)> is enough this only pollutes 
the dentry cache.

- Similar our backup software, but this also needs to <man:stat(2)> each 
path to get the `mtime`, which additionally pollutes the inode cache.

Both examples only walk the tree once (per day). In my case the caches 
do not fit into memory completely, so the second process does not even 
benefit from the first process filling the cache as that data is already 
replaced again.

The trashed caches affect all other processes running in parallel or the 
first processes started each morning.

Is it possible to prevent inode/dentry trashing for example by limiting 
the cache per process(-group)?
Something like MADV_DONTNEED from <man:madvise(2)> for IO would be nice.

An external knob to limit the cache usage per process(-group) would be 
nice, but even a hint for an API for such kind of programs to prevent 
trashing would help me.

Thank you in advance.
Philipp

             reply	other threads:[~2021-06-07 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 12:39 Philipp Hahn [this message]
2021-06-25 15:55 ` Prevent inode/dentry trashing? Michal Koutný
2021-06-28  9:40   ` Enrico Weigelt, metux IT consult
2021-06-28 13:30     ` Michal Koutný

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=ce330972-78e6-4347-9735-72ee7bb21ef5@pmhahn.de \
    --to=pmhahn+lkml@pmhahn.de \
    --cc=cgroups@vger.kernel.org \
    --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 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).