linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: linux-mm@kvack.org
Cc: Balbir Singh <bsingharora@gmail.com>,
	Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] memcg: cleanup per-cpu charge caches + fix unnecessary reclaim if there are still cached charges
Date: Thu, 21 Jul 2011 11:41:40 +0200	[thread overview]
Message-ID: <cover.1311241300.git.mhocko@suse.cz> (raw)

Hi,
this patchset cleans up per-cpu charge cache draining code and it fixes
an issue where we could reclaim from a group even though there are
caches with charges on other CPUs that can be used. Although the problem
is far from being critical it can bite us on large machines with many
CPUs.
I am sorry that I am mixing those two things but the fix depends on the
work done in the clean up patches so I hope it won't be confusing.
The reason is that I needed a sane implementation of sync draining code
and wanted to prevent from code duplication.

First two patches should be quite straightforward. Checking
stock->nr_pages is more general than excluding just the local CPU and
having targeted sync draining also makes a good sense to me.

The third one might require some discussion. AFAIU it should be safe but
others might see some issues. Anyway I have no issues to drop it because
the fix doesn't depend on it. I have put it before the fix just because
I wanted to have all cleanups in front.

Finally the fourth patch is the already mentioned fix. I do not think
I have ever seen any sane application (aka not artificially created
usecase) where we would trigger the behavior in a such way that the
performance would hurt or something similar but I have already seen a
pointless reclaim while we had caches on other CPUs. As the number of
CPUs grow I think the change makes quite a good sense.

The patchset is on top of the current Linus tree but it should apply on
top of the current mmotm tree as well.

Any thoughts comments?

Michal Hocko (4):
  memcg: do not try to drain per-cpu caches without pages
  memcg: unify sync and async per-cpu charge cache draining
  memcg: get rid of percpu_charge_mutex lock
  memcg: prevent from reclaiming if there are per-cpu cached charges

 mm/memcontrol.c |   73 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 41 insertions(+), 32 deletions(-)

-- 
1.7.5.4

--
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-07-21  9:46 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21  9:41 Michal Hocko [this message]
2011-07-21  7:38 ` [PATCH 1/4] memcg: do not try to drain per-cpu caches without pages Michal Hocko
2011-07-21 10:12   ` KAMEZAWA Hiroyuki
2011-07-21 11:36     ` Michal Hocko
2011-07-21 23:44       ` KAMEZAWA Hiroyuki
2011-07-22  9:19         ` Michal Hocko
2011-07-22  9:28           ` KAMEZAWA Hiroyuki
2011-07-22  9:58             ` Michal Hocko
2011-07-22 10:23               ` Michal Hocko
2011-07-21  7:50 ` [PATCH 2/4] memcg: unify sync and async per-cpu charge cache draining Michal Hocko
2011-07-21 10:25   ` KAMEZAWA Hiroyuki
2011-07-21 11:36     ` Michal Hocko
2011-07-21  7:58 ` [PATCH 3/4] memcg: get rid of percpu_charge_mutex lock Michal Hocko
2011-07-21 10:30   ` KAMEZAWA Hiroyuki
2011-07-21 11:47     ` Michal Hocko
2011-07-21 12:42       ` Michal Hocko
2011-07-21 23:49         ` KAMEZAWA Hiroyuki
2011-07-22  9:21           ` Michal Hocko
2011-07-22  0:27         ` Daisuke Nishimura
2011-07-22  9:41           ` Michal Hocko
2011-07-21  8:28 ` [PATCH 4/4] memcg: prevent from reclaiming if there are per-cpu cached charges Michal Hocko
2011-07-21 10:54   ` KAMEZAWA Hiroyuki
2011-07-21 12:30     ` Michal Hocko
2011-07-21 23:56       ` KAMEZAWA Hiroyuki
2011-07-22  0:18         ` KAMEZAWA Hiroyuki
2011-07-22  9:54         ` Michal Hocko

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=cover.1311241300.git.mhocko@suse.cz \
    --to=mhocko@suse.cz \
    --cc=bsingharora@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nishimura@mxp.nes.nec.co.jp \
    /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;
as well as URLs for NNTP newsgroup(s).