From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Bart Van Assche <bart.vanassche@gmail.com>,
John Reiser <jreiser@BitWagon.com>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Christoph Lameter <clameter@sgi.com>,
Daniel Walker <dwalker@mvista.com>,
Andi Kleen <andi@firstfloor.org>,
Randy Dunlap <randy.dunlap@oracle.com>,
Josh Aune <luken@omner.org>, Pekka Paalanen <pq@iki.fi>
Subject: Re: [ANNOUNCE] kmemcheck v7
Date: Sat, 10 May 2008 18:17:21 +0100 [thread overview]
Message-ID: <4825D8A1.30008@goop.org> (raw)
In-Reply-To: <19f34abd0805100502k150e3636x33831230d688dd92@mail.gmail.com>
Vegard Nossum wrote:
> Hi!
>
> On Sat, May 10, 2008 at 1:04 PM, Bart Van Assche
> <bart.vanassche@gmail.com> wrote:
>
>>> Bart Van Assche wrote:
>>>
>>>> It's a bit late but I finally found out about your announcement of
>>>> kmemcheck version 7. Are you familiar with the patch that adds support
>>>> to Valgrind for User Mode Linux ? I'm not sure what the best approach
>>>> is -- letting the kernel do its own checking like kmemcheck or extend
>>>> Valgrind such that it supports UML. Anyway, the techniques applied in
>>>> Valgrind may be useful for kmemcheck too, such as the algorithms used
>>>> in Valgrind to compress the memory state information.
>>>>
>
> Yes, I have learned of it not so long ago, around January or so. I
> wanted to stop kmemcheck development back then, but Ingo and Pekka
> convinced me that it could still be useful :-)
>
> (The link is http://bitwagon.com/valgrind+uml/index.html)
>
> I guess the main disadvantages of using kmemcheck over valgrind-memcheck are:
> - kmemcheck can only warn eagerly, whereas memcheck will wait until
> the uninitialized bits are actually used. This means that kmemcheck
> will report many false positives. (We have some workarounds but this
> is obviously not perfect.)
> - kmemcheck can only warn for dynamic memory, whereas kmemcheck I
> believe will also work for local variables, static variables, etc.
>
> It would be interesting to compare the output of kmemcheck vs. the
> output of memcheck, though.
>
>
>> On Sat, May 10, 2008 at 11:06 AM, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
>>
>>> It's better to do it with the native kernel so you can "valgrind" all the
>>> interesting driver code.
>>>
>> That's right. This is the paper I was referring to that details how to
>> minimize the memory consumption when tracking state information:
>> http://www.valgrind.org/docs/shadow-memory2007.pdf
>>
>
> Thanks. I have actually seen the paper before, but not read all of it.
> From a quick glace, it seems that the optimizations described there
> apply to the tracking of individual bits within a byte, but since we
> are tracking by byte granularity (as opposed to bit granularity), it
> also seems irrelevant to kmemcheck. (I am not saying that it isn't
> interesting, however.)
>
> Currently, we are using a full byte for each shadowed byte. Since we
> actually only use two bits out of eight, we could save three fourths
> compared to what we use today.
>
> However, memory usage doesn't seem to be much of a problem. I actually
> think it might be worth saving the CPU cycles that are needed for the
> lookups/bit operations (memory is cheap, cycles aren't). How is the
> speed of Valgrind+UML, does anybody know? Isn't there a problem that
> Valgrind will have to emulate all the userspace programs as well?
> That, I believe, would make the Valgrinded system painfully slow to
> work with. I have no benchmarks or profiler results to refer to, but
> kmemcheck at least boots to full userspace+X and is still quite
> usable.
No, I think valgrind+uml deliberately lets usermode code run directly on
the cpu, not under valgrind. Having the option to run everything under
Valgrind would be interesting, since it would allow you to trace
uninitialized values crossing the user-kernel boundary (both ways)
indicating either usermode or kernel bugs (also user to user via the
kernel, such as via a pipe).
I've thought about, but not actually implemented, running valgrind as a
Xen guest, and then running a sub-guest under it, allowing you to run an
entire virtual machine under Valgrind. I think people have done vaguely
similar stuff with qemu.
J
next prev parent reply other threads:[~2008-05-10 17:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-04 13:44 [ANNOUNCE] kmemcheck v7 Vegard Nossum
2008-04-04 13:45 ` [PATCH 1/3] kmemcheck: add the kmemcheck core Vegard Nossum
2008-04-04 13:46 ` [PATCH 2/3] x86: add hooks for kmemcheck Vegard Nossum
2008-04-04 13:47 ` [PATCH 3/3] slub: " Vegard Nossum
2008-05-10 9:07 ` [ANNOUNCE] kmemcheck v7 Bart Van Assche
2008-05-10 9:06 ` Pekka Enberg
2008-05-10 11:04 ` Bart Van Assche
2008-05-10 12:02 ` Vegard Nossum
2008-05-10 12:37 ` Andi Kleen
2008-05-10 13:22 ` Bart Van Assche
2008-05-10 17:17 ` Jeremy Fitzhardinge
2008-05-10 17:48 ` Andi Kleen
2008-05-10 20:45 ` Jeremy Fitzhardinge
2008-05-10 21:29 ` John Reiser
2008-05-10 23:05 ` Jeremy Fitzhardinge
2008-05-10 21:31 ` Andi Kleen
2008-05-10 22:59 ` Jeremy Fitzhardinge
2008-05-10 13:29 ` Bart Van Assche
2008-05-10 17:17 ` Jeremy Fitzhardinge [this message]
2008-05-10 20:35 ` Jeff Dike
2008-05-11 11:23 ` John Reiser
2008-05-11 12:08 ` John Reiser
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=4825D8A1.30008@goop.org \
--to=jeremy@goop.org \
--cc=a.p.zijlstra@chello.nl \
--cc=andi@firstfloor.org \
--cc=bart.vanassche@gmail.com \
--cc=clameter@sgi.com \
--cc=dwalker@mvista.com \
--cc=jreiser@BitWagon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luken@omner.org \
--cc=mingo@elte.hu \
--cc=paulmck@linux.vnet.ibm.com \
--cc=penberg@cs.helsinki.fi \
--cc=pq@iki.fi \
--cc=randy.dunlap@oracle.com \
--cc=vegard.nossum@gmail.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;
as well as URLs for NNTP newsgroup(s).