]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: do not recalculate section unnecessarily in init_section_page_cgroup
authorFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Thu, 8 Jan 2009 02:07:51 +0000 (18:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 8 Jan 2009 16:31:04 +0000 (08:31 -0800)
commit7c8c8c69e849cdb7615eeb9ba5193b106746ac9f
tree35d01368e76d0e5ad21b38fc80274154f8a35d62
parentaf41ab82ad45373aad1525f7ac440903a6f421ac
memcg: do not recalculate section unnecessarily in init_section_page_cgroup

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@oss.ntt.co.jp>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_cgroup.c