lkml.org 
[lkml]   [2015]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] fs/fat: calculate checksum in a loop instead of directly calculating
Date
Heinrich Schuchardt <xypron.glpk@gmx.de> writes:

> You have to put
> __attribute__((optimize("unroll-loops")))
> here to unroll the loop inside the function:
>
>
> static __attribute__ ((noinline))
> __attribute__((optimize("unroll-loops")))
> int test(unsigned char *name)
>
> $ time ./c.inline aaaaaaaaaaa
> 14
>
> real 0m0.743s
> user 0m0.740s
> sys 0m0.000s
>
> Without __attribute__((optimize("unroll-loops"))) :
> $ time ./c.loop aaaaaaaaaaa
> 14
>
> real 0m1.482s
> user 0m1.472s
> sys 0m0.004s
>
> With __attribute__((optimize("unroll-loops"))) :
>
> $ time ./c.loop aaaaaaaaaaa
> 14
>
> real 0m0.742s
> user 0m0.740s
> sys 0m0.000s

This attribute has to be added to the caller, not fat_checksum()? I.e.,
we has to add it to all callers of fat_checksum()?

Well, this is interesting gcc optimize option though, maybe not worth to
introduce this to kernel only for fatfs.

Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2015-02-24 04:01    [W:2.081 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site