mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Subhra Mazumdar <subhra.mazumdar@oracle.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	dhaval.giani@oracle.com, steven.sistare@oracle.com
Subject: Re: [RFC PATCH 2/2] pipe: use pipe busy wait
Date: Tue, 4 Sep 2018 17:20:11 -0700	[thread overview]
Message-ID: <e5f02d36-590d-e15c-01a5-60f1f890fbb2@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1809042351220.1416@nanos.tec.linutronix.de>



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
>


  reply	other threads:[~2018-09-05  0:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 20:24 [RFC PATCH 0/2] Pipe " subhra mazumdar
2018-08-30 20:24 ` [RFC PATCH 1/2] pipe: introduce busy wait for pipe subhra mazumdar
2018-08-31 16:09   ` Steven Sistare
2018-09-05  0:50     ` Subhra Mazumdar
2018-09-05 13:45       ` Steven Sistare
2018-08-30 20:24 ` [RFC PATCH 2/2] pipe: use pipe busy wait subhra mazumdar
2018-09-04 21:54   ` Thomas Gleixner
2018-09-05  0:20     ` Subhra Mazumdar [this message]
2018-09-07 12:25   ` Peter Zijlstra
2018-09-17 21:05     ` Subhra Mazumdar
2018-09-17 22:43       ` Peter Zijlstra
2018-09-18  1:07         ` Subhra Mazumdar
2018-08-30 20:48 ` [RFC PATCH 0/2] Pipe " Subhra Mazumdar

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=e5f02d36-590d-e15c-01a5-60f1f890fbb2@oracle.com \
    --to=subhra.mazumdar@oracle.com \
    --cc=dhaval.giani@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=steven.sistare@oracle.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®