linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.cz>,
	Balbir Singh <bsingharora@gmail.com>,
	Hugh Dickins <hughd@google.com>, Ying Han <yinghan@google.com>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>
Subject: Re: [RFC][PATCH 4/5] memcg: remove PCG_CACHE bit
Date: Thu, 15 Dec 2011 11:24:42 +0100	[thread overview]
Message-ID: <20111215102442.GI3047@cmpxchg.org> (raw)
In-Reply-To: <20111215150822.7b609f89.kamezawa.hiroyu@jp.fujitsu.com>

On Thu, Dec 15, 2011 at 03:08:22PM +0900, KAMEZAWA Hiroyuki wrote:
> >From 577b441ae259728d83a99baba11bf4925b4542d4 Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Thu, 15 Dec 2011 12:09:03 +0900
> Subject: [PATCH 4/5] memcg: remove PCG_CACHE bit.
> 
> This bit can be replaced by PageAnon(page) check.

You need to make sure that only fully rmapped pages are
charged/uncharged, which is not the case yet.  E.g. look at the
newpage_charge() in mm/memory.c::do_anonymous_page() - if the page
table is updated by someone else, that uncharge_page() in the error
path will see !PageAnon() because page->mapping is not set yet and
uncharge it as cache.

What I think is required is to break up the charging and committing
like we do for swap cache already:

	if (!mem_cgroup_try_charge())
		goto error;
	page_add_new_anon_rmap()
	mem_cgroup_commit()

This will also allow us to even get rid of passing around the charge
type everywhere...

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-12-15 10:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  6:00 [Experimental] [PATCH 0/5] page_cgroup->flags diet KAMEZAWA Hiroyuki
2011-12-15  6:05 ` [RFC] [PATCH 1/5] memcg: simplify account moving check KAMEZAWA Hiroyuki
2011-12-15 10:04   ` Johannes Weiner
2011-12-15 10:17     ` KAMEZAWA Hiroyuki
2011-12-15  6:06 ` [RFC][PATCH 2/5] memcg: safer page stat updating KAMEZAWA Hiroyuki
2011-12-15  6:07 ` [RFC][PATCH 3/5] memcg: remove PCG_FILE_MAPPED KAMEZAWA Hiroyuki
2011-12-15  6:08 ` [RFC][PATCH 4/5] memcg: remove PCG_CACHE bit KAMEZAWA Hiroyuki
2011-12-15 10:24   ` Johannes Weiner [this message]
2011-12-15 10:36     ` KAMEZAWA Hiroyuki
2011-12-15 12:04       ` KAMEZAWA Hiroyuki
2011-12-15 14:54         ` Johannes Weiner
2011-12-15  6:10 ` [RFC] [PATCH 5/5] memcg: remove PCG_MOVE_LOCK KAMEZAWA Hiroyuki
2011-12-15  8:44 ` [Experimental] [PATCH 0/5] page_cgroup->flags diet KAMEZAWA Hiroyuki

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=20111215102442.GI3047@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=yinghan@google.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