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]
Message-ID: <65d29ecb-5d41-ad73-5849-4fd23fa1b8a0@gmail.com>
Date:   Fri, 16 Nov 2018 06:39:32 -0800
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Davide Caratti <dcaratti@...hat.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        "David S. Miller" <davem@...emloft.net>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net/sched: act_police: don't use spinlock in
 the data path



On 11/16/2018 06:34 AM, Eric Dumazet wrote:

> 
>> +	s64			tcfp_toks;
>> +	s64			tcfp_ptoks;
>> +	s64			tcfp_t_c;
> 
> I suggest to use a single cache line with a dedicated spinlock and these three s64
> 
> 	spinlock_t  tcfp_lock ____cacheline_aligned_in_smp;
> 	s64 			...
> 	s64			...
> 	s64			...
> 
> 
>>  	struct tcf_police_params __rcu *params;
> 
> Make sure to use a different cache line for *params 
> 
> 	struct tcf_police_params __rcu *params ____cacheline_aligned_in_smp;


Or move it before the cacheline used by the lock and three s64,
since 'common' should be read-mostly. No need for a separate cache line.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ