From: Waiman Long <waiman.long@hpe.com>
To: Jan Kara <jack@suse.cz>
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>,
Andi Kleen <andi@firstfloor.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: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks
Date: Thu, 14 Apr 2016 14:48:07 -0400 [thread overview]
Message-ID: <570FE5E7.5000004@hpe.com> (raw)
In-Reply-To: <20160414141031.GE22053@quack2.suse.cz>
On 04/14/2016 10:10 AM, Jan Kara wrote:
> On Tue 12-04-16 18:54:43, 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 per-cpu list subystem with associated
>> per-cpu locks for protecting each of the lists individually. This
>> allows list entries insertion and deletion operations to happen in
>> parallel instead of being serialized with a global list and lock.
>>
>> List entry insertion is strictly per cpu. List deletion, however, can
>> happen in a cpu other than the one that did the insertion. So we still
>> need lock to protect the list. Because of that, there may still be
>> a small amount of contention when deletion is being done.
>>
>> A new header file include/linux/percpu-list.h will be added with the
>> associated pcpu_list_head and pcpu_list_node structures. The following
>> functions are provided to manage the per-cpu list:
>>
>> 1. int init_pcpu_list_head(struct pcpu_list_head **ppcpu_head)
>> 2. void pcpu_list_add(struct pcpu_list_node *node,
>> struct pcpu_list_head *head)
>> 3. void pcpu_list_del(struct pcpu_list *node)
>>
>> Iteration of all the list entries within a group of per-cpu
>> lists is done by calling either the pcpu_list_iterate() or
>> pcpu_list_iterate_safe() functions in a while loop. They correspond
>> to the list_for_each_entry() and list_for_each_entry_safe() macros
>> respectively. The iteration states are keep in a pcpu_list_state
>> structure that is passed to the iteration functions.
>>
>> Signed-off-by: Waiman Long<Waiman.Long@hpe.com>
> The patch looks good to me now. So you can add:
>
> Reviewed-by: Jan Kara<jack@suse.cz>
>
> Honza
Thanks for the review.
Cheers,
Longman
next prev parent reply other threads:[~2016-04-14 18:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 22:54 [PATCH v7 0/4] vfs: Use per-cpu list for SB's s_inodes list Waiman Long
2016-04-12 22:54 ` [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks Waiman Long
2016-04-13 2:09 ` Boqun Feng
2016-04-13 17:38 ` Waiman Long
2016-04-14 23:33 ` Boqun Feng
2016-04-15 17:14 ` Waiman Long
2016-04-13 15:03 ` Christoph Lameter
2016-04-13 17:47 ` Waiman Long
2016-04-13 18:03 ` Christoph Lameter
2016-04-14 14:10 ` Jan Kara
2016-04-14 18:48 ` Waiman Long [this message]
2016-04-12 22:54 ` [PATCH v7 2/4] fsnotify: Simplify inode iteration on umount Waiman Long
2016-04-12 22:54 ` [PATCH v7 3/4] vfs: Remove unnecessary list_for_each_entry_safe() variants Waiman Long
2016-04-12 22:54 ` [PATCH v7 4/4] vfs: Use per-cpu list for superblock's inode list Waiman Long
2016-04-14 14:20 ` Jan Kara
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=570FE5E7.5000004@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=jack@suse.cz \
--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