mm: optimize compound_head() by avoiding a shared page flag
authorChristoph Lameter <clameter@sgi.com>
Sun, 6 May 2007 21:49:40 +0000 (14:49 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:12:53 +0000 (12:12 -0700)
commit6d7779538f765963ced45a3fa4bed7ba8d2c277d
tree07d47e6ff1ab30309004e2ba0674dcabd83945c1
parentd85f33855c303acfa87fa457157cef755b6087df
mm: optimize compound_head() by avoiding a shared page flag

The patch adds PageTail(page) and PageHead(page) to check if a page is the
head or the tail of a compound page.  This is done by masking the two bits
describing the state of a compound page and then comparing them.  So one
comparision and a branch instead of two bit checks and two branches.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h
include/linux/page-flags.h
mm/page_alloc.c