public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Race in salinfo.c?
Date: Mon, 13 Oct 2003 15:24:42 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106605905131089@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106603536206819@msgid-missing>

On Monday 13 October 2003 2:55 am, Keith Owens wrote:
> I need a sanity check on the existing salinfo.c code, it looks like a
> race.
> 
> salinfo_log_wakeup()
> 
>   set_bit(smp_processor_id(), &event->cpu_mask);
>   wake_up_interruptible(&event->queue);
> 
> salinfo_event_read()
> 
>   if (!event->cpu_mask) {
>     ...
>     interruptible_sleep_on(&event->queue);
> 
> 
> 
>       cpu 0                                   cpu 1
> salinfo_log_wakeup                      salinfo_event_read
>                                         event->cpu_mask = 0
> set_bit()
> wake_up_interruptible(), nothing on
> the queue
>                                         interruptible_sleep_on()
> 
> cpu 1 missed the event.  It will only be picked up if another salinfo
> event occurs and calls wake_up_interruptible() a second time.

I think you're right.


  reply	other threads:[~2003-10-13 15:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-13  8:55 Race in salinfo.c? Keith Owens
2003-10-13 15:24 ` Bjorn Helgaas [this message]
2003-10-16  6:58 ` Keith Owens

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=marc-linux-ia64-106605905131089@msgid-missing \
    --to=bjorn.helgaas@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /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