mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: "Andi Kleen" <andi@firstfloor.org>
Cc: "Pekka Enberg" <penberg@cs.helsinki.fi>,
	"Ingo Molnar" <mingo@elte.hu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kmemcheck: don't track pages allocated with interrupts disabled
Date: Sat, 7 Jun 2008 22:19:44 +0200	[thread overview]
Message-ID: <19f34abd0806071319h19893ad5kcf938e1067b2a752@mail.gmail.com> (raw)
In-Reply-To: <484AE5C9.9070306@firstfloor.org>

On Sat, Jun 7, 2008 at 9:47 PM, Andi Kleen <andi@firstfloor.org> wrote:
>
>> Maybe we can do the splitting when kmemcheck is enabled for the first
>> time, either with the proc handler or at boot if kmemcheck=1 is passed
>> on the command line. Both of these contexts should/can be
>> !irqs_disabled(), I think.
>
> You could always split at boot when the CONFIG is enabled. I assume the
> CONFIG alone has already quite a lot of overhead and it will be only
> on in debug kernels and adding some more TLB misses shouldn't be really
> a problem. Using 2MB pages in kernel is merely  an optimization.

Actually, no, the CONFIG itself is now very low overhead. The only
thing we do is a very simple check in the slab allocator each time you
allocate or free an object (it's a couple of if()s, I doubt it would
show up in anything but microbenchmarks). These is also maybe two or
three calls for each page fault, but they return very quickly.

I didn't test, but this should be the only penalty of enabling the
CONFIG. Of course, once you pass kmemcheck=1 at boot it will be a
disaster :-)

But you are probably right nevertheless; the overhead of 4K pages
instead 2M is probably negligible in most cases.


Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036

  reply	other threads:[~2008-06-07 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-07 14:32 Vegard Nossum
2008-06-07 17:12 ` Andi Kleen
2008-06-07 18:15   ` Vegard Nossum
2008-06-07 19:47     ` Andi Kleen
2008-06-07 20:19       ` Vegard Nossum [this message]
2008-06-07 18:18   ` Vegard Nossum

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=19f34abd0806071319h19893ad5kcf938e1067b2a752@mail.gmail.com \
    --to=vegard.nossum@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    /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®