linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Minchan Kim <minchan.kim@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Barrett <damentz@liquorix.net>,
	Ben Gamari <bgamari.foss@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rik van Riel <riel@redhat.com>, Mel Gorman <mel@csn.ul.ie>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Nick Piggin <npiggin@kernel.dk>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Balbir Singh <balbir@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [PATCH v6 2/3] memcg: move memcg reclaimable page into tail of inactive list
Date: Mon, 21 Feb 2011 09:40:14 +0100	[thread overview]
Message-ID: <20110221084014.GC25382@cmpxchg.org> (raw)
In-Reply-To: <c76a1645aac12c3b8ffe2cc5738033f5a6da8d32.1298212517.git.minchan.kim@gmail.com>

On Sun, Feb 20, 2011 at 11:43:37PM +0900, Minchan Kim wrote:
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -813,6 +813,33 @@ void mem_cgroup_del_lru(struct page *page)
>  	mem_cgroup_del_lru_list(page, page_lru(page));
>  }
>  
> +/*
> + * Writeback is about to end against a page which has been marked for immediate
> + * reclaim.  If it still appears to be reclaimable, move it to the tail of the
> + * inactive list.
> + */
> +void mem_cgroup_rotate_reclaimable_page(struct page *page)
> +{
> +	struct mem_cgroup_per_zone *mz;
> +	struct page_cgroup *pc;
> +	enum lru_list lru = page_lru(page);
> +
> +	if (mem_cgroup_disabled())
> +		return;
> +
> +	pc = lookup_page_cgroup(page);
> +	/*
> +	 * Used bit is set without atomic ops but after smp_wmb().
> +	 * For making pc->mem_cgroup visible, insert smp_rmb() here.
> +	 */
> +	smp_rmb();
> +	/* unused or root page is not rotated. */
> +	if (!PageCgroupUsed(pc) || mem_cgroup_is_root(pc->mem_cgroup))
> +		return;

The placement of this barrier is confused and has been fixed up in the
meantime in other places.  It has to be between PageCgroupUsed() and
accessing pc->mem_cgroup.  You can look at the other memcg lru
functions for reference.

--
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-02-21  8:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-20 14:43 [PATCH v6 0/4] fadvise(DONTNEED) support Minchan Kim
2011-02-20 14:43 ` [PATCH v6 1/3] deactivate invalidated pages Minchan Kim
2011-02-21  8:29   ` Johannes Weiner
2011-02-20 14:43 ` [PATCH v6 2/3] memcg: move memcg reclaimable page into tail of inactive list Minchan Kim
2011-02-21  8:40   ` Johannes Weiner [this message]
2011-02-21 14:07     ` Minchan Kim
2011-02-21 15:59     ` Minchan Kim
2011-02-21 16:06       ` Johannes Weiner
2011-03-28 12:51       ` [PATCH] memcg: fix mem_cgroup_rotate_reclaimable_page Eric Dumazet
2011-03-28 13:45         ` Minchan Kim
2011-02-20 14:43 ` [PATCH v6 3/3] Reclaim invalidated page ASAP Minchan Kim
2011-02-21 19:07 ` [PATCH v6 0/4] fadvise(DONTNEED) support Andrea Arcangeli
2011-02-21 22:59   ` Minchan Kim
2011-02-22 13:28     ` Andrea Arcangeli
2011-02-22 14:26       ` Minchan Kim
2011-02-22 14:46         ` Andrea Arcangeli
2011-02-22 17:03       ` Jeffrey Hundstad
2011-02-22 17:11         ` Andrea Arcangeli

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=20110221084014.GC25382@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=balbir@linux.vnet.ibm.com \
    --cc=bgamari.foss@gmail.com \
    --cc=damentz@liquorix.net \
    --cc=fengguang.wu@intel.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=minchan.kim@gmail.com \
    --cc=npiggin@kernel.dk \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.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