[patch 6/13] optimise struct page layout

Andrew Morton (akpm@zip.com.au)
Sun, 28 Jul 2002 00:32:57 -0700


Reorganise the members of struct page.

- Place ->flags at the start so the compiler can generate indirect
addressing rather than indirect+indexed for this commonly-accessed
field. Shrinks the kernel by ~100 bytes.

- Keep ->count with ->flags so they have the best chance of
being in the same cacheline.

mm.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

--- 2.5.29/include/linux/mm.h~page-reorg Sat Jul 27 23:39:05 2002
+++ 2.5.29-akpm/include/linux/mm.h Sat Jul 27 23:49:00 2002
@@ -149,12 +149,12 @@ struct pte_chain;
* TODO: make this structure smaller, it could be as small as 32 bytes.
*/
struct page {
+ unsigned long flags; /* atomic flags, some possibly
+ updated asynchronously */
+ atomic_t count; /* Usage count, see below. */
struct list_head list; /* ->mapping has some page lists. */
struct address_space *mapping; /* The inode (or ...) we belong to. */
unsigned long index; /* Our offset within mapping. */
- atomic_t count; /* Usage count, see below. */
- unsigned long flags; /* atomic flags, some possibly
- updated asynchronously */
struct list_head lru; /* Pageout list, eg. active_list;
protected by pagemap_lru_lock !! */
union {

.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/