linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] shrink per_cpu_pages to fit 32byte cacheline
@ 2004-09-13 23:38 Marcelo Tosatti
  2004-09-14  6:10 ` Arjan van de Ven
  0 siblings, 1 reply; 9+ messages in thread
From: Marcelo Tosatti @ 2004-09-13 23:38 UTC (permalink / raw)
  To: akpm, Martin J. Bligh; +Cc: linux-mm

Subject says it all, the following patch shrinks per_cpu_pages
struct from 24 to 16bytes, that makes the per CPU array containing
hot and cold "per_cpu_pages[2]" fit on 32byte cacheline. This structure
is often used so I bet this is a useful optimization.

The counters never reach 2 ^ 16 (the maximum "batch" can get is 64).

Please apply

--- linux-2.6.9-rc1-mm4/include/linux/mmzone.h.orig	2004-09-09 18:42:32.000000000 -0300
+++ linux-2.6.9-rc1-mm4/include/linux/mmzone.h	2004-09-13 13:41:55.589436224 -0300
@@ -43,10 +43,10 @@
 #endif
 
 struct per_cpu_pages {
-	int count;		/* number of pages in the list */
-	int low;		/* low watermark, refill needed */
-	int high;		/* high watermark, emptying needed */
-	int batch;		/* chunk size for buddy add/remove */
+	short int count;		/* number of pages in the list */
+	short int low;		/* low watermark, refill needed */
+	short int high;		/* high watermark, emptying needed */
+	short int batch;		/* chunk size for buddy add/remove */
 	struct list_head list;	/* the list of pages */
 };
 
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-09-15  0:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-13 23:38 [PATCH] shrink per_cpu_pages to fit 32byte cacheline Marcelo Tosatti
2004-09-14  6:10 ` Arjan van de Ven
2004-09-14  9:34   ` Marcelo Tosatti
2004-09-14 11:13     ` Arjan van de Ven
2004-09-14 10:01       ` Marcelo Tosatti
2004-09-14 11:44         ` Arjan van de Ven
2004-09-14 22:45           ` Marcelo Tosatti
2004-09-15  0:57             ` Nick Piggin
2004-09-15  0:48               ` Marcelo Tosatti

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