From: Waiman Long <waiman.long@hpe.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.com>, Jeff Layton <jlayton@poochiereds.net>,
"J. Bruce Fields" <bfields@fieldses.org>,
Tejun Heo <tj@kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
<linux-fsdevel@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Dave Chinner <dchinner@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Scott J Norton <scott.norton@hpe.com>,
Douglas Hatch <doug.hatch@hpe.com>
Subject: Re: [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists
Date: Mon, 11 Jul 2016 13:37:41 -0400 [thread overview]
Message-ID: <5783D965.2030506@hpe.com> (raw)
In-Reply-To: <20160607201340.GL13997@two.firstfloor.org>
On 06/07/2016 04:13 PM, Andi Kleen wrote:
> 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.
When iterating the lists, the lock shouldn't be taken when a list is empty.
> 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
I have just sent out an updated patch to mapped 2 cores to each list.
Maybe you can take a look to see if that is good enough from your point
of view.
Cheers,
Longman
next prev parent reply other threads:[~2016-07-11 17:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 19:35 [RESEND PATCH 0/5] vfs: Use dlock list for SB's s_inodes list Waiman Long
2016-06-07 19:35 ` [RESEND PATCH 1/5] lib/dlock-list: Distributed and lock-protected lists Waiman Long
2016-06-07 20:13 ` Andi Kleen
2016-06-07 23:53 ` Waiman Long
2016-07-11 17:37 ` Waiman Long [this message]
2016-06-07 19:35 ` [RESEND PATCH 2/5] lib/dlock-list: Add __percpu modifier for parameters Waiman Long
2016-06-07 19:35 ` [RESEND PATCH 3/5] fsnotify: Simplify inode iteration on umount Waiman Long
2016-06-07 19:35 ` [RESEND PATCH 4/5] vfs: Remove unnecessary list_for_each_entry_safe() variants Waiman Long
2016-06-07 19:35 ` [RESEND PATCH 5/5] vfs: Use dlock list for superblock's inode list Waiman Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5783D965.2030506@hpe.com \
--to=waiman.long@hpe.com \
--cc=andi@firstfloor.org \
--cc=bfields@fieldses.org \
--cc=boqun.feng@gmail.com \
--cc=cl@linux-foundation.org \
--cc=dchinner@redhat.com \
--cc=doug.hatch@hpe.com \
--cc=jack@suse.com \
--cc=jlayton@poochiereds.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=scott.norton@hpe.com \
--cc=tj@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox