All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <landley@webofficenow.com>
To: "Richard B. Johnson" <root@chaos.analogic.com>,
	Damien TOURAINE <damien.touraine@limsi.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Call to the scheduler...
Date: Tue, 24 Jul 2001 15:12:19 -0400	[thread overview]
Message-ID: <01072415121901.00631@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.3.95.1010724134717.32263A-100000@chaos.analogic.com>
In-Reply-To: <Pine.LNX.3.95.1010724134717.32263A-100000@chaos.analogic.com>

On Tuesday 24 July 2001 13:54, Richard B. Johnson wrote:

> Try sched_yield(). Accounting may still be messed up so the process
> may be 'charged' for CPU time that it gave up. Also, usleep(n) works
> very well with accounting working.
>
> This works, does not seem to load the system, but `top` shows
> 99+ CPU time usage:
>
> main()
> {
>     for(;;) sched_yield();
>
> }

This may not be an accounting problem.  If the system has nothing else to do, 
it'll just re-schedule your yielding thread.

How much of that 99% cpu usage is user and how much of it is system?  
Basically what the above does is beat the scheduler to death...

> This works and `top` shows nothing being used:
>
> main()
> {
>
>     for(;;) usleep(1);
>
> }

And here you DO block for a bit without getting called back immediately.

I don't think that's an accounting thing, I think it's different behavior.  
(Could be wrong, as always...)

>
> Cheers,
> Dick Johnson

Rob

  reply	other threads:[~2001-07-25  4:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-24 17:32 Call to the scheduler Damien TOURAINE
2001-07-24 17:54 ` Richard B. Johnson
2001-07-24 19:12   ` Rob Landley [this message]
2001-07-25 11:03     ` Damien TOURAINE

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=01072415121901.00631@localhost.localdomain \
    --to=landley@webofficenow.com \
    --cc=damien.touraine@limsi.fr \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.