Re: [PATCH] reduce large do_mount stack usage with noinlines

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Eric Sandeen <sandeen@...>, <linux-kernel@...>, <rth@...>
Date: Friday, February 8, 2008 - 12:50 pm

Andrew Morton <akpm@linux-foundation.org> writes:

In theory it should be already fixed; iirc Richard H. (cc'ed) added
code for this somewhere in 4.x. Don't quite remember which x, likely 
either 1 or 2.

e.g. if I do a quick test here on gcc 4.2 then it definitely
reuses stack slots between inlines. As you can see only ~100 bytes
are allocated, not ~200.

-Andi

% cat ts.c
static inline a(void)
{
	char x[100];
	extf(x);
}

static inline b(void)
{
	char y[100];
	extf(y);
}

f()
{
	a();
	b();		
}
% gcc -O2 -S ts.c
% cat ts.s
  ...
f:
.LFB4:
	pushq	%rbx
.LCFI0:
	xorl	%eax, %eax
	subq	$112, %rsp
.LCFI1:
	movq	%rsp, %rdi
	call	extf
	movq	%rsp, %rdi
	xorl	%eax, %eax
	call	extf
	addq	$112, %rsp
	popq	%rbx
	ret
...
%

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] reduce large do_mount stack usage with noinlines, Andi Kleen, (Fri Feb 8, 12:50 pm)
Re: [PATCH] reduce large do_mount stack usage with noinlines, Arjan van de Ven, (Thu Feb 7, 7:23 pm)
Re: [PATCH] reduce large do_mount stack usage with noinlines, Arjan van de Ven, (Wed Feb 6, 6:54 pm)