Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752345AbbBXCmp (ORCPT ); Mon, 23 Feb 2015 21:42:45 -0500 Received: from mail.parknet.co.jp ([210.171.160.6]:34076 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbbBXCmo (ORCPT ); Mon, 23 Feb 2015 21:42:44 -0500 From: OGAWA Hirofumi To: Heinrich Schuchardt 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> Date: Tue, 24 Feb 2015 11:42:39 +0900 In-Reply-To: <54EB905B.8010704@gmx.de> (Heinrich Schuchardt's message of "Mon, 23 Feb 2015 21:40:59 +0100") Message-ID: <8761asni74.fsf@mail.parknet.co.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1215 Lines: 49 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()? Well, this is interesting gcc optimize option though, maybe not worth to introduce this to kernel only for fatfs. Thanks. -- OGAWA Hirofumi -- 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/