From: "Michal Koutný" <mkoutny-IBi9RG/b67k@public.gmane.org>
To: "Enrico Weigelt,
metux IT consult" <lkml-EcKl7qYKIbxeoWH0uzbU5w@public.gmane.org>
Cc: Philipp Hahn
<pmhahn+lkml-isSyJ6YaLy+zQB+pC5nmwQ@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Prevent inode/dentry trashing?
Date: Mon, 28 Jun 2021 15:30:40 +0200 [thread overview]
Message-ID: <YNnPAJ4HNoN6g6T9@blackbook> (raw)
In-Reply-To: <88451906-e537-0ac3-b8f2-16bfc4d77ea6-EcKl7qYKIbxeoWH0uzbU5w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]
On Mon, Jun 28, 2021 at 11:40:39AM +0200, "Enrico Weigelt, metux IT consult" <lkml-EcKl7qYKIbxeoWH0uzbU5w@public.gmane.org> wrote:
> Could you please tell a bit more how this really works ?
> (maybe some pointers to the code)
When cgroup's consumption is about to cross the configured limit,
reclaim is started
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/memcontrol.c?id=62fb9874f5da54fdb243003b386128037319b219#n2579
that may evict old entries
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/vmscan.c?id=62fb9874f5da54fdb243003b386128037319b219#n2852
and if there's still no success freeing some space the dentry allocation
can fail
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/slab.h?id=62fb9874f5da54fdb243003b386128037319b219#n277
(This describes just one code path, the subject isn't always a dentry.)
> I'm curios what happens if those cache objects are used by different
> cgroups - are they accounted to multiple times (once per cgroup) ?
> What happens when one cgroup using some cache object reaching its limit,
> wile another one does not ?
That's explained here
https://www.kernel.org/doc/html/v5.13/admin-guide/cgroup-v2.html#memory-ownership
Michal
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-06-28 13:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 12:39 Prevent inode/dentry trashing? Philipp Hahn
[not found] ` <ce330972-78e6-4347-9735-72ee7bb21ef5-isSyJ6YaLy+zQB+pC5nmwQ@public.gmane.org>
2021-06-25 15:55 ` Michal Koutný
2021-06-28 9:40 ` Enrico Weigelt, metux IT consult
[not found] ` <88451906-e537-0ac3-b8f2-16bfc4d77ea6-EcKl7qYKIbxeoWH0uzbU5w@public.gmane.org>
2021-06-28 13:30 ` Michal Koutný [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=YNnPAJ4HNoN6g6T9@blackbook \
--to=mkoutny-ibi9rg/b67k@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lkml-EcKl7qYKIbxeoWH0uzbU5w@public.gmane.org \
--cc=pmhahn+lkml-isSyJ6YaLy+zQB+pC5nmwQ@public.gmane.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