From: Dave Dillow <dave@thedillows.org>
To: root@chaos.analogic.com
Cc: Roland Dreier <roland@topspin.com>,
Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: poll() in 2.6 and beyond
Date: Tue, 02 Mar 2004 17:41:18 -0500 [thread overview]
Message-ID: <1078267278.31309.37.camel@dillow.idleaire.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0403021651010.9048@chaos>
On Tue, 2004-03-02 at 16:59, Richard B. Johnson wrote:
> On Tue, 2 Mar 2004, Roland Dreier wrote:
> > I don't know why I continue this, but.... can you point out the line
> > in the kernel 2.4 source for __pollwait() where it sleeps?
> The code in fs/select.c about line 101, adds the current caller
> to the wait-queue. This wait-queue is the mechanism by which the
> current caller sleeps, i.e., gives the CPU up to somebody else.
Actually, no, it does not work that way. The wait queue is the mechanism
by which a process can be *woken up* . The call to add_wait_queue() does
not put the process to sleep.
The process is put to sleep in do_poll(), using schedule_timeout() with
the current state as TASK_INTERRUPTIBLE. This is on line 453.
Your driver will eventually have to wake up sleepers on the queue.
do_poll() will also wake up when the timeout expires, or a signal is
sent to the poll()'ing process.
These semantics have not changed since 2.4. The implementation has
changed a bit, but the driver interface has not changed. Read the
documentation the Roland pointed you to.
--
Dave Dillow <dave@thedillows.org>
next prev parent reply other threads:[~2004-03-02 22:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-02 18:21 Richard B. Johnson
2004-03-02 20:04 ` Roland Dreier
2004-03-02 20:24 ` Richard B. Johnson
2004-03-02 21:00 ` Roland Dreier
2004-03-02 21:26 ` Richard B. Johnson
2004-03-02 21:39 ` Roland Dreier
2004-03-02 21:59 ` Richard B. Johnson
2004-03-02 22:41 ` Dave Dillow [this message]
2004-03-02 22:56 ` Roland Dreier
2004-03-02 23:16 ` Richard B. Johnson
2004-03-02 23:21 ` Roland Dreier
[not found] <1vmPm-4lU-11@gated-at.bofh.it>
[not found] ` <1vonq-6dr-37@gated-at.bofh.it>
[not found] ` <1voGY-6vC-41@gated-at.bofh.it>
[not found] ` <1vpjt-7dl-17@gated-at.bofh.it>
[not found] ` <1vpCV-7wY-41@gated-at.bofh.it>
[not found] ` <1vpWa-7Py-19@gated-at.bofh.it>
2004-03-02 22:53 ` Bill Davidsen
2004-03-02 22:57 ` Roland Dreier
2004-03-02 23:32 ` Richard B. Johnson
2004-03-03 0:07 ` John Muir
2004-03-03 1:18 ` Richard B. Johnson
2004-03-03 4:04 ` Roland Dreier
2004-03-03 12:38 ` Richard B. Johnson
2004-03-03 14:29 ` Davide Libenzi
2004-03-03 3:57 ` David Dillow
2004-03-03 18:23 ` Richard B. Johnson
2004-03-03 19:29 ` Dave Dillow
2004-03-03 20:10 ` Richard B. Johnson
2004-03-03 22:25 ` Linus Torvalds
2004-03-03 22:42 ` Richard B. Johnson
2004-03-03 23:14 ` Linus Torvalds
2004-03-03 22:52 ` Linus Torvalds
2004-03-03 23:07 ` Richard B. Johnson
2004-03-03 3:06 linux
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=1078267278.31309.37.camel@dillow.idleaire.com \
--to=dave@thedillows.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@topspin.com \
--cc=root@chaos.analogic.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
all inboxes | Powered by JetHome®