Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1186836

Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords

From Hagen Paul Pfeifer <hagen@jauu.net>
Newsgroups linux.kernel
Subject Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords
Date 2015-07-17 15:50 +0200
Message-ID <pNebw-73F-7@gated-at.bofh.it> (permalink)
References <pMQLV-6VT-29@gated-at.bofh.it> <pMTA7-2Br-43@gated-at.bofh.it> <pMVVg-66m-25@gated-at.bofh.it> <pMX0Z-7CX-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> On July 16, 2015 at 9:23 PM Joe Perches <joe@perches.com> 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 __<func> 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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords Tom Herbert <tom@herbertland.com> - 2015-07-16 17:50 +0200
  Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords David Miller <davem@davemloft.net> - 2015-07-16 20:20 +0200
    Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords Joe Perches <joe@perches.com> - 2015-07-16 21:30 +0200
      Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords Hagen Paul Pfeifer <hagen@jauu.net> - 2015-07-17 15:50 +0200
        Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords Joe Perches <joe@perches.com> - 2015-07-18 01:00 +0200
    Re: [PATCH v2] jhash: Deinline jhash, jhash2 and __jhash_nwords David Miller <davem@davemloft.net> - 2015-07-19 20:50 +0200

csiph-web