+ memcg-do-not-recalculate-section-unnecessarily-in-init_section_page_cgroup.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     memcg: do not recalculate section unnecessarily in init_section_page_cgroup
has been added to the -mm tree.  Its filename is
     memcg-do-not-recalculate-section-unnecessarily-in-init_section_page_cgroup.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: memcg: do not recalculate section unnecessarily in init_section_page_cgroup
From: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>

In init_section_page_cgroup() the section a given pfn belongs to is
calculated at the top of the function and, despite the fact that the
pfn/section correspondence does not change, it is recalculated further
down the same function.  By computing this just once and reusing that
value we save some bytes in the object file and do not waste CPU cycles.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@xxxxxxxxxxxxx>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
Cc: Daisuke Nishimura <nishimura@xxxxxxxxxxxxxxxxx>
Cc: Balbir Singh <balbir@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_cgroup.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff -puN mm/page_cgroup.c~memcg-do-not-recalculate-section-unnecessarily-in-init_section_page_cgroup mm/page_cgroup.c
--- a/mm/page_cgroup.c~memcg-do-not-recalculate-section-unnecessarily-in-init_section_page_cgroup
+++ a/mm/page_cgroup.c
@@ -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;
_

Patches currently in -mm which might be from fernando@xxxxxxxxxxxxx are

spi-fix-compile-error.patch
memcg-do-not-recalculate-section-unnecessarily-in-init_section_page_cgroup.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux