LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Fernando Luis Vázquez Cao" <fernando@oss.ntt.co.jp>
To: akpm@linux-foundation.org
Cc: kamezawa.hiroyu@jp.fujitsu.com, linux-kernel@vger.kernel.org
Subject: [PATCH] memcg: do not recalculate section unnecessarily in init_section_page_cgroup
Date: Thu, 30 Oct 2008 13:38:50 +0900	[thread overview]
Message-ID: <1225341530.3135.26.camel@sebastian.kern.oss.ntt.co.jp> (raw)

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
---

diff -urNp linux-2.6.28-rc2-mm1-orig/mm/page_cgroup.c linux-2.6.28-rc2-mm1/mm/page_cgroup.c
--- linux-2.6.28-rc2-mm1-orig/mm/page_cgroup.c	2008-10-30 12:49:27.000000000 +0900
+++ linux-2.6.28-rc2-mm1/mm/page_cgroup.c	2008-10-30 12:52:41.000000000 +0900
@@ -99,13 +99,11 @@ struct page_cgroup *lookup_page_cgroup(s
 
 int __meminit init_section_page_cgroup(unsigned long pfn)
 {
-	struct mem_section *section;
+	struct mem_section *section = __pfn_to_section(pfn);
 	struct page_cgroup *base, *pc;
 	unsigned long table_size;
 	int nid, index;
 
-	section = __pfn_to_section(pfn);
-
 	if (section->page_cgroup)
 		return 0;
 
@@ -131,7 +129,6 @@ int __meminit init_section_page_cgroup(u
 		__init_page_cgroup(pc, pfn + index);
 	}
 
-	section = __pfn_to_section(pfn);
 	section->page_cgroup = base - pfn;
 	total_usage += table_size;
 	return 0;



             reply	other threads:[~2008-10-30  4:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30  4:38 Fernando Luis Vázquez Cao [this message]
2008-10-30  6:45 ` KAMEZAWA Hiroyuki
2008-10-30  7:06   ` Fernando Luis Vázquez Cao

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=1225341530.3135.26.camel@sebastian.kern.oss.ntt.co.jp \
    --to=fernando@oss.ntt.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] memcg: do not recalculate section unnecessarily in init_section_page_cgroup' \
    /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

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).