From: Vasily Averin <vvs@openvz.org>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>,
tj@kernel.org, gregkh@linuxfoundation.org, hannes@cmpxchg.org,
kernel@openvz.org, linux-kernel@vger.kernel.org, mhocko@suse.com,
shakeelb@google.com, songmuchun@bytedance.com,
viro@zeniv.linux.org.uk, Christian Brauner <brauner@kernel.org>
Subject: Re: [RFC PATCH] memcg: adjust memcg used to charge for new simple_xattrs objects
Date: Tue, 23 Aug 2022 11:17:01 +0300 [thread overview]
Message-ID: <fba5dccb-2549-30fe-5d65-8668aebd3811@openvz.org> (raw)
In-Reply-To: <20220818122743.GB19175@blackbody.suse.cz>
On 8/18/22 15:27, Michal Koutný wrote:
> On Thu, Aug 18, 2022 at 12:10:45PM +0300, Vasily Averin <vvs@openvz.org> wrote:
>> sys_set[f]xattr uses simple_xattr infrastructure to create a new
>> extended attribute for in-memory file systems like sysfs and tmpfs.
>> Number and size of allocated objects are controlled by user space,
>> they are always living in memory and its lifetime is indefinitely long.
>> Therefore this memory should be properly accounted.
>>
>> By default new memory is accounted to memcg of creator process.
>
> despite objects aren't bound to this process lifetime.
>
> (I think this was the main argument for this approach and should be in
> the commit message then.)
Thank you for the remark, I'll update patch description in the next version
>> As a result, neighboring xattrs of the same inode can be charged to
>> different memcgs. This looks unexpected and makes hard the
>> investigation of the memcg accounting issues.
>>
>> This patch adjust memcg used for such allocations. For kernfs
>> it gives memcg from kernfs node, for shmem -- from shmem_info.
>> This allows to cahrge all inode-sepcific objects to the same
>> memory cgroup.
>
> IIUC you intend to inherit association from shmem_inode_info (i.e.
> whoever created the inode). shmem_inode_cachep has SLAB_ACCOUNT, so it's valid.
Yes, you are right, I'll clarify this in next patch version.
Thank you,
Vasily Averin
next prev parent reply other threads:[~2022-08-23 8:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-31 15:37 [PATCH 0/3] enable memcg accounting for kernfs objects Vasily Averin
2022-08-09 17:31 ` Tejun Heo
2022-08-09 17:49 ` Michal Koutný
2022-08-09 17:56 ` Tejun Heo
2022-08-11 3:19 ` Vasily Averin
2022-08-11 4:58 ` [RFC PATCH] kernfs: enable per-inode limits for all xattr types Vasily Averin
2022-08-12 10:20 ` Christian Brauner
2022-08-13 4:16 ` Vasily Averin
2022-08-16 7:47 ` [PATCH 0/3] enable memcg accounting for kernfs objects Vasily Averin
2022-08-17 7:42 ` [RFC PATCH] memcg: adjust memcg for new cgroup allocations Vasily Averin
2022-08-17 9:17 ` Michal Koutný
2022-08-17 15:02 ` Vasily Averin
2022-08-17 16:41 ` Tejun Heo
2022-08-23 12:04 ` Vasily Averin
2022-08-23 16:22 ` Tejun Heo
2022-08-18 9:10 ` [RFC PATCH] memcg: adjust memcg used to charge for new simple_xattrs objects Vasily Averin
2022-08-18 12:27 ` Michal Koutný
2022-08-23 8:17 ` Vasily Averin [this message]
2022-08-18 9:12 ` [RFC PATCH] simple_xattr: switch from list to rb_tree Vasily Averin
2022-08-18 13:19 ` Christian Brauner
2022-08-23 10:42 ` Vasily Averin
2022-08-09 21:25 ` [PATCH 0/3] enable memcg accounting for kernfs objects Roman Gushchin
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=fba5dccb-2549-30fe-5d65-8668aebd3811@openvz.org \
--to=vvs@openvz.org \
--cc=brauner@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=kernel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=mkoutny@suse.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.com \
--cc=songmuchun@bytedance.com \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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