From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Alexander Kuleshov <kuleshovmail@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/fat: calculate checksum in a loop instead of directly calculating
Date: Tue, 24 Feb 2015 20:22:22 +0100 [thread overview]
Message-ID: <54ECCF6E.7050805@gmx.de> (raw)
In-Reply-To: <8761asni74.fsf@mail.parknet.co.jp>
On 24.02.2015 03:42, OGAWA Hirofumi wrote:
> 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()?
The attribute is applied to the declaration of the function in which you
need loop unrolling.
https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Attribute-Syntax.html
>
> Well, this is interesting gcc optimize option though, maybe not worth to
> introduce this to kernel only for fatfs.
There is an effort to compile the Linux kernel with Clang. We should
avoid new GCC specific items.
Best regards
Heinrich
prev parent reply other threads:[~2015-02-24 19:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-18 18:48 [PATCH] fs/fat: calculate checksum in a loop instead of directly calculating Alexander Kuleshov
2015-02-18 19:25 ` OGAWA Hirofumi
2015-02-18 19:46 ` Alexander Kuleshov
2015-02-18 20:32 ` OGAWA Hirofumi
2015-02-23 20:40 ` Heinrich Schuchardt
2015-02-24 2:42 ` OGAWA Hirofumi
2015-02-24 19:22 ` Heinrich Schuchardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54ECCF6E.7050805@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=hirofumi@mail.parknet.co.jp \
--cc=kuleshovmail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox