All of lore.kernel.org
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"balbir@linux.vnet.ibm.com" <balbir@linux.vnet.ibm.com>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	stable@kernel.org
Subject: [PATCH 1/3] memcg: fix account leak at failure of memsw acconting.
Date: Tue, 25 Jan 2011 15:00:42 +0900	[thread overview]
Message-ID: <20110125150042.fa7a9a9a.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <20110125145720.cd0cbe16.kamezawa.hiroyu@jp.fujitsu.com>

This is required for 2.6.36-stable and later.
==
Commit 4b53433468c87794b523e4683fbd4e8e8aca1f63 removes
a cancel of charge at case: 
memory charge-> success.
mem+swap charge-> failure.

This leaks usage of memory. Fix it.

This patch is required for stable tree since 2.6.36.

CC: stable@kernel.org
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
 mm/memcontrol.c |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.38-rc2/mm/memcontrol.c
===================================================================
--- linux-2.6.38-rc2.orig/mm/memcontrol.c
+++ linux-2.6.38-rc2/mm/memcontrol.c
@@ -1832,6 +1832,7 @@ static int __mem_cgroup_do_charge(struct
 		if (likely(!ret))
 			return CHARGE_OK;
 
+		res_counter_uncharge(&mem->res, csize);
 		mem_over_limit = mem_cgroup_from_res_counter(fail_res, memsw);
 		flags |= MEM_CGROUP_RECLAIM_NOSWAP;
 	} else


  reply	other threads:[~2011-01-25  6:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25  5:57 [PATCH 0/3] 3 bugfixes for memory cgroup (2.6.38-rc2) KAMEZAWA Hiroyuki
2011-01-25  5:57 ` KAMEZAWA Hiroyuki
2011-01-25  6:00 ` KAMEZAWA Hiroyuki [this message]
2011-01-25  7:07   ` [PATCH 1/3] memcg: fix account leak at failure of memsw acconting Johannes Weiner
2011-01-25  8:31   ` Daisuke Nishimura
2011-01-25  6:01 ` [PATCH 2/3] memcg: bugfix check mem_cgroup_disabled() at split fixup KAMEZAWA Hiroyuki
2011-01-25  6:01   ` KAMEZAWA Hiroyuki
2011-01-25  6:05 ` [PATCH 3/3] memcg: fix race at move_parent around compound_order() KAMEZAWA Hiroyuki
2011-01-25  6:05   ` KAMEZAWA Hiroyuki
2011-01-25  7:07   ` Johannes Weiner
2011-01-25  7:07     ` Johannes Weiner
2011-01-25  8:31   ` Daisuke Nishimura
2011-01-25  8:31     ` Daisuke Nishimura

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=20110125150042.fa7a9a9a.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.