From: Davide Libenzi <davidel@xmailserver.org>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: schedule()
Date: Tue, 26 Feb 2002 12:50:41 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.44.0202261249280.1544-100000@blue1.dev.mcafeelabs.com> (raw)
In-Reply-To: <Pine.LNX.3.95.1020226154406.6812A-100000@chaos.analogic.com>
On Tue, 26 Feb 2002, Richard B. Johnson wrote:
> On Tue, 26 Feb 2002, Davide Libenzi wrote:
>
> > On Tue, 26 Feb 2002, Richard B. Johnson wrote:
> >
> > > On Tue, 26 Feb 2002, Davide Libenzi wrote:
> > >
> > > > On Tue, 26 Feb 2002, Richard B. Johnson wrote:
> > > >
> > > > >
> > > > >
> > > > > I just read on this list that:
> > > > >
> > > > > while(something)
> > > > > {
> > > > > current->policy |= SCHED_YIELD;
> > > > > schedule();
> > > > > }
> > > > >
> > > > > Will no longer be allowed in a kernel module! If this is true, how
> > > > > do I loop, waiting for a bit in a port, without wasting CPU time?
> > > > >
> > > > > A lot of hardware does not generate interrupts upon a condition,
> > > > > there is no CPU activity that could send a wake_up_interruptible()
> > > > > to something sleeping.
> > > > >
> > > > > For instance, I need to write data to a hardware FIFO, one long-word
> > > > > at a time, but I can't just write. I have to wait for a bit to be
> > > > > set or reset for each and every write. I'm going to be burning a
> > > > > lot of CPU cycles if I can't schedule() while the trickle-down-effect
> > > > > of the hardware is happening.
> > > >
> > > > What did it do yield() to you ? Doesn't it work for your case ?
> > > >
> > > There isn't one in 2.4.x I'll modify my drivers to use YIELD
> > > and #define it depending upon version.
> >
> > In 2.5 yield() maps to sys_sched_yield(). You can handle it in the same
> > way in your includes if version <= 2.4.
> >
> >
>
> Can't find it in any header file.
>
> Script started on Tue Feb 26 15:45:06 2002
> # grep "sys_sched_yield()" /usr/src/linux/include/linux/*.h
> # grep "sys_sched_yield()" /usr/src/linux/include/asm/*.h
> You have new mail in /var/spool/mail/root
> # exit
> exit
>
> Script done on Tue Feb 26 15:46:46 2002
>
> I'll #define a macro and be done with it.
It'd be too easy if it'd be inside an header file :-)
asmlinkage long sys_sched_yield(void);
in kernel/sched.c
- Davide
next prev parent reply other threads:[~2002-02-26 20:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-26 19:57 schedule() Richard B. Johnson
2002-02-26 20:05 ` schedule() Jeff Garzik
2002-02-26 20:14 ` schedule() Richard B. Johnson
2002-02-27 0:56 ` schedule() Nigel Gamble
2002-02-27 15:29 ` schedule() Richard B. Johnson
2002-02-26 20:13 ` schedule() Davide Libenzi
2002-02-26 20:17 ` schedule() Richard B. Johnson
2002-02-26 20:19 ` schedule() Davide Libenzi
2002-02-26 20:47 ` schedule() Richard B. Johnson
2002-02-26 20:50 ` Davide Libenzi [this message]
2002-02-26 21:14 ` schedule() Richard B. Johnson
2002-02-26 22:37 ` schedule() Davide Libenzi
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=Pine.LNX.4.44.0202261249280.1544-100000@blue1.dev.mcafeelabs.com \
--to=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--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®