Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753726AbbBXTWg (ORCPT ); Tue, 24 Feb 2015 14:22:36 -0500 Received: from mout.gmx.net ([212.227.15.15]:53381 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336AbbBXTWf (ORCPT ); Tue, 24 Feb 2015 14:22:35 -0500 Message-ID: <54ECCF6E.7050805@gmx.de> Date: Tue, 24 Feb 2015 20:22:22 +0100 From: Heinrich Schuchardt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 MIME-Version: 1.0 To: OGAWA Hirofumi CC: Alexander Kuleshov , linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs/fat: calculate checksum in a loop instead of directly calculating References: <1424285300-14431-1-git-send-email-kuleshovmail@gmail.com> <878ufvowcd.fsf@mail.parknet.co.jp> <87wq3fnep7.fsf@mail.parknet.co.jp> <54EB905B.8010704@gmx.de> <8761asni74.fsf@mail.parknet.co.jp> In-Reply-To: <8761asni74.fsf@mail.parknet.co.jp> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:DTePGMpllcaP4b8upqEf0U+46tdMnCNshD5+44ALOUSAjPtOBLb xRbfoQRAbwPXaaRO1RJZ6Ko7yl9js5JuWmz6wVbNfO++STC6Oi5jdGN5wt/1qPYB9vGBMjl D/eXLsdT7XfDwTtacb+hHmaZvZLt1gNXYB5ydYmeYmC96zHGuVjldVKGf1Mrzv5aZCJCooW bn1JQn/HXzUMFLdq791WA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 58 On 24.02.2015 03:42, OGAWA Hirofumi wrote: > Heinrich Schuchardt 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 -- 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/