From: matthieu castet <castet.matthieu@free.fr>
To: Ingo Molnar <mingo@elte.hu>
Cc: Lee Revell <rlrevell@joe-job.com>,
tglx@linutronix.de,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: High Resolution Timer DOS
Date: Sun, 29 Apr 2007 18:08:16 +0200 [thread overview]
Message-ID: <4634C2F0.8050101@free.fr> (raw)
In-Reply-To: <20070429071743.GA4532@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]
Ingo Molnar wrote:
> * Lee Revell <rlrevell@joe-job.com> wrote:
>
>>> Well, it is not really a DoS. The rescheduling of the process is
>>> limited by the scheduler and the available CPU time (depending on
>>> the number of runnable tasks in the system).
>> Shouldn't an unprivileged process be rate limited somehow to avoid
>> flooding the machine with interrupts? We restrict nonroot users from
>> setting the RTC interrupt rate higher than 64Hz for a similar reason
>> (granted, this limit dates back to the 486 days and should probably be
>> increased to 1024 Hz).
>
> No. An interrupt in this case is really just 'CPU time used up', and an
> unprivileged process can take up as much CPU time as the scheduler
> allows. So it's _not_ a DoS, and neither is any other unprivileged
> infinit loop (or high-rate context-switching task) a DoS.
Ok, may be DOS was not the correct term, but with the 2.6.21 hrt there
is a great difference between an infinite loop and the high-rate
context-switching task (you can try attached programs).
With the first I the system is still responsive, with the latter it
isn't (new process take lot's of time to get created, other process are
very slow).
If it is "just 'CPU time used up'", why I see a such difference between
the 2 cases ?
Maybe the current scheduler failed to handle correctly this case ?
Matthieu
[-- Attachment #2: infinite_loop.c --]
[-- Type: text/x-csrc, Size: 134 bytes --]
#include <string.h>
#include <sys/time.h>
#include <time.h>
int main()
{
struct timeval tv;
while (1)
gettimeofday(&tv, NULL);
}
[-- Attachment #3: small_sleep.c --]
[-- Type: text/x-csrc, Size: 39 bytes --]
int main()
{
while (1)
usleep(1);
}
next prev parent reply other threads:[~2007-04-29 16:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-28 21:53 High Resolution Timer DOS matthieu castet
2007-04-28 22:13 ` Thomas Gleixner
2007-04-28 22:37 ` Lee Revell
2007-04-28 22:45 ` William Heimbigner
2007-04-29 7:17 ` Ingo Molnar
2007-04-29 16:08 ` matthieu castet [this message]
2007-04-29 16:42 ` Ingo Molnar
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=4634C2F0.8050101@free.fr \
--to=castet.matthieu@free.fr \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rlrevell@joe-job.com \
--cc=tglx@linutronix.de \
/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