Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-17 Thread Subhra Mazumdar
On 09/17/2018 03:43 PM, Peter Zijlstra wrote: On Mon, Sep 17, 2018 at 02:05:40PM -0700, Subhra Mazumdar wrote: On 09/07/2018 05:25 AM, Peter Zijlstra wrote: Why not just busy wait on current->state ? A little something like: diff --git a/fs/pipe.c b/fs/pipe.c index bdc5d3c0977d..8d9f1c95ff9

Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-17 Thread Peter Zijlstra
On Mon, Sep 17, 2018 at 02:05:40PM -0700, Subhra Mazumdar wrote: > On 09/07/2018 05:25 AM, Peter Zijlstra wrote: > >Why not just busy wait on current->state ? A little something like: > > > >diff --git a/fs/pipe.c b/fs/pipe.c > >index bdc5d3c0977d..8d9f1c95ff99 100644 > >--- a/fs/pipe.c > >+++ b/f

Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-17 Thread Subhra Mazumdar
On 09/07/2018 05:25 AM, Peter Zijlstra wrote: On Thu, Aug 30, 2018 at 01:24:58PM -0700, subhra mazumdar wrote: +void pipe_busy_wait(struct pipe_inode_info *pipe) +{ + unsigned long wait_flag = pipe->pipe_wait_flag; + unsigned long start_time = pipe_busy_loop_current_time(); + +

Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-07 Thread Peter Zijlstra
On Thu, Aug 30, 2018 at 01:24:58PM -0700, subhra mazumdar wrote: > +void pipe_busy_wait(struct pipe_inode_info *pipe) > +{ > + unsigned long wait_flag = pipe->pipe_wait_flag; > + unsigned long start_time = pipe_busy_loop_current_time(); > + > + pipe_unlock(pipe); > + preempt_disable

Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-04 Thread Subhra Mazumdar
On 09/04/2018 02:54 PM, Thomas Gleixner wrote: On Thu, 30 Aug 2018, subhra mazumdar wrote: +void pipe_busy_wait(struct pipe_inode_info *pipe) +{ + unsigned long wait_flag = pipe->pipe_wait_flag; + unsigned long start_time = pipe_busy_loop_current_time(); + + pipe_unlock(p

Re: [RFC PATCH 2/2] pipe: use pipe busy wait

2018-09-04 Thread Thomas Gleixner
On Thu, 30 Aug 2018, subhra mazumdar wrote: > > +void pipe_busy_wait(struct pipe_inode_info *pipe) > +{ > + unsigned long wait_flag = pipe->pipe_wait_flag; > + unsigned long start_time = pipe_busy_loop_current_time(); > + > + pipe_unlock(pipe); > + preempt_disable(); > + for (

[RFC PATCH 2/2] pipe: use pipe busy wait

2018-08-30 Thread subhra mazumdar
Enable busy waiting for pipes. pipe_busy_wait is called if pipe is empty or full which spins for specified micro seconds. wake_up_busy_poll is called when data is written or read to signal any busy waiting threads. A tunable pipe_busy_poll is introduced to enable or disable busy waiting via /proc.