lkml.org 
[lkml]   [2016]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists
On Tue, Jun 07, 2016 at 03:35:51PM -0400, Waiman Long wrote:
> Linked list is used everywhere in the Linux kernel. However, if many
> threads are trying to add or delete entries into the same linked list,
> it can create a performance bottleneck.
>
> This patch introduces a new list APIs that provide a set of distributed
> lists (one per CPU), each of which is protected by its own spinlock.

One thing I don't like is that it is per CPU. One per CPU is almost
certainly overkill and not needed for true scalability, especially
on systems using SMT. Also it makes the case where everything has to
be walked more and more expensive, because all these locks have to
be taken. Even when not contended this will add up.

It would be better to do this per every Nth CPU. Now I don't have
a clear answer what the best N is, but I'm pretty sure it's > 1.
For example at least on SMT systems only per core instead of per
thread. Likely even more coarse grained, although per socket
may be not good enough.

-Andi

\
 
 \ /
  Last update: 2016-06-07 22:41    [W:0.072 / U:1.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site