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:	Tue, 17 Dec 2013 11:51:02 -0800
From:	Tom Herbert <therbert@...gle.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: PATCH] net: Cache align dst refcnt

On Tue, Dec 17, 2013 at 10:29 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Tue, 2013-12-17 at 10:15 -0800, Tom Herbert wrote:
>> ipv4_dst_check is coming up very high in perf top for TCP_RR tests and
>> it really is not doing much interesting. Looks like we have false
>> sharing with dst->refcnt. This patch cache aligns refcnt. There were
>> already some comments in the code that refcnt needs to be cache aligned.
>>
>> Signed-off-by: Tom Herbert <therbert@...gle.com>
>> ---
>>  include/net/dst.h | 11 +++--------
>>  1 file changed, 3 insertions(+), 8 deletions(-)
>
> This is not needed. I wonder how you tested this.
>
Well I tested with simple netperf:

./super_netperf 200 -t TCP_RR -l 120 -H host -- -r 1,1

Without fix, ipv4_dst_check is 1.66% of CPU utilization (in top 10
functions). With fix, don't see ipv4_dst_check anymore and I don't see
any the cache misses being moved to other functions. This tiny
function is using more CPU that tcp_ack! :-(

> Problem was solved in commit 5635c10d976716
> ("net: make sure struct dst_entry refcount is aligned on 64 bytes")
>
> If this BUILD_BUG_ON() doesn't work for you, we should investigate !
>
Definitely not hitting the bug on. In any case, I'm wondering why is
cache alignment being hard coded here instead of using compiler
directives?

> static inline void dst_hold(struct dst_entry *dst)
> {
>         /*
>          * If your kernel compilation stops here, please check
>          * __pad_to_align_refcnt declaration in struct dst_entry
>          */
>         BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
>         atomic_inc(&dst->__refcnt);
> }
>
> Thanks
>
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ