lkml.org 
[lkml]   [2018]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 2/2] pipe: use pipe busy wait
From
Date


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(pipe);
>> + preempt_disable();
>> + for (;;) {
>> + if (pipe->pipe_wait_flag > wait_flag) {
>> + preempt_enable();
>> + pipe_lock(pipe);
>> + return;
>> + }
>> + if (pipe_busy_loop_timeout(pipe, start_time))
>> + break;
>> + cpu_relax();
>> + }
>> + preempt_enable();
> You are not really serious about busy looping with preemption disabled?
>
> That's just wrong. Why do you want to block others from getting on the CPU
> if there is nothing in the pipe?
>
> There is no point in doing so, really. If the wait loop is preempted
> because there is more important work to do, then it will come back and
> either see new data, or leave due to wait time reached.
Makes sense. I will remove it.

Thanks,
Subhra
>
> Thanks,
>
> tglx
>

\
 
 \ /
  Last update: 2018-09-05 02:21    [W:0.136 / U:9.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site