From: wang Yu <yuwang668899@gmail.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>, Tejun Heo <tj@kernel.org>,
cgroups@vger.kernel.org, linux-mm@kvack.org
Subject: Re: memcg Can't context between v1 and v2 because css->refcnt not released
Date: Thu, 10 Aug 2017 16:10:45 +0800 [thread overview]
Message-ID: <CADK2BfwC3WDGwoDPSjX1UpwP-4fDz5fSBjdENbxn5XQL8y3K3A@mail.gmail.com> (raw)
In-Reply-To: <20170810071059.GC23863@dhcp22.suse.cz>
at first ,thanks for your reply.
but i also tested what you said, the problem is also.
force_empty only call try_to_free_pages, not all the pages remove
because mem_cgroup_reparent_charges moved
#cd /sys/fs/cgroup/memory
#mkdir a
#echo 0 > a/cgroup.procs
#sleep 1
#echo 0 > a/cgroup.procs
#echo 1 > a/memory.force_empty
#rmdir a
#cat /proc/cgroups
#subsys_name hierarchy num_cgroups enabled
memory 2 2 1
the num_cgroups also not released
2017-08-10 15:10 GMT+08:00 Michal Hocko <mhocko@kernel.org>:
> On Wed 09-08-17 15:06:34, wang Yu wrote:
>> Hello Johannes ,Michal,and Tejun:
>>
>> i using memcg v1, but some reason i want to context to memcg v2,
>> but i can't, here is my step:
>> #cat /proc/cgroups
>> #subsys_name hierarchy num_cgroups enabled
>> memory 5 1 1
>> #cd /sys/fs/cgroup/memory
>> #mkdir a
>> #echo 0 > a/cgroup.procs
>> #sleep 1
>> #echo 0 > cgroup.procs
>
> This doesn't do what you think. It will try to add a non-existant pid 0
> to the root cgroup. You need to remove cgroup a. Moreover it is possible
> that the `sleep' command will fault some page cache and that will stay
> in memcg `a' until there is a memory pressure. cgroup v1 had
> force_empty knob which you can use to drain the cgroup before removal.
> Then you should be able to umount the v1 cgroup and mount v2.
> --
> Michal Hocko
> SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-08-10 8:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 7:06 wang Yu
2017-08-10 7:10 ` Michal Hocko
2017-08-10 8:10 ` wang Yu [this message]
2017-08-10 8:19 ` Michal Hocko
2017-08-10 8:26 ` wang Yu
2017-08-10 9:28 ` wang Yu
[not found] ` <CADK2Bfwxp3gSDrYXAxhgoYne2T=1_RyPXqQt_cGHz86dfWgsqg@mail.gmail.com>
2017-08-10 10:34 ` Michal Hocko
2017-08-21 13:08 ` Johannes Weiner
-- strict thread matches above, loose matches on Subject: below --
2017-08-09 6:44 喻望
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=CADK2BfwC3WDGwoDPSjX1UpwP-4fDz5fSBjdENbxn5XQL8y3K3A@mail.gmail.com \
--to=yuwang668899@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=tj@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