From: Richard Palethorpe <firstname.lastname@example.org> To: "Michal Koutný" <email@example.com> Cc: Roman Gushchin <firstname.lastname@example.org>, email@example.com, Johannes Weiner <firstname.lastname@example.org>, Andrew Morton <email@example.com>, "Shakeel Butt" <firstname.lastname@example.org>, Christoph Lameter <email@example.com>, Michal Hocko <firstname.lastname@example.org>, Tejun Heo <email@example.com>, Vlastimil Babka <firstname.lastname@example.org>, email@example.com, firstname.lastname@example.org Subject: Re: [RFC PATCH] mm: memcg/slab: Stop reparented obj_cgroups from charging root Date: Fri, 16 Oct 2020 16:05:21 +0100 [thread overview] Message-ID: <email@example.com> (raw) In-Reply-To: <firstname.lastname@example.org> Hello, Richard Palethorpe <email@example.com> writes: > Hello Michal, > > Michal Koutný <firstname.lastname@example.org> writes: > >> Hello. >> >> On Wed, Oct 14, 2020 at 08:07:49PM +0100, Richard Palethorpe <email@example.com> wrote: >>> SLAB objects which outlive their memcg are moved to their parent >>> memcg where they may be uncharged. However if they are moved to the >>> root memcg, uncharging will result in negative page counter values as >>> root has no page counters. >> Why do you think those are reparented objects? If those are originally >> charged in a non-root cgroup, then the charge value should be propagated up the >> hierarchy, including root memcg, so if they're later uncharged in root >> after reparenting, it should still break even. (Or did I miss some stock >> imbalance?) > > I traced it and can see they are reparented objects and that the root > groups counters are zero (or negative if I run madvise06 multiple times) > before a drain takes place. I'm guessing this is because the root group > has 'use_hierachy' set to false so that the childs page_counter parents > are set to NULL. However I will check, because I'm not sure about > either. Yes, it appears that use_hierarchy=0 which is probably because the test mounts cgroup v1, creates a child group within that and does not set use_hierarchy on the root. On v2 root always has use_hierarchy enabled. > >> >> (But the patch seems justifiable to me as objects (not)charged directly to >> root memcg may be incorrectly uncharged.) >> >> Thanks, >> Michal I'm don't know if that could happen without reparenting. I suppose if use_hierarchy=1 then actually this patch will result in root being overcharged, so perhaps it should also check for use_hierarchy? -- Thank you, Richard.
next prev parent reply other threads:[~2020-10-16 15:05 UTC|newest] Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-14 19:07 Richard Palethorpe 2020-10-14 20:08 ` Roman Gushchin 2020-10-16 5:40 ` Richard Palethorpe 2020-10-16 9:47 ` Michal Koutný 2020-10-16 10:41 ` Richard Palethorpe 2020-10-16 15:05 ` Richard Palethorpe [this message] 2020-10-16 17:26 ` Michal Koutný 2020-10-16 14:53 ` Johannes Weiner 2020-10-16 17:02 ` Roman Gushchin 2020-10-16 17:15 ` Michal Koutný 2020-10-19 8:45 ` Richard Palethorpe 2020-10-19 9:58 ` [PATCH v3] " Richard Palethorpe 2020-10-19 16:58 ` Shakeel Butt 2020-10-20 5:52 ` Richard Palethorpe 2020-10-20 13:49 ` Richard Palethorpe 2020-10-20 16:56 ` Shakeel Butt 2020-10-21 20:32 ` Roman Gushchin 2020-10-20 17:24 ` Michal Koutný 2020-10-22 7:04 ` Richard Palethorpe 2020-10-22 12:28 ` [PATCH v4] " Richard Palethorpe 2020-10-22 16:37 ` Shakeel Butt 2020-10-22 17:25 ` Roman Gushchin 2020-10-22 23:59 ` Shakeel Butt 2020-10-23 0:40 ` Roman Gushchin 2020-10-23 15:44 ` Johannes Weiner 2020-10-23 16:41 ` Shakeel Butt 2020-10-26 7:32 ` Richard Palethorpe 2020-10-26 23:14 ` Roman Gushchin 2020-10-19 22:28 ` [RFC PATCH] " Roman Gushchin 2020-10-20 6:04 ` Richard Palethorpe 2020-10-20 12:02 ` Richard Palethorpe 2020-10-20 14:48 ` Richard Palethorpe 2020-10-20 16:27 ` Michal Koutný 2020-10-20 17:07 ` Roman Gushchin 2020-10-20 18:18 ` Johannes Weiner 2020-10-21 19:33 ` Roman Gushchin 2020-10-23 16:30 ` Johannes Weiner 2020-11-10 1:27 ` Roman Gushchin 2020-11-10 15:11 ` Shakeel Butt 2020-11-10 19:13 ` Roman Gushchin 2020-11-20 17:46 ` Michal Koutný 2020-11-03 13:22 ` Michal Hocko 2020-11-03 21:30 ` Roman Gushchin 2020-10-20 16:55 ` Shakeel Butt 2020-10-20 17:17 ` 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 \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [RFC PATCH] mm: memcg/slab: Stop reparented obj_cgroups from charging root' \ /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
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).