From: Peter Zijlstra <peterz@infradead.org>
To: Oleg Nesterov <oleg@redhat.com>
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, 06 Mar 2009 16:47:04 +0100 [thread overview]
Message-ID: <1236354424.6326.460.camel@laptop> (raw)
In-Reply-To: <20090306154144.GA7841@redhat.com>
On Fri, 2009-03-06 at 16:41 +0100, Oleg Nesterov wrote:
> 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?
No, that was exactly it, we then get preempted only to go to sleep right
afterwards, which would cause a schedule anyway.
So its avoiding a schedule.
prev parent reply other threads:[~2009-03-06 15:47 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
2009-03-06 15:47 ` Peter Zijlstra [this message]
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=1236354424.6326.460.camel@laptop \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=npiggin@suse.de \
--cc=oleg@redhat.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