From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with ESMTP id 25B67900086 for ; Mon, 18 Apr 2011 13:11:17 -0400 (EDT) Received: from hpaq11.eem.corp.google.com (hpaq11.eem.corp.google.com [172.25.149.11]) by smtp-out.google.com with ESMTP id p3IHB6qo002225 for ; Mon, 18 Apr 2011 10:11:06 -0700 Received: from qwi2 (qwi2.prod.google.com [10.241.195.2]) by hpaq11.eem.corp.google.com with ESMTP id p3IH8QuB029455 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 18 Apr 2011 10:11:01 -0700 Received: by qwi2 with SMTP id 2so4157308qwi.22 for ; Mon, 18 Apr 2011 10:11:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <1302909815-4362-1-git-send-email-yinghan@google.com> <1302909815-4362-6-git-send-email-yinghan@google.com> Date: Mon, 18 Apr 2011 10:11:00 -0700 Message-ID: Subject: Re: [PATCH V5 05/10] Implement the select_victim_node within memcg. From: Ying Han Content-Type: multipart/alternative; boundary=000e0cd68ee0c9fc3604a13479ff Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: KOSAKI Motohiro , Daisuke Nishimura , Balbir Singh , Tejun Heo , Pavel Emelyanov , KAMEZAWA Hiroyuki , Andrew Morton , Li Zefan , Mel Gorman , Christoph Lameter , Johannes Weiner , Rik van Riel , Hugh Dickins , Michal Hocko , Dave Hansen , Zhu Yanhai , linux-mm@kvack.org --000e0cd68ee0c9fc3604a13479ff Content-Type: text/plain; charset=ISO-8859-1 On Sun, Apr 17, 2011 at 7:22 PM, Minchan Kim wrote: > On Sat, Apr 16, 2011 at 8:23 AM, Ying Han wrote: > > This add the mechanism for background reclaim which we remember the > > last scanned node and always starting from the next one each time. > > The simple round-robin fasion provide the fairness between nodes for > > each memcg. > > > > changelog v5..v4: > > 1. initialize the last_scanned_node to MAX_NUMNODES. > > > > changelog v4..v3: > > 1. split off from the per-memcg background reclaim patch. > > > > Signed-off-by: Ying Han > > --- > > include/linux/memcontrol.h | 3 +++ > > mm/memcontrol.c | 35 +++++++++++++++++++++++++++++++++++ > > 2 files changed, 38 insertions(+), 0 deletions(-) > > > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > index f7ffd1f..d4ff7f2 100644 > > --- a/include/linux/memcontrol.h > > +++ b/include/linux/memcontrol.h > > @@ -88,6 +88,9 @@ extern int mem_cgroup_init_kswapd(struct mem_cgroup > *mem, > > struct kswapd *kswapd_p); > > extern void mem_cgroup_clear_kswapd(struct mem_cgroup *mem); > > extern wait_queue_head_t *mem_cgroup_kswapd_wait(struct mem_cgroup > *mem); > > +extern int mem_cgroup_last_scanned_node(struct mem_cgroup *mem); > > +extern int mem_cgroup_select_victim_node(struct mem_cgroup *mem, > > + const nodemask_t *nodes); > > > > static inline > > int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup > *cgroup) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index 8761a6f..b92dc13 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -279,6 +279,11 @@ struct mem_cgroup { > > u64 high_wmark_distance; > > u64 low_wmark_distance; > > > > + /* While doing per cgroup background reclaim, we cache the > > Correct comment style. > > Thanks. Will change in the next post. --Ying > -- > Kind regards, > Minchan Kim > --000e0cd68ee0c9fc3604a13479ff Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sun, Apr 17, 2011 at 7:22 PM, Minchan= Kim <minchan= .kim@gmail.com> wrote:
On Sat, Apr 16, 2011 at 8:23 AM, Ying Han= <yinghan@google.com> wrote= :
> This add the mechanism for background reclaim which we remember the > last scanned node and always starting from the next one each time.
> The simple round-robin fasion provide the fairness between nodes for > each memcg.
>
> changelog v5..v4:
> 1. initialize the last_scanned_node to MAX_NUMNODES.
>
> changelog v4..v3:
> 1. split off from the per-memcg background reclaim patch.
>
> Signed-off-by: Ying Han <ying= han@google.com>
> ---
> =A0include/linux/memcontrol.h | =A0 =A03 +++
> =A0mm/memcontrol.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 35 +++++++++++++++++++= ++++++++++++++++
> =A02 files changed, 38 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index f7ffd1f..d4ff7f2 100644
> --- a/include/linux/memcontrol.h
> +++ b/include/linux/memcontrol.h
> @@ -88,6 +88,9 @@ extern int mem_cgroup_init_kswapd(struct mem_cgroup = *mem,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0str= uct kswapd *kswapd_p);
> =A0extern void mem_cgroup_clear_kswapd(struct mem_cgroup *mem);
> =A0extern wait_queue_head_t *mem_cgroup_kswapd_wait(struct mem_cgroup = *mem);
> +extern int mem_cgroup_last_scanned_node(struct mem_cgroup *mem);
> +extern int mem_cgroup_select_victim_node(struct mem_cgroup *mem,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 const nodemask_t *nodes);
>
> =A0static inline
> =A0int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cg= roup *cgroup)
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 8761a6f..b92dc13 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -279,6 +279,11 @@ struct mem_cgroup {
> =A0 =A0 =A0 =A0u64 high_wmark_distance;
> =A0 =A0 =A0 =A0u64 low_wmark_distance;
>
> + =A0 =A0 =A0 /* While doing per cgroup background reclaim, we cache t= he

Correct comment style.

Thanks. Will change in the next post.

<= /div>
--Ying=A0
--
Kind regards,
Minchan Kim

--000e0cd68ee0c9fc3604a13479ff-- -- 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: email@kvack.org