From: Mike Galbraith <efault@gmx.de>
To: Amol Lad <dal_loma@yahoo.com>, Arjan van de Ven <arjanv@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: wake_up from interrupt handler
Date: Mon, 07 Oct 2002 19:44:10 +0200 [thread overview]
Message-ID: <5.1.0.14.2.20021007191310.00b4e268@pop.gmx.net> (raw)
In-Reply-To: <20021007142520.56164.qmail@web12406.mail.yahoo.com>
At 07:25 AM 10/7/2002 -0700, Amol Lad wrote:
>In this code too.. lost-wakeup problem is not solved
>
>if (event_occured)
> else
> schedule();
>
>what if in check ' if(event_occured) ' goes to 'else'
>and before calling schedule() my ISR interrupted this
>thread and set the event..
(yes, this is what I was thinking about)
>Also Mike told to disable the interrupt before
>checking for event... So When to enable interrupts
>then ??
(this mike)
Well, disabling interrupts as a solution aside :), why are you checking for
event in the kthread? It seems to me that receipt of wakeup has to be the
sole knowledge that the event happened, else a race is a done deal. (no?)
-Mike
>
>--- Arjan van de Ven <arjanv@redhat.com> wrote:
> > On Mon, 2002-10-07 at 14:41, Amol Lad wrote:
> > > Hi,
> > > I have a kernel thread which did
> > add_to_wait_queue()
> > > to wait for an event.
> > > The event for which above thread is waiting occurs
> > in
> > > an interrupt handler that calls wake_up() to wake
> > the
> > > above thread.
> > > Now I am faced with a 'lost wakeup' problem, in
> > which
> > > the
> > > kernel thread checks whether event occured, he
> > finds
> > > it to be 'not-occured' but before calling
> > > add_to_wait_queue(), interrupt handler detects
> > that
> > > the event has occured and calls wake_up().
> > > My thread sleeps forever.
> >
> > set_current_state(TASK_INTERRUPTIBLE);
> > add_to_wait_queue(...);
> > if (even_occured) { ...}
> > else
> > schedule();
> >
> > remove_from_wait_queue(..);
> > set_current_state(TASK_RUNNABLE);
> >
> >
> > >
> >
> >
>
> > ATTACHMENT part 2 application/pgp-signature
>name=signature.asc
>
>
>
>__________________________________________________
>Do you Yahoo!?
>Faith Hill - Exclusive Performances, Videos & More
>http://faith.yahoo.com
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2002-10-07 17:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-07 12:41 Amol Lad
2002-10-07 13:04 ` Arjan van de Ven
2002-10-07 14:25 ` Amol Lad
2002-10-07 15:36 ` Arjan van de Ven
2002-10-07 17:44 ` Mike Galbraith [this message]
2002-10-07 22:52 ` Rui Sousa
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=5.1.0.14.2.20021007191310.00b4e268@pop.gmx.net \
--to=efault@gmx.de \
--cc=arjanv@redhat.com \
--cc=dal_loma@yahoo.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®