public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Nick Piggin <npiggin@suse.de>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC][PATCH]: wait: don't resched in prepare_to_wait()
Date: Fri, 6 Mar 2009 16:41:44 +0100	[thread overview]
Message-ID: <20090306154144.GA7841@redhat.com> (raw)
In-Reply-To: <1236350377.6326.389.camel@laptop>

On 03/06, Peter Zijlstra wrote:
>
> After prepare to wait, we either call schedule() or find !cond in which
> case we'll call finish_wait() which contains another preemption check.
>
> @@ -73,7 +73,9 @@ prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state)
>  	if (list_empty(&wait->task_list))
>  		__add_wait_queue(q, wait);
>  	set_current_state(state);
> +	preempt_disable();
>  	spin_unlock_irqrestore(&q->lock, flags);
> +	preempt_enable_no_resched();

But this only helps if the task gets TIF_NEED_RESCHED while it was in
spin_lock_irqsave() section, right? This window should be very small
unless we have the contention.

Or do you have something else in mind?

Oleg.


  reply	other threads:[~2009-03-06 15:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 14:39 [RFC][PATCH]: wait: don't resched in prepare_to_wait() Peter Zijlstra
2009-03-06 15:41 ` Oleg Nesterov [this message]
2009-03-06 15:47   ` Peter Zijlstra

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=20090306154144.GA7841@redhat.com \
    --to=oleg@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=peterz@infradead.org \
    --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