From: Nick Piggin <npiggin@suse.de>
To: Len Brown <lenb@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Alexey Starikovskiy <aystarik@gmail.com>,
Pekka Enberg <penberg@cs.helsinki.fi>,
Linux Memory Management List <linux-mm@kvack.org>,
linux-acpi@vger.kernel.org
Subject: Re: [patch][rfc] acpi: do not use kmem caches
Date: Mon, 5 Jan 2009 05:14:40 +0100 [thread overview]
Message-ID: <20090105041440.GB367@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.2.00.0812311649230.3854@localhost.localdomain>
On Wed, Dec 31, 2008 at 05:04:22PM -0500, Len Brown wrote:
> On Mon, 1 Dec 2008, Nick Piggin wrote:
>
> > If there is good reason to keep them around, I'm fine with that.
> > I think Pekka's suggestion of not doing unions but have better
> > typing in the code and then allocate the smaller types from
> > kmalloc sounds like a good idea.
>
> Yes, I'll take that up with Bob when he comes back from break.
> Maybe the ACPICA code can be improved here.
>
> > If the individual kmem caches are here to stay, then the
> > kmem_cache_shrink call should go away. Either way we can delete
> > some code from slab.
>
> I think they are here to stay. We are running
> an interpreter in kernel-space with arbitrary input,
> so I think the ability to easily isolate run-time memory leaks
> on a non-debug system is important.
I don't really see the connection. Or why being an interpreter is so
special. Filesystems, network stack, etc run in kernel with arbitrary
input. If kmem caches are part of a security strategy, then it's
broken... You'd surely have to detect bad input before the interpreter
turns it into a memory leak (or recover afterward, in which case it
isn't a leak).
> You may hardly ever see the interpreter run on systems
> with few run-time ACPI features, but it runs quite routinely
> on many systems.
>
> That said, we have not discovered a memory leak
> in a very long time...
>
>
> BTW.
> I question that SLUB combining caches is a good idea.
> It seems to fly in the face of how zone allocators
> avoid fragmentation -- assuming that "like size"
> equates to "like use".
>
> But more important to me is that it reduces visibility.
Yeah, that's another issue.
> > The OS agnostic code that implements its own allocator is kind
> > of a hack -- I don't understand why you would turn on allocator
> > debugging and then circumvent it because you find it too slow.
> > But I will never maintain that so if it is compiled out for
> > Linux, then OK.
>
> The ACPI interpreter also builds into a user-space simulator
> and a debugger. It is extremely valuable for us to be able
> to run the same code in the kernel and also in a user-space
> test environment. So there are a number of features in
> the interpreter that we shut off when we build into the
> Linux kernel. Sometimes shutting them off is elegant,
> sometime it is clumzy.
>
> "Slabs can take a non-trivial amount of memory.
> On bigger machines it can be many megabytes."
>
> I don't think this thread addressed this concern.
> Is it something we should follow-up on?
There are some fundamental issues like per-cpu/node queues and
external fragmentation in slab pages that means a kmem_cache is
never going to be free (unless it is combined with another one,
but at that point you lose this tracking info anyway). SLAB has
bigger problems with data structures growing N^2 with the size
of the machine, but it is still the best choice in some situations.
Rather than rely on an arbitrary implementation of slab allocator
and tracking details, I would like to see your wrapper layer used
to collect exactly the details that are required for your acpi
work. You would then have all this available whether you ran in
userspace or on other OSes. Then investigate whether there would be
any performance or memory consumption regression introduced if you
move to kmalloc.
It's not a huge issue I guess, although if you split up object
types finely, you don't want to end up with a huge number of
kmem caches that are not frequently used. Splitting up objects that
way, together with tracking infrastructure, should result in even
better visibility than you have today too.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2009-01-05 4:14 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 8:31 Nick Piggin
2008-12-01 11:18 ` Pekka Enberg
2008-12-01 12:00 ` Nick Piggin
2008-12-01 13:12 ` Alexey Starikovskiy
2008-12-01 13:36 ` Nick Piggin
2008-12-01 14:14 ` Alexey Starikovskiy
2008-12-01 16:32 ` Nick Piggin
2008-12-01 17:18 ` Christoph Hellwig
2008-12-01 17:32 ` Alexey Starikovskiy
2008-12-01 13:37 ` Pekka Enberg
2008-12-01 14:02 ` Alexey Starikovskiy
2008-12-01 16:14 ` Nick Piggin
2008-12-01 16:45 ` Alexey Starikovskiy
2008-12-01 16:58 ` Nick Piggin
2008-12-01 17:20 ` Moore, Robert
2008-12-01 17:30 ` Andi Kleen
2008-12-01 17:32 ` Moore, Robert
2008-12-01 17:20 ` Christoph Hellwig
2008-12-01 17:49 ` Alexey Starikovskiy
2008-12-01 17:53 ` Len Brown
2008-12-01 18:10 ` Nick Piggin
2008-12-31 22:04 ` Len Brown
2009-01-05 4:14 ` Nick Piggin [this message]
2009-01-05 5:43 ` Skywing
2009-01-05 6:55 ` Nick Piggin
2008-12-01 14:32 ` Christoph Lameter
2008-12-01 14:48 ` Alexey Starikovskiy
2008-12-01 16:20 ` Nick Piggin
2008-12-01 17:04 ` Alexey Starikovskiy
2008-12-01 17:12 ` Nick Piggin
2008-12-01 17:25 ` Pekka Enberg
2008-12-01 17:32 ` Pekka Enberg
2008-12-01 17:36 ` Alexey Starikovskiy
2008-12-01 17:48 ` Pekka Enberg
2008-12-01 18:09 ` Christoph Lameter
2008-12-01 17:43 ` Alexey Starikovskiy
2008-12-01 17:31 ` Len Brown
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=20090105041440.GB367@wotan.suse.de \
--to=npiggin@suse.de \
--cc=aystarik@gmail.com \
--cc=hch@infradead.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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