linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ying Han <yinghan@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.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, Michal Hocko <mhocko@suse.cz>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH 0/8] memcg: clean up, export swapiness
Date: Mon, 23 May 2011 10:26:22 -0700	[thread overview]
Message-ID: <BANLkTi=7-xgUetav9s5fvZ8e+U986Y4Z7w@mail.gmail.com> (raw)
In-Reply-To: <20110520124312.5928aa92.kamezawa.hiroyu@jp.fujitsu.com>

Hi Kame:

Is this patch part of the "memcg async reclaim v2" patchset? I am
trying to do some tests on top of that, but having hard time finding
the [PATCH 3/8] and [PATCH 5/8].

--Ying

On Thu, May 19, 2011 at 8:43 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> From: Ying Han <yinghan@google.com>
> change mem_cgroup's swappiness interface.
>
> Now, memcg's swappiness interface is defined as 'static' and
> the value is passed as an argument to try_to_free_xxxx...
>
> This patch adds an function mem_cgroup_swappiness() and export it,
> reduce arguments. This interface will be used in async reclaim, later.
>
> I think an function is better than passing arguments because it's
> clearer where the swappiness comes from to scan_control.
>
> Signed-off-by: Ying Han <yinghan@google.com>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> ---
>  include/linux/memcontrol.h |    1 +
>  include/linux/swap.h       |    4 +---
>  mm/memcontrol.c            |   14 ++++++--------
>  mm/vmscan.c                |    9 ++++-----
>  4 files changed, 12 insertions(+), 16 deletions(-)
>
> Index: mmotm-May11/include/linux/memcontrol.h
> ===================================================================
> --- mmotm-May11.orig/include/linux/memcontrol.h
> +++ mmotm-May11/include/linux/memcontrol.h
> @@ -112,6 +112,7 @@ unsigned long
>  mem_cgroup_zone_reclaimable_pages(struct mem_cgroup *memcg, int nid, int zid);
>  bool mem_cgroup_test_reclaimable(struct mem_cgroup *memcg);
>  int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
> +unsigned int mem_cgroup_swappiness(struct mem_cgroup *memcg);
>  unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
>                                       struct zone *zone,
>                                       enum lru_list lru);
> Index: mmotm-May11/mm/memcontrol.c
> ===================================================================
> --- mmotm-May11.orig/mm/memcontrol.c
> +++ mmotm-May11/mm/memcontrol.c
> @@ -1285,7 +1285,7 @@ static unsigned long mem_cgroup_margin(s
>        return margin >> PAGE_SHIFT;
>  }
>
> -static unsigned int get_swappiness(struct mem_cgroup *memcg)
> +unsigned int mem_cgroup_swappiness(struct mem_cgroup *memcg)
>  {
>        struct cgroup *cgrp = memcg->css.cgroup;
>
> @@ -1687,14 +1687,13 @@ static int mem_cgroup_hierarchical_recla
>                /* we use swappiness of local cgroup */
>                if (check_soft) {
>                        ret = mem_cgroup_shrink_node_zone(victim, gfp_mask,
> -                               noswap, get_swappiness(victim), zone,
> -                               &nr_scanned);
> +                               noswap, zone, &nr_scanned);
>                        *total_scanned += nr_scanned;
>                        mem_cgroup_soft_steal(victim, is_kswapd, ret);
>                        mem_cgroup_soft_scan(victim, is_kswapd, nr_scanned);
>                } else
>                        ret = try_to_free_mem_cgroup_pages(victim, gfp_mask,
> -                                               noswap, get_swappiness(victim));
> +                                       noswap);
>                css_put(&victim->css);
>                /*
>                 * At shrinking usage, we can't check we should stop here or
> @@ -3717,8 +3716,7 @@ try_to_free:
>                        ret = -EINTR;
>                        goto out;
>                }
> -               progress = try_to_free_mem_cgroup_pages(mem, GFP_KERNEL,
> -                                               false, get_swappiness(mem));
> +               progress = try_to_free_mem_cgroup_pages(mem, GFP_KERNEL, false);
>                if (!progress) {
>                        nr_retries--;
>                        /* maybe some writeback is necessary */
> @@ -4150,7 +4148,7 @@ static u64 mem_cgroup_swappiness_read(st
>  {
>        struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp);
>
> -       return get_swappiness(memcg);
> +       return mem_cgroup_swappiness(memcg);
>  }
>
>  static int mem_cgroup_swappiness_write(struct cgroup *cgrp, struct cftype *cft,
> @@ -4836,7 +4834,7 @@ mem_cgroup_create(struct cgroup_subsys *
>        INIT_LIST_HEAD(&mem->oom_notify);
>
>        if (parent)
> -               mem->swappiness = get_swappiness(parent);
> +               mem->swappiness = mem_cgroup_swappiness(parent);
>        atomic_set(&mem->refcnt, 1);
>        mem->move_charge_at_immigrate = 0;
>        mutex_init(&mem->thresholds_lock);
> Index: mmotm-May11/include/linux/swap.h
> ===================================================================
> --- mmotm-May11.orig/include/linux/swap.h
> +++ mmotm-May11/include/linux/swap.h
> @@ -252,11 +252,9 @@ static inline void lru_cache_add_file(st
>  extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
>                                        gfp_t gfp_mask, nodemask_t *mask);
>  extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
> -                                                 gfp_t gfp_mask, bool noswap,
> -                                                 unsigned int swappiness);
> +                                                 gfp_t gfp_mask, bool noswap);
>  extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
>                                                gfp_t gfp_mask, bool noswap,
> -                                               unsigned int swappiness,
>                                                struct zone *zone,
>                                                unsigned long *nr_scanned);
>  extern int __isolate_lru_page(struct page *page, int mode, int file);
> Index: mmotm-May11/mm/vmscan.c
> ===================================================================
> --- mmotm-May11.orig/mm/vmscan.c
> +++ mmotm-May11/mm/vmscan.c
> @@ -2178,7 +2178,6 @@ unsigned long try_to_free_pages(struct z
>
>  unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
>                                                gfp_t gfp_mask, bool noswap,
> -                                               unsigned int swappiness,
>                                                struct zone *zone,
>                                                unsigned long *nr_scanned)
>  {
> @@ -2188,7 +2187,6 @@ unsigned long mem_cgroup_shrink_node_zon
>                .may_writepage = !laptop_mode,
>                .may_unmap = 1,
>                .may_swap = !noswap,
> -               .swappiness = swappiness,
>                .order = 0,
>                .mem_cgroup = mem,
>        };
> @@ -2196,6 +2194,8 @@ unsigned long mem_cgroup_shrink_node_zon
>        sc.gfp_mask = (gfp_mask & GFP_RECLAIM_MASK) |
>                        (GFP_HIGHUSER_MOVABLE & ~GFP_RECLAIM_MASK);
>
> +       sc.swappiness = mem_cgroup_swappiness(mem);
> +
>        trace_mm_vmscan_memcg_softlimit_reclaim_begin(0,
>                                                      sc.may_writepage,
>                                                      sc.gfp_mask);
> @@ -2217,8 +2217,7 @@ unsigned long mem_cgroup_shrink_node_zon
>
>  unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem_cont,
>                                           gfp_t gfp_mask,
> -                                          bool noswap,
> -                                          unsigned int swappiness)
> +                                          bool noswap)
>  {
>        struct zonelist *zonelist;
>        unsigned long nr_reclaimed;
> @@ -2228,7 +2227,6 @@ unsigned long try_to_free_mem_cgroup_pag
>                .may_unmap = 1,
>                .may_swap = !noswap,
>                .nr_to_reclaim = SWAP_CLUSTER_MAX,
> -               .swappiness = swappiness,
>                .order = 0,
>                .mem_cgroup = mem_cont,
>                .nodemask = NULL, /* we don't care the placement */
> @@ -2245,6 +2243,7 @@ unsigned long try_to_free_mem_cgroup_pag
>         * scan does not need to be the current node.
>         */
>        nid = mem_cgroup_select_victim_node(mem_cont);
> +       sc.swappiness = mem_cgroup_swappiness(mem_cont);
>
>        zonelist = NODE_DATA(nid)->node_zonelists;
>
>
>

--
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-05-23 17:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20  3:37 [PATCH 0/8] memcg async reclaim v2 KAMEZAWA Hiroyuki
2011-05-20  3:41 ` [PATCH 1/8] memcg: export zone reclaimable pages KAMEZAWA Hiroyuki
2011-05-20  3:42 ` [PATCH 2/8] memcg: easy check routine for reclaimable KAMEZAWA Hiroyuki
2011-05-20 21:49   ` Andrew Morton
2011-05-20 23:57     ` Hiroyuki Kamezawa
2011-05-20  3:43 ` [PATCH 0/8] memcg: clean up, export swapiness KAMEZAWA Hiroyuki
2011-05-23 17:26   ` Ying Han [this message]
2011-05-23 23:55     ` KAMEZAWA Hiroyuki
2011-05-20  3:44 ` [PATCH 4/8] memcg: export release victim KAMEZAWA Hiroyuki
2011-05-20  3:46 ` [PATCH 6/8] memcg asynchronous memory reclaim interface KAMEZAWA Hiroyuki
2011-05-20 21:49   ` Andrew Morton
2011-05-20 23:56     ` Hiroyuki Kamezawa
2011-05-23 23:36       ` Ying Han
2011-05-24  0:11         ` KAMEZAWA Hiroyuki
2011-05-24  0:26           ` Ying Han
2011-05-20  3:47 ` [PATCH 7/8] memcg static scan reclaim for asyncrhonous reclaim KAMEZAWA Hiroyuki
2011-05-20 21:50   ` Andrew Morton
2011-05-21  0:23     ` Hiroyuki Kamezawa
2011-05-20  3:48 ` [PATCH 8/8] memcg asyncrhouns reclaim workqueue KAMEZAWA Hiroyuki
2011-05-20 21:51   ` Andrew Morton
2011-05-21  0:41     ` Hiroyuki Kamezawa
2011-05-21  1:26       ` Andrew Morton
2011-05-23  0:25         ` KAMEZAWA Hiroyuki
2011-05-25  5:51           ` Ying Han
     [not found] ` <BANLkTimd0CAqoAnuGz7WvKsbwphJxo0eZQ@mail.gmail.com>
2011-05-24  0:19   ` [PATCH 0/8] memcg async reclaim v2 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='BANLkTi=7-xgUetav9s5fvZ8e+U986Y4Z7w@mail.gmail.com' \
    --to=yinghan@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --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