From: Arjan van de Ven <arjan@infradead.org>
To: jplatte@naasa.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: Userspace process may be able to DoS kernel
Date: Sat, 11 Nov 2006 13:39:33 +0100 [thread overview]
Message-ID: <1163248773.3293.20.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <200611111329.17206.lists@naasa.net>
On Sat, 2006-11-11 at 13:29 +0100, Joerg Platte wrote:
> Am Freitag, 10. November 2006 08:19 schrieb Andrew Morton:
>
> > OK, thanks.
> >
> > It'd be useful if you could grab a kernel profile when the system load is
> > high:
>
> > Or, if oprofile is working:
> >
> >
> > #!/bin/sh
> > sudo opcontrol --stop
> > sudo opcontrol --shutdown
> > sudo rm -rf /var/lib/oprofile
> > sudo opcontrol --vmlinux=/boot/vmlinux-$(uname -r)
> > sudo opcontrol --start-daemon
> > sudo opcontrol --start
> > sleep 10
> > sudo opcontrol --stop
> > sudo opcontrol --shutdown
> > sudo opreport -l /boot/vmlinux-$(uname -r) | head -50
>
> Here is the oprofile log. Seems to be acpi related?
>
> CPU: CPU with timer interrupt, speed 0 MHz (estimated)
> Profiling through timer interrupt
> samples % symbol name
> 709 44.2848 acpi_pm_read
this isn't per se acpi related: This is reading the PM timer from your
chipset. The PMTimer is a clock on your chipset that the kernel can use
to read a stable incrementing clock to find out what time it is right
now, usually as part of userspace asking the kernel what time it is via
the gettimeofday() system call. ACPI is just the component that does the
actual (slow) hardware access... eg the messenger.
Normally systems have better/faster clocks than the pmtimer, but there
are circumstances where those can't be used.
1) HPET. The HPET is a lot faster than pmtimer, and very reliable. Most
of the systems sold in the last 3 years have an hpet, but unfortunately,
many bioses turn this off by default. If your BOOS has a "Multimedia
timer" setting, make sure it's set to "On".
2) TSC. This is a super fast method of finding how much time has passed,
since it's inside the CPU. However there are many reasons why this
method may be unreliable, for example certain powermanagement features
on laptops cause this clock to stop when idle (not useful), or to vary
in frequency (also not useful if you want to find out what time it is).
Also on AMD Opteron SMP systems or extreme Intel big honking NUMA
systems, this timer is not synchronized between the various processors
and that breaks the current time keeping in Linux, and so Linux doesn't
use it in that case.
So my advice is
1) Check the bios to see if you have the HPET enabled. If not, enable
it.
2) Check the kernel config to see if you have HPET enabled there, if not
enable it.
3) Check dmesg to see if there's a reason the kernel doesn't use TSC;
there is probably nothing you can do but at least you know why :)
--
if you want to mail me at work (you don't), use arjan (at) linux.intel.com
Test the interaction between Linux and your BIOS via http://www.linuxfirmwarekit.org
next prev parent reply other threads:[~2006-11-11 12:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 16:54 Günther Starnberger
2006-10-12 6:02 ` Joerg Platte
2006-10-12 6:49 ` Willy Tarreau
2006-10-12 10:54 ` Joerg Platte
2006-10-12 11:30 ` Pekka Enberg
2006-10-12 11:41 ` Joerg Platte
2006-10-12 11:57 ` Pekka Enberg
2006-10-12 20:11 ` Joerg Platte
2006-10-12 20:25 ` Günther Starnberger
2006-10-13 13:24 ` Joerg Platte
2006-10-12 15:51 ` Lee Revell
2006-10-12 16:55 ` Günther Starnberger
2006-10-12 17:05 ` Lee Revell
2006-10-12 20:30 ` Günther Starnberger
2006-10-12 20:37 ` Lee Revell
2006-10-12 15:56 ` Lee Revell
2006-10-12 16:10 ` Jan Engelhardt
2006-10-12 16:19 ` Lee Revell
2006-10-12 22:02 ` Jan Engelhardt
[not found] ` <200611100803.03958.lists@naasa.net>
[not found] ` <20061109231958.f18cd1ef.akpm@osdl.org>
2006-11-11 12:29 ` Joerg Platte
2006-11-11 12:39 ` Arjan van de Ven [this message]
2006-11-11 13:15 ` Joerg Platte
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=1163248773.3293.20.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=jplatte@naasa.net \
--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 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®