Re: [PATCH 3/3] epoll: use rwlock in order to reduce ep_poll_callback() contention

2018-12-13 Thread Roman Penyaev
On 2018-12-13 12:19, Andrea Parri wrote: On Thu, Dec 13, 2018 at 11:13:58AM +0100, Roman Penyaev wrote: On 2018-12-12 18:13, Andrea Parri wrote: > On Wed, Dec 12, 2018 at 12:03:57PM +0100, Roman Penyaev wrote: [...] > > +static inline void list_add_tail_lockless(struct list_head *new, > > +

Re: [PATCH 3/3] epoll: use rwlock in order to reduce ep_poll_callback() contention

2018-12-13 Thread Andrea Parri
On Thu, Dec 13, 2018 at 11:13:58AM +0100, Roman Penyaev wrote: > On 2018-12-12 18:13, Andrea Parri wrote: > > On Wed, Dec 12, 2018 at 12:03:57PM +0100, Roman Penyaev wrote: > > [...] > > > > +static inline void list_add_tail_lockless(struct list_head *new, > > > +

Re: [PATCH 3/3] epoll: use rwlock in order to reduce ep_poll_callback() contention

2018-12-13 Thread Roman Penyaev
On 2018-12-12 18:13, Andrea Parri wrote: On Wed, Dec 12, 2018 at 12:03:57PM +0100, Roman Penyaev wrote: [...] +static inline void list_add_tail_lockless(struct list_head *new, + struct list_head *head) +{ + struct list_head *prev; + + new->n

[PATCH 3/3] epoll: use rwlock in order to reduce ep_poll_callback() contention

2018-12-12 Thread Roman Penyaev
The goal of this patch is to reduce contention of ep_poll_callback() which can be called concurrently from different CPUs in case of high events rates and many fds per epoll. Problem can be very well reproduced by generating events (write to pipe or eventfd) from many threads, while consumer threa