All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chad N. Tindel" <chad@tindel.net>
To: Helge Hafting <helge.hafting@aitel.hist.no>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: Xterm Hangs - Possible scheduler defect?
Date: Thu, 24 Feb 2005 12:33:56 -0500	[thread overview]
Message-ID: <20050224173356.GA11593@calma.pair.com> (raw)
In-Reply-To: <421DD5CC.5060106@aitel.hist.no>

> Why would anyone write a thread than uses exactly 100% of one cpu?
> It seems wrong to me.  It is unsafe if they really need that much
> processing power, what if an interrupt happens? Then they get slightly less.
> If they got a 10% faster cpu, would this thread suddenly drop to 90%
> usage (and no problems with kernel threads)? 
> If it stays at 100% then that suggests they are using some
> sort of busy waiting which is bad programming.  Get a better hw
> device that will provide an interrupt at the right time, and write a 
> driver for
> that.  Or find some spot in the code where a small delay in acceptable,
> and set a short timer and sleep on it. It doesn't take much to get this
> kernel thread going.

I would make the following assertion for any kernel:

No single userspace thread of execution running on an SMP system should be 
able to hose a box by going CPU-bound, bug in the software or no bug.  Any
kernel should be able to handle this case and shift general work over to
other processors.

While I can't speak for all commercial Unixes, I know that HP-UX handles this
case just fine.  I'd be extremely surprised if Solaris and AIX didn't handle
it fine too.  What I can't understand is why you want to cop-out and say
"Oh well this is just a bug in the application... the programmer shouldn't
shoot himself in the foot."  If that were the attitude that kernel programmers
had, why have the kernel send SIGSEGV when applications reference invalid 
memory?  Why not just let them corrupt the memory of other apps and possibly
bring the whole system down?

It is the kernel's job to protect itself and userspace applications from 
runaway applications whenever possible.  While this might not be possible for 
this case on a UP box, it certainly is for an SMP box.

Chad

  reply	other threads:[~2005-02-24 17:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23 23:06 Xterm Hangs - Possible scheduler defect? Chad N. Tindel
2005-02-24  2:36 ` Andrew Morton
2005-02-24  5:23   ` Chad N. Tindel
2005-02-24  6:50     ` Andrew Morton
2005-02-24  5:26   ` Chad N. Tindel
2005-02-24 13:25     ` Helge Hafting
2005-02-24 17:33       ` Chad N. Tindel [this message]
2005-02-24 22:25         ` Peter Chubb
2005-02-24 22:40           ` Chad N. Tindel
2005-02-24 23:00         ` Andrew Morton
2005-02-24 23:22           ` Chris Friesen
2005-02-24 23:32             ` Andrew Morton
2005-02-25  0:47           ` Kyle Moffett
     [not found] <20050224075756.GA18639@calma.pair.com>
     [not found] ` <30111.1109237503@www1.gmx.net>
2005-02-24 17:53   ` Chad N. Tindel
2005-02-24 18:19     ` Chris Friesen
2005-02-24 18:38       ` Chad N. Tindel
2005-02-24 19:04         ` Paulo Marques
2005-02-24 19:22           ` Chad N. Tindel
2005-02-24 19:46             ` Chris Friesen
2005-02-24 20:08               ` Chad N. Tindel
2005-02-24 20:29                 ` Chris Friesen
2005-02-25  0:51                 ` Ingo Oeser
2005-02-25 15:12                   ` Chris Friesen
2005-02-25 15:39                     ` Ingo Oeser
2005-02-25 15:53                       ` Paulo Marques
2005-02-25 16:24                         ` Lee Revell
2005-02-25 17:07                           ` Chris Friesen
2005-02-24 19:52             ` Barry K. Nathan
2005-02-25 20:25             ` Helge Hafting
2005-02-25 21:02               ` Chad N. Tindel
2005-02-25 23:24                 ` Lee Revell
2005-02-26 11:58                 ` Helge Hafting
2005-02-25  4:25     ` Mike Galbraith

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=20050224173356.GA11593@calma.pair.com \
    --to=chad@tindel.net \
    --cc=akpm@osdl.org \
    --cc=helge.hafting@aitel.hist.no \
    --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 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.