lkml.org 
[lkml]   [2005]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [-mm patch] make kcalloc() a static inline
On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> > Seems like that optimization is not helping.
> > Do you have better example?

On Mon, 15 Aug 2005, Arjan van de Ven wrote:
> you need gcc 4.1 (eg CVS) for the value range propagation stuff.

For Denis' example, it does not seem to help. I must admit I did not know
GCC 3.x does not have this optimization. I am also bit confused as Adrian
and I saw small reduction in kernel text with kcalloc() inlined. If GCC
is, in fact, spreading the extra operations everywhere, shouldn't kernel
text be bigger?

Pekka

penberg@haji ~/tmp $ ~/bin/gcc-4.1-cvs/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/penberg/bin/gcc-4.1-cvs
--enable-languages=c
Thread model: posix
gcc version 4.1.0 20050815 (experimental)
penberg@haji ~/tmp $ ~/bin/gcc-4.1-cvs/bin/gcc -O -S -mcpu=i386 t.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
penberg@haji ~/tmp $ cat t.s
.file "t.c"
.text
.globl f
.type f, @function
f:
pushl %ebp
movl %esp, %ebp
pushl %ebx
subl $4, %esp
movl 12(%ebp), %eax
cmpl $999, %eax
jg .L2
movl %eax, %ebx
movl 8(%ebp), %ecx
testl %ecx, %ecx
je .L4
movl $2147483647, %eax
movl $0, %edx
divl %ecx
cmpl %eax, %ebx
ja .L2
.L4:
subl $8, %esp
pushl $1
movl %ebx, %eax
imull %ecx, %eax
pushl %eax
call kzalloc
addl $16, %esp
jmp .L6
.L2:
movl $0, %eax
.L6:
movl -4(%ebp), %ebx
leave
ret
.size f, .-f
.ident "GCC: (GNU) 4.1.0 20050815 (experimental)"
.section .note.GNU-stack,"",@progbits

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-15 15:08    [W:0.042 / U:2.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site