[RESEND PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-06-07 Thread Waiman Long
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 indiv

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-15 Thread Waiman Long
On 04/14/2016 07:33 PM, Boqun Feng wrote: On Wed, Apr 13, 2016 at 01:38:33PM -0400, Waiman Long wrote: On 04/12/2016 10:09 PM, Boqun Feng wrote: Hi Waiman, On Tue, Apr 12, 2016 at 06:54:43PM -0400, Waiman Long wrote: [...] + +/* + * Initialize the per-cpu list head + */ +int init_pcpu_list_he

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-14 Thread Boqun Feng
On Wed, Apr 13, 2016 at 01:38:33PM -0400, Waiman Long wrote: > On 04/12/2016 10:09 PM, Boqun Feng wrote: > > Hi Waiman, > > > > On Tue, Apr 12, 2016 at 06:54:43PM -0400, Waiman Long wrote: > > [...] > > > + > > > +/* > > > + * Initialize the per-cpu list head > > > + */ > > > +int init_pcpu_list_h

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-14 Thread Waiman Long
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 pe

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-14 Thread Jan Kara
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 associat

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-13 Thread Christoph Lameter
On Wed, 13 Apr 2016, Waiman Long wrote: > I am fine with a name change. I am not that good in naming stuff. How about > distributed and locked list, or dlock_list in short? dlock_list sounds better.

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-13 Thread Waiman Long
On 04/12/2016 10:09 PM, Boqun Feng wrote: Hi Waiman, On Tue, Apr 12, 2016 at 06:54:43PM -0400, Waiman Long wrote: [...] + +/* + * Initialize the per-cpu list head + */ +int init_pcpu_list_head(struct pcpu_list_head **ppcpu_head) +{ + struct pcpu_list_head *pcpu_head = alloc_percpu(struct

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-13 Thread Waiman Long
On 04/13/2016 11:03 AM, Christoph Lameter wrote: On Tue, 12 Apr 2016, Waiman Long wrote: 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 b

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-13 Thread Christoph Lameter
On Tue, 12 Apr 2016, Waiman Long wrote: > 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

Re: [PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-12 Thread Boqun Feng
Hi Waiman, On Tue, Apr 12, 2016 at 06:54:43PM -0400, Waiman Long wrote: [...] > + > +/* > + * Initialize the per-cpu list head > + */ > +int init_pcpu_list_head(struct pcpu_list_head **ppcpu_head) > +{ > + struct pcpu_list_head *pcpu_head = alloc_percpu(struct pcpu_list_head); > + int cpu;

[PATCH v7 1/4] lib/percpu-list: Per-cpu list with associated per-cpu locks

2016-04-12 Thread Waiman Long
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 indiv