Skip to contentSkip to conversation

shrink thread_struct

PATCH New Albert Cahalan 1 participant 1 message Jul 17, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 shrink thread_struct

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)

include/asm-i386/processor.h +6 -5
diff -Naurd old/include/asm-i386/processor.h new/include/asm-i386/processor.h
@@ -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  {							\