Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416570

Re: [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists

From Andi Kleen <andi@firstfloor.org>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists
Date 2016-06-07 22:20 +0200
Message-ID <rHvDI-7fg-15@gated-at.bofh.it> (permalink)
References <rHv0Z-6Mo-3@gated-at.bofh.it> <rHv0Z-6Mo-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RESEND PATCH 0/5] vfs: Use dlock list for SB's s_inodes list Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200
  [RESEND PATCH 2/5] lib/dlock-list: Add __percpu modifier for parameters Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200
  [RESEND PATCH 4/5] vfs: Remove unnecessary list_for_each_entry_safe() variants Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200
  [RESEND PATCH 3/5] fsnotify: Simplify inode iteration on umount Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200
  [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200
    Re: [RESEND PATCH 1/5] lib/dlock-list: Distributed and  lock-protected lists Andi Kleen <andi@firstfloor.org> - 2016-06-07 22:20 +0200
  [RESEND PATCH 5/5] vfs: Use dlock list for superblock's inode list Waiman Long <Waiman.Long@hpe.com> - 2016-06-07 21:40 +0200

csiph-web