linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] shrink thread_struct
@ 2003-07-17 23:49 Albert Cahalan
  0 siblings, 0 replies; only message in thread
From: Albert Cahalan @ 2003-07-17 23:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

The thread_struct was bloated due to padding.
I kept the alignment and may have improved the
cache behavior even, with the FPU stuff now
generally starting on a cache line.
(found with -Wpadded)

diff -Naurd old/include/asm-i386/processor.h new/include/asm-i386/processor.h
--- old/include/asm-i386/processor.h	2003-06-26 17:50:47.000000000 -0400
+++ new/include/asm-i386/processor.h	2003-07-17 18:10:33.000000000 -0400
@@ -335,9 +335,9 @@
 	long	foo;
 	long	fos;
 	long	st_space[20];	/* 8*10 bytes for each FP-reg = 80 bytes */
-	unsigned char	ftop, changed, lookahead, no_update, rm, alimit;
 	struct info	*info;
 	unsigned long	entry_eip;
+	unsigned char	ftop, changed, lookahead, no_update, rm, alimit;
 };
 
 union i387_union {
@@ -393,19 +393,20 @@
 	unsigned long	esp;
 	unsigned long	fs;
 	unsigned long	gs;
+/* IO permissions */
+	unsigned long	*ts_io_bitmap;
 /* Hardware debugging registers */
 	unsigned long	debugreg[8];  /* %%db0-7 debug registers */
 /* fault info */
 	unsigned long	cr2, trap_no, error_code;
+/* virtual 86 mode info part #1, to pad (and cache-align) i387_union */
+	unsigned long		screen_bitmap;
 /* floating point info */
 	union i387_union	i387;
-/* virtual 86 mode info */
+/* virtual 86 mode info part #2 */
 	struct vm86_struct __user * vm86_info;
-	unsigned long		screen_bitmap;
 	unsigned long		v86flags, v86mask, saved_esp0;
 	unsigned int		saved_fs, saved_gs;
-/* IO permissions */
-	unsigned long	*ts_io_bitmap;
 };
 
 #define INIT_THREAD  {							\




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

only message in thread, other threads:[~2003-07-17 23:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17 23:49 [patch] shrink thread_struct Albert Cahalan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).