public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 6/13] optimise struct page layout
@ 2002-07-28  7:32 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2002-07-28  7:32 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml



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 {

.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-28  7:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-28  7:32 [patch 6/13] optimise struct page layout Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox