lkml.org 
[lkml]   [2015]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH akpm/next] lib: crc32: conditionally constify crc32 lookup table
On 01/03/2015 02:08 AM, Andrew Morton wrote:
> On Sat, 03 Jan 2015 01:12:43 +0100 Daniel Borkmann <dborkman@redhat.com> wrote:
>
>>> Seems a lot of fuss. Why are these tables cacheline aligned anyway?
>>> To avoid one cache miss (most of the time, presumably) in a 16k table.
>>> Pretty marginal benefit, I suspect.
>>
>> I guess, it actually came in with the slice-by-8 algorithm (e.g. used
>> in SCTP checksumming if no offloading is available) that was added back
>> then, that is, commit 324eb0f17d9dc ("crc32: add slice-by-8 algorithm
>> to existing code").
>
> non-responsive ;) By far the simplest solution is to remove the
> cacheline alignment.

Alternatively, I'm thinking of const + ____cacheline_aligned (w/o the gcc
test case). In case some people run gcc versions that have the bug, it's
worst case just as good as const only, and in the majority of cases aligned
as expected.

> Are there other places where CC_HAVE_CONST_ALIGN can be used? I'm seeing
>
> z:/usr/src/linux-3.19-rc2> grep -r cacheline_aligned . | grep const
> ./arch/x86/um/sys_call_table_32.c:const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {
> ./arch/x86/um/sys_call_table_64.c:const sys_call_ptr_t sys_call_table[] __cacheline_aligned = {

I'll investigate these two above and send a patch, thanks. They should
actually be using ____cacheline_aligned instead!

> ./include/net/netfilter/nf_tables.h: const struct nft_set_ops *ops ____cacheline_aligned;
> ./net/ethernet/eth.c:const struct header_ops eth_header_ops ____cacheline_aligned = {


\
 
 \ /
  Last update: 2015-01-03 10:41    [W:0.033 / U:1.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site