linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <zhengfeiran@bytedance.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: "Fam Zheng" <zhengfeiran@bytedance.com>,
	cgroups@vger.kernel.org, "Linux MM" <linux-mm@kvack.org>,
	tj@kernel.org, "Johannes Weiner" <hannes@cmpxchg.org>,
	lizefan@huawei.com, "Vladimir Davydov" <vdavydov.dev@gmail.com>,
	duanxiongchun@bytedance.com, 张永肃 <zhangyongsu@bytedance.com>
Subject: Re: memory cgroup pagecache and inode problem
Date: Fri, 4 Jan 2019 18:35:35 +0800	[thread overview]
Message-ID: <6EBEAC88-6309-4D8F-97CA-78DC1C9AF3AC@bytedance.com> (raw)
In-Reply-To: <20190104101216.GM31793@dhcp22.suse.cz>



> On Jan 4, 2019, at 18:12, Michal Hocko <mhocko@kernel.org> wrote:
> 
> On Fri 04-01-19 18:02:19, Fam Zheng wrote:
>> 
>> 
>>> On Jan 4, 2019, at 17:04, Michal Hocko <mhocko@kernel.org> wrote:
>>> 
>>> This is a natural side effect of shared memory, I am afraid. Isolated
>>> memory cgroups should limit any shared resources to bare minimum. You
>>> will get "who touches first gets charged" behavior otherwise and that is
>>> not really deterministic.
>> 
>> I don’t quite understand your comment. I think the current behavior
>> for the ext4_inode_cachep slab family is just “who touches first
>> gets charged”, and later users of the same file from a different mem
>> cgroup can benefit from the cache, keep it from being released, but
>> doesn’t get charged.
> 
> Yes, this is exactly what I've said. And that leads to non-deterministic
> behavior because users from other memcgs are keeping charges alive and
> the isolation really doesn't work properly. Think of it as using memory
> on behalf of other party that is supposed to be isolated from you.
> 
> Sure this can work reasonably well if the sharing is not really
> predominated.

OK, I see what you mean. The reality is that the applications want to share files (e.g. docker run -v ...) , and IMO charging accuracy is not the trouble here. The problem is that there are memory usages which are not strictly necessary once a mem cgroup is deleted, such as the biggish struct mem_cgroup and the shadow slabs from which we no longer alloc new objects.

Fam

> -- 
> Michal Hocko
> SUSE Labs

      reply	other threads:[~2019-01-04 10:35 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15614FDC-198E-449B-BFAF-B00D6EF61155@bytedance.com>
2019-01-04  4:44 ` Fam Zheng
2019-01-04  5:00   ` Yang Shi
2019-01-04  5:12     ` Fam Zheng
2019-01-04 19:36       ` Yang Shi
2019-01-07  5:10         ` Fam Zheng
2019-01-07  8:53           ` Michal Hocko
2019-01-07  9:01             ` Fam Zheng
2019-01-07  9:13               ` Michal Hocko
2019-01-09  4:33               ` Fam Zheng
2019-01-10  5:36           ` Yang Shi
2019-01-10  8:30             ` Fam Zheng
2019-01-10  8:41               ` Michal Hocko
2019-01-16  0:50               ` Yang Shi
2019-01-16  3:52                 ` Fam Zheng
2019-01-16  7:06                   ` Michal Hocko
2019-01-16 21:08                     ` Yang Shi
2019-01-16 21:06                   ` Yang Shi
2019-01-17  2:41                     ` Fam Zheng
2019-01-17  5:06                       ` Yang Shi
2019-01-19  3:17                         ` 段熊春
2019-01-20 23:15                         ` Shakeel Butt
2019-01-20 23:15                           ` Shakeel Butt
2019-01-20 23:20                           ` Shakeel Butt
2019-01-21 10:27                           ` Michal Hocko
2019-01-04  9:04 ` Michal Hocko
2019-01-04 10:02   ` Fam Zheng
2019-01-04 10:12     ` Michal Hocko
2019-01-04 10:35       ` Fam Zheng [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=6EBEAC88-6309-4D8F-97CA-78DC1C9AF3AC@bytedance.com \
    --to=zhengfeiran@bytedance.com \
    --cc=cgroups@vger.kernel.org \
    --cc=duanxiongchun@bytedance.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@kernel.org \
    --cc=tj@kernel.org \
    --cc=vdavydov.dev@gmail.com \
    --cc=zhangyongsu@bytedance.com \
    /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