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: <87fx8o56eq.fsf@basil.nowhere.org>
Date:	Mon, 09 Nov 2009 11:39:09 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>,
	Lucian Adrian Grijincu <lgrijincu@...acom.com>,
	Octavian Purdila <opurdila@...acom.com>
Subject: Re: [PATCH 1/8] udp: add a counter into udp_hslot

Eric Dumazet <eric.dumazet@...il.com> writes:
>  
> +/**
> + *	struct udp_hslot - UDP hash slot
> + *
> + *	@head:	head of list of sockets
> + *	@count:	number of sockets in 'head' list
> + *	@lock:	spinlock protecting changes to head/count
> + */
>  struct udp_hslot {
>  	struct hlist_nulls_head	head;
> +	int			count;

Do you really need an int? On 64bit it's free due to the alignment, 
but on 32bit x86 it's costly and you blow up the table considerably,
increasing cache misses.
 
Again it would be nicer if that was a separate smaller table together
with the spinlock.

In theory could also put a short counter into the low level alignment
bits of the pointer and perhaps convert the spinlock to a bitlock?
Then all could collapse into a single pointer.

-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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