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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Jun 2016 20:41:35 +0200
From:	Jesper Dangaard Brouer <brouer@...hat.com>
To:	"Michael S. Tsirkin" <mst@...hat.com>
Cc:	linux-kernel@...r.kernel.org, Jason Wang <jasowang@...hat.com>,
	Eric Dumazet <eric.dumazet@...il.com>, davem@...emloft.net,
	netdev@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
	kvm@...r.kernel.org, brouer@...hat.com
Subject: Re: [PATCH RFC v7 0/5] skb_array: array based FIFO for skbs


I applied this V7 to my github tree:
 https://github.com/netoptimizer/prototype-kernel/commits/master

And adjusted my benchmark and unit-tests of this skb_array API.
Added an unit test of re-sizing to small queue size.
 https://github.com/netoptimizer/prototype-kernel/blob/81ca09c2a9/kernel/lib/skb_array_test01.c#L130


On Thu, 2 Jun 2016 19:08:14 +0300 "Michael S. Tsirkin" <mst@...hat.com> wrote:

[...]
> My testing seems to show that at least for the common usecase
> in networking, which isn't lockless, circular buffer
> with indices does not perform that well, because
> each index access causes a cache line to bounce between
> CPUs, and index access causes stalls due to the dependency.
> 
> By comparison, an array of pointers where NULL means invalid
> and !NULL means valid

I confirm and validate that this is a good approach.
In module skb_array_parallel01:
 https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/lib/skb_array_parallel01.c

> As this might be useful outside of networking, I implemented
> a generic array of void pointers, with a type-safe wrapper for skbs.

Nice

[...]
> The only issue is with calls within a loop using the __ptr_ring_XXX
> accessors - in theory compiler could hoist accesses out of the loop.
> 
> Following volatile-considered-harmful.txt I merely
> documented that callers that busy-poll should invoke cpu_relax().
> Most people will use the external skb_array_XXX APIs with a spinlock,
> so this should not be an issue for them.

I would like to see some bulking support...

As my experiments[1] show that alf_queue (primarily) can beat skb_array due
to bulking support.  It seems like an obvious optimization for the virt
tun use-case to bulk dequeue SKBs.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

[1] https://github.com/netoptimizer/prototype-kernel/blob/master/kernel/lib/alf_queue_parallel01.c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ