Re: [PATCH 1/2] kmemcheck v3

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vegard Nossum
Date: Thursday, February 7, 2008 - 4:18 pm

On Feb 7, 2008 11:53 PM, Christoph Lameter <clameter@sgi.com> wrote:

Ok, then I think we are still talking about different things :-)

The tracking that kmemcheck does is actually a byte-for-byte tracking
of whether memory has been initialized or not. Think of it as valgrind
for the kernel. We do this by "hiding" pages (marking them non-present
for for MMU) and taking the page faults, which effectively tells us
what memory is being attempted to be read from or written to.

(This generally means that the tracking that kmemcheck does is
page-granular, but we can help this by making entire caches tracked or
non-tracked.)

(This also means that *all* tracked memory allocations require twice
the amount of memory that was requested -- but this is luckily
configurable by disabling kmemcheck entirely :-)).

I chose to implement this in the slab layer because this is probably
where most of the interesting allocations are coming from, and this
gives us a better control over what most users/callers care about,
namely the specific objects.

In a way, kmemcheck is similar to slab poisoning, since that can also
be used to detect the cases where memory is used before it is
initialized. This is a heavier-weight approach, however, and more
precise, as it gives you the exact location of the error.

I hope this clears it up.


Kind regards,
Vegard Nossum
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] kmemcheck v3, Vegard Nossum, (Thu Feb 7, 2:36 pm)
[PATCH 2/2] kmemcheck v3, Vegard Nossum, (Thu Feb 7, 2:39 pm)
Re: [PATCH 1/2] kmemcheck v3, Christoph Lameter, (Thu Feb 7, 2:53 pm)
Re: [PATCH 1/2] kmemcheck v3, Vegard Nossum, (Thu Feb 7, 3:12 pm)
Re: [PATCH 1/2] kmemcheck v3, Christoph Lameter, (Thu Feb 7, 3:53 pm)
Re: [PATCH 1/2] kmemcheck v3, Vegard Nossum, (Thu Feb 7, 4:18 pm)
Re: [PATCH 1/2] kmemcheck v3, Christoph Lameter, (Thu Feb 7, 4:32 pm)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Thu Feb 7, 11:30 pm)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Thu Feb 7, 11:33 pm)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Thu Feb 7, 11:40 pm)
Re: [PATCH 1/2] kmemcheck v3, Christoph Lameter, (Fri Feb 8, 12:10 am)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Fri Feb 8, 12:48 am)
Re: [PATCH 1/2] kmemcheck v3, Ingo Molnar, (Fri Feb 8, 1:09 am)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Fri Feb 8, 4:31 am)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Fri Feb 8, 4:37 am)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Fri Feb 8, 4:39 am)
Re: [PATCH 1/2] kmemcheck v3, Pekka Enberg, (Fri Feb 8, 4:43 am)
Re: [PATCH 1/2] kmemcheck v3, Andi Kleen, (Fri Feb 8, 4:55 am)
Re: [PATCH 1/2] kmemcheck v3, Andi Kleen, (Fri Feb 8, 5:10 am)
Re: [PATCH 1/2] kmemcheck v3, Andi Kleen, (Fri Feb 8, 5:15 am)
Re: [PATCH 1/2] kmemcheck v3, Vegard Nossum, (Fri Feb 8, 5:18 am)
Re: [PATCH 1/2] kmemcheck v3, Vegard Nossum, (Fri Feb 8, 5:59 am)
Re: [PATCH 1/2] kmemcheck v3, Andi Kleen, (Fri Feb 8, 6:20 am)
Re: [PATCH 1/2] kmemcheck v3, Andi Kleen, (Fri Feb 8, 6:48 am)
Re: [PATCH 1/2] kmemcheck v3, Ingo Molnar, (Sat Feb 9, 2:33 am)