public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Parag Warudkar <kernel-stuff@comcast.net>
To: manoj.sharma@wipro.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Is wake_up safe on 2.4?
Date: Sun, 29 May 2005 11:15:54 -0400	[thread overview]
Message-ID: <200505291115.54370.kernel-stuff@comcast.net> (raw)
In-Reply-To: <689F43A6CF84E541A721C5C3FD5ADECC030B5354@blr-m3-msg.wipro.com>

On Sunday 29 May 2005 10:28, manoj.sharma@wipro.com wrote:
> Is it safe to use wake_up() in 2.4 inside an interrupt handler or in a
> spin lock region?
>
> wake_up() uses reshedule_idle() to find an idle cpu for the woken up
> task. If it doesn't find any, it checks the current running tasks on all
> CPUs and uses goodness value to pick up the best cpu to schedule the
> woken up task.  Isn't possible to preempt the current task where
> reschedule_idle() is running?
>
> There are plenty of instances in the kernel (2.4) where wake_up() is
> being used inside interrupt handler or after taking spin locks. If it
> can preempt the task calling wake_up(), how safe is it to use then?

Looking at the code - On SMP, the woken up task will be always scheduled on a 
CPU other than the one executing the caller, in which case caller of 
wake_up() is not pre-empted. On UP, it just sets need_resched (different than 
calling schedule() ) in which case the caller of wake_up() will be 
rescheduled only when appropriate, when it is safe to preempt it.

      reply	other threads:[~2005-05-29 15:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-29 14:28 Is wake_up safe on 2.4? manoj.sharma
2005-05-29 15:15 ` Parag Warudkar [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=200505291115.54370.kernel-stuff@comcast.net \
    --to=kernel-stuff@comcast.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manoj.sharma@wipro.com \
    /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