Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758305AbbGQNov (ORCPT ); Fri, 17 Jul 2015 09:44:51 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:33688 "EHLO mx1.mailbox.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752870AbbGQNou (ORCPT ); Fri, 17 Jul 2015 09:44:50 -0400 Date: Fri, 17 Jul 2015 15:44:45 +0200 (CEST) From: Hagen Paul Pfeifer Reply-To: Hagen Paul Pfeifer To: Joe Perches , David Miller Cc: tom , herbert , tgraf , netdev , linux-kernel , dvlasenk , "alexander.h.duyck" , kadlec Message-ID: <2035533471.2349.1437140685694.JavaMail.open-xchange@ox1app> In-Reply-To: <1437074611.2495.39.camel@perches.com> References: <1437050416-13295-1-git-send-email-dvlasenk@redhat.com> <20150716.111729.822179499552193763.davem@davemloft.net> <1437074611.2495.39.camel@perches.com> Subject: Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.6.2-Rev20 X-Originating-Client: open-xchange-appsuite Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1424 Lines: 29 > On July 16, 2015 at 9:23 PM Joe Perches wrote: > > It might be useful to have these performance impacting > changes guarded by something like CONFIG_CC_OPTIMIZE_FOR_SIZE > with another static __always_inline __ and a function & > EXPORT_SYMBOL or just a static inline so that where code size > is critical it's uninlined. But keep in mind that jhash, jhash2 and __jhash_nwords are *not* one-instruction long functions. We duplicate code over and over resulting probably in more cache misses. __always_inline__ is probably too strict and a vanilla inline is already for 99% of all distribution builds a __always_inline__, see ARCH_SUPPORTS_OPTIMIZED_INLINING and CONFIG_CC_OPTIMIZE_FOR_SIZE. The answer depends on the specific workload. Sometimes an enforced inline perform better and sometimes a call is the better solution (read: less cache misses). General purpose vendors with a larger working set size should reduce cache misses by deinline many functions. For high-performance special fast-path operations a strong inlined kernel build is probably faster. __always_inline__ makes it impossible for the user to deinline functions or not. Hagen -- 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/