lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 27 Oct 2023 10:01:32 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: kuba@...nel.org, andrew@...n.ch, corbet@....net, daniel@...earbox.net, 
	dsahern@...nel.org, lixiaoyan@...gle.com, mubashirq@...gle.com, 
	ncardwell@...gle.com, netdev@...r.kernel.org, pabeni@...hat.com, 
	pnemavat@...gle.com, weiwan@...gle.com, wwchao@...gle.com
Subject: Re: [PATCH v4 net-next 2/6] cache: enforce cache groups

On Fri, Oct 27, 2023 at 1:39 AM Kuniyuki Iwashima <kuniyu@...zon.com> wrote:
>
> From: Jakub Kicinski <kuba@...nel.org>
> Date: Thu, 26 Oct 2023 07:17:01 -0700
> > On Thu, 26 Oct 2023 08:19:55 +0000 Coco Li wrote:
> > > Set up build time warnings to safegaurd against future header changes
> > > of organized structs.
> >
> > TBH I had some doubts about the value of these asserts, I thought
> > it was just me but I was talking to Vadim F and he brought up
> > the same question.
> >
> > IIUC these markings will protect us from people moving the members
> > out of the cache lines. Does that actually happen?
> >
> > It'd be less typing to assert the _size_ of each group, which protects
> > from both moving out, and adding stuff haphazardly, which I'd guess is
> > more common. Perhaps we should do that in addition?
>
> Also, we could assert the size of the struct itself and further
> add ____cacheline_aligned_in_smp to __cacheline_group_begin() ?

Nope, automatically adding  ____cacheline_aligned_in_smp to each group
is not beneficial.

We ran a lot of experiments and concluded that grouping was the best strategy.

Adding  ____cacheline_aligned_in_smp adds holes and TX + RX traffic (RPC)
would use more cache lines than necessary.


>
> If someone adds/removes a member before __cacheline_group_begin(),
> two groups could share the same cacheline.
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ