linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Hiroyuki Kamezawa <kamezawa.hiroyuki@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"nishimura@mxp.nes.nec.co.jp" <nishimura@mxp.nes.nec.co.jp>,
	"bsingharora@gmail.com" <bsingharora@gmail.com>,
	Ying Han <yinghan@google.com>,
	"hannes@cmpxchg.org" <hannes@cmpxchg.org>
Subject: Re: [PATCH 7/7] memcg: proportional fair vicitm node selection
Date: Thu, 23 Jun 2011 16:30:05 +0200	[thread overview]
Message-ID: <20110623143005.GL31593@tiehlicka.suse.cz> (raw)
In-Reply-To: <BANLkTin0zMftnK2a+ex07JNdbwvEMCjXXQ@mail.gmail.com>

On Thu 23-06-11 23:10:11, Hiroyuki Kamezawa wrote:
> 2011/6/23 Michal Hocko <mhocko@suse.cz>:
> > On Thu 16-06-11 12:57:41, KAMEZAWA Hiroyuki wrote:
> >> From 4fbd49697456c227c86f1d5b46f2cd2169bf1c5b Mon Sep 17 00:00:00 2001
> >> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> >> Date: Thu, 16 Jun 2011 11:25:23 +0900
> >> Subject: [PATCH 7/7] memcg: proportional fair node vicitm selection
> >>
> >> commit 889976 implements a round-robin scan of numa nodes for
> >> LRU scanning of memcg at hitting limit.
> >> But, round-robin is not very good.
> >>
> >> This patch implements a proportionally fair victim selection of nodes
> >> rather than round-robin. The logic is fair against each node's weight.
> >>
> >> Each node's weight is calculated periodically and we build an node's
> >> scheduling entity as
> >>
> >>      total_ticket = 0;
> >>      for_each_node(node)
> >>       node->ticket_start =  total_ticket;
> >>         node->ticket_end   =  total_ticket + this_node's_weight()
> >>         total_ticket = node->ticket_end;
> >>
> >> Then, each nodes has some amounts of tickets in proportion to its own weight.
> >>
> >> At selecting victim, a random number is selected and the node which contains
> >> the random number in [ticket_start, ticket_end) is selected as vicitm.
> >> This is a lottery scheduling algorithm.
> >>
> >> For quick search of victim, this patch uses bsearch().
> >>
> >> Test result:
> >>   on 8cpu box with 2 nodes.
> >>   limit memory to be 300MB and run httpd for 4096files/600MB working set.
> >>   do (normalized) random access by apache-bench and see scan_stat.
> >>   The test makes 40960 request. and see scan_stat.
> >>   (Because a httpd thread just use 10% cpu, the number of threads will
> >>    not be balanced between nodes. Then, file caches will not be balanced
> >>    between nodes.)
> >
> > Have you also tried to test with balanced nodes? I mean, is there any
> > measurable overhead?
> >
> 
> Not enough yet. I checked OOM trouble this week :).
> 
> I may need to make another fake_numa setup + cpuset
> to measurements. 

What if you just use NUMA rotor for page cache?

> In usual path, new overhead is random32() and
> bsearch().  I'll do some.
> 
> Thanks,
> -Kame

-- 
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9    
Czech Republic

--
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-06-23 14:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  3:47 [PATCH 0/7] memcg numa node scan update KAMEZAWA Hiroyuki
2011-06-16  3:51 ` [PATCH 1/7] Fix mem_cgroup_hierarchical_reclaim() to do stable hierarchy walk KAMEZAWA Hiroyuki
2011-06-22 15:15   ` Michal Hocko
2011-06-22 18:33     ` Michal Hocko
2011-06-23  6:21       ` KAMEZAWA Hiroyuki
2011-06-16  3:52 ` [PATCH 2/7] export memory cgroup's swappines by mem_cgroup_swappiness() KAMEZAWA Hiroyuki
2011-06-22 15:22   ` Michal Hocko
2011-06-22 16:31     ` Ying Han
2011-06-16  3:53 ` [PATCH 3/7] memcg: add memory.scan_stat KAMEZAWA Hiroyuki
2011-06-17 22:04   ` Ying Han
2011-06-19 23:41     ` KAMEZAWA Hiroyuki
2011-06-20  4:02       ` KAMEZAWA Hiroyuki
2011-06-20  6:59         ` Ying Han
2011-06-21  6:49   ` Ying Han
2011-06-21  6:52     ` Ying Han
2011-06-22  0:20     ` KAMEZAWA Hiroyuki
2011-06-24 21:40       ` Ying Han
2011-06-27  1:49         ` KAMEZAWA Hiroyuki
2011-06-16  3:54 ` [PATCH 4/7] memcg: update numa information based on event counter KAMEZAWA Hiroyuki
2011-06-22 15:53   ` Michal Hocko
2011-06-23  6:27     ` KAMEZAWA Hiroyuki
2011-06-23  8:12       ` Michal Hocko
2011-06-16  3:54 ` [PATCH 5/7] Fix not good check of mem_cgroup_local_usage() KAMEZAWA Hiroyuki
2011-06-17 22:27   ` Ying Han
2011-06-19 23:44     ` KAMEZAWA Hiroyuki
2011-06-22 15:58   ` Michal Hocko
2011-06-16  3:56 ` [PATCH 6/7] memcg: calc NUMA node's weight for scan KAMEZAWA Hiroyuki
2011-06-23 13:35   ` Michal Hocko
2011-06-23 14:27     ` Hiroyuki Kamezawa
2011-06-16  3:57 ` [PATCH 7/7] memcg: proportional fair vicitm node selection KAMEZAWA Hiroyuki
2011-06-23 13:48   ` Michal Hocko
2011-06-23 14:10     ` Hiroyuki Kamezawa
2011-06-23 14:30       ` Michal Hocko [this message]
2011-06-23 22:20         ` Hiroyuki Kamezawa

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=20110623143005.GL31593@tiehlicka.suse.cz \
    --to=mhocko@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=bsingharora@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kamezawa.hiroyuki@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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