linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@parallels.com>
To: Greg Thelen <gthelen@google.com>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
	kamezawa.hiroyu@jp.fujitsu.com,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH v2] memcg: execute partial memcg freeing in mem_cgroup_destroy
Date: Tue, 21 Aug 2012 17:34:44 +0400	[thread overview]
Message-ID: <50338E74.9020507@parallels.com> (raw)
In-Reply-To: <xr93a9xu9g7z.fsf@gthelen.mtv.corp.google.com>

On 08/17/2012 10:37 AM, Greg Thelen wrote:
>> >
>> > Can we demonstrate that? I agree there might be a potential problem, and
>> > that is why I sent this separately. But the impression I got after
>> > testing and reading the code, was that the memcg information in
>> > pc->mem_cgroup would be updated to the parent.
>> >
>> > This means that any later call to uncharge or uncharge_swap would just
>> > uncharge from the parent memcg and we'd have no problem.
> I am by no means a swap expert, so I may be heading in the weeds.  But I
> think that a swapped out page is not necessarily in any memcg lru.  So
> the mem_cgroup_pre_destroy() call to mem_cgroup_force_empty() will not
> necessarily see swapped out pages.
> 
> I think this demonstrates the problem.

Ok, thanks Greg.
This seem to happen solely because we use the css_id in swap_cgroup
structure, and that needs to stay around. If we stored the memcg address
instead, we'd have no such problem. (I believe so atm, still need to go
dig deeper)

But this would lead to a 4 times bigger memory usage for that. Quite a
waste considering this tend to be sparsely used most of the time.






--
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>

      parent reply	other threads:[~2012-08-21 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-16 11:01 Glauber Costa
2012-08-17  4:51 ` Greg Thelen
2012-08-17  4:51   ` Glauber Costa
2012-08-17  6:37     ` Greg Thelen
2012-08-17  6:36       ` Glauber Costa
2012-08-21 13:34       ` Glauber Costa [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=50338E74.9020507@parallels.com \
    --to=glommer@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /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