Skip to contentSkip to conversation

compress the stack layout of do_page_fault(), x86

PATCH Andi Kleen 3 participants 7 messages Jul 9, 2005 – Jul 11, 2005 2 messages not in the archive

lore
Share & tools
lore

Andi Kleen

author
#2 lore raw
In reply to a message not in the archive

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

-Andi

#3 lore raw
Quoted 7 lines · Andi Kleen

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

but.... the x86 kernel is -fno-unit-at-a-time.... for stack reasons ;)

author
#4 lore raw
Quoted 10 lines · Arjan van de Ven
Quoted 7 lines · Andi Kleen

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

but.... the x86 kernel is -fno-unit-at-a-time.... for stack reasons ;)

The gcc people are making noises of removing that. So eventually it will need to go.

Also some kernels are compiled with that option removed and it works just fine.

-Andi

#6 lore raw
In reply to Andi Kleen
Quoted 7 lines · Andi Kleen

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

this function has two callers.

Ingo

#5 lore raw
In reply to Andi Kleen
Quoted 10 lines · Andi Kleen
Quoted 9 lines · Arjan van de Ven
Quoted 7 lines · Andi Kleen

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

Quoted 4 lines
Quoted 1 line

but.... the x86 kernel is -fno-unit-at-a-time.... for stack reasons ;)

The gcc people are making noises of removing that. So eventually it will need to go.

the gcc people also fixed the stack usage on inlining (at least this specific class) in CVS HEAD so the "problem" is a lot smaller whenever they make it go away.

author
#7 lore raw
In reply to Ingo Molnar
Quoted 5 lines · Ingo Molnar
Quoted 2 lines · Andi Kleen
Quoted 1 line · Ingo Molnar
Quoted 7 lines
Quoted 5 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

this function has two callers.

Even then it's still better to mark it noinline, otherwise a different inlining algorithm in a new compiler might do the wrong thing. It's also useful documentation.

-Andi

#8 lore raw
Quoted 12 lines · Andi Kleen
Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Andi Kleen

Review

Quoted 3 lines · Ingo Molnar
(quoted diff) +2 -0
+static void force_sig_info_fault(int si_signo, int si_code,
+				 unsigned long address, struct task_struct *tsk)

This won't work with a unit-at-a-time compiler which happily inlines everything static with only a single caller. Use noinline

Quoted 5 lines
Quoted 1 line

this function has two callers.

Even then it's still better to mark it noinline, otherwise a different inlining algorithm in a new compiler might do the wrong thing. It's also useful documentation.

ok, agreed. Delta patch below.

Ingo

----
make force_sig_info_fault() noinline, suggested by Andi Kleen.

arch/i386/mm/fault.c renamed from arch/i386/mm/fault.c.orig +2 -2
@@ -199,8 +199,8 @@ static inline int is_prefetch(struct pt_
 	return 0;
 } 
 
-static void force_sig_info_fault(int si_signo, int si_code,
-				 unsigned long address, struct task_struct *tsk)
+static noinline void force_sig_info_fault(int si_signo, int si_code,
+	unsigned long address, struct task_struct *tsk)
 {
 	siginfo_t info;