linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Alexey Starikovskiy <aystarik@gmail.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	Linux Memory Management List <linux-mm@kvack.org>,
	linux-acpi@vger.kernel.org, lenb@kernel.org
Subject: Re: [patch][rfc] acpi: do not use kmem caches
Date: Mon, 1 Dec 2008 17:32:58 +0100	[thread overview]
Message-ID: <20081201163257.GG10790@wotan.suse.de> (raw)
In-Reply-To: <4933F14C.7020200@gmail.com>

On Mon, Dec 01, 2008 at 05:14:36PM +0300, Alexey Starikovskiy wrote:
> Nick Piggin wrote:
> >On Mon, Dec 01, 2008 at 04:12:35PM +0300, Alexey Starikovskiy wrote:
> >  
> >>Nick Piggin wrote:
> >>    
> >>>On Mon, Dec 01, 2008 at 01:18:33PM +0200, Pekka Enberg wrote:
> >>> 
> >>>      
> >>>>Hi Nick,
> >>>>
> >>>>On Mon, Dec 1, 2008 at 10:31 AM, Nick Piggin <npiggin@suse.de> wrote:
> >>>>   
> >>>>        
> >>>>>What does everyone think about this patch?
> >>>>>     
> >>>>>          
> >>>>Doesn't matter all that much for SLUB which already merges the ACPI
> >>>>caches with the generic kmalloc caches. But for SLAB, it's an obvious
> >>>>wil so:
> >>>>
> >>>>Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
> >>>>   
> >>>>        
> >>>Actually I think it is also somewhat of a bugfix (not to mention that it
> >>>seems like a good idea to share testing code with other operating 
> >>>systems).
> >>>
> >>> 
> >>>      
> >>It is not "kind of a bugfix". Caches were used to allocate all frequenly
> >>created objects of fixed size. Removing native cache interface will
> >>increase memory consumption and increase code size, and will make it 
> >>harder
> >>to spot actual memory leaks.
> >>    
> >
> >Slabs can take a non-trivial amount of memory. On bigger machines it can
> >be many megabytes. On smaller machines perhaps not, but what is the 
> >benefit??
> >The only ACPI slabs I have with anything in them total a couple of hundred
> >kB, and anyway they are 64 and 32 bytes so they will pack exactly into
> >kmalloc slabs.
> >  
> Oh right, we don't care about memory footprint any longer...

On the contrary
http://marc.info/?l=linux-fsdevel&m=122812043206762&w=2

Some people still do. I'm hoping to save memory. With my configuration, the
patch definitely saves memory.


> >Code size... Does it matter? Is it really performance critical? If you are
> >worried about code size, then I will implement them directly with kmalloc
> >and kfree for you.
> >  
> Why then you try to delete ACPICA code, which might be just disabled by
> undefining ACPI_USE_LOCAL_CACHE?
> If you do want to go that path, you need to create patch against ACPICA, not
> Linux code.

I don't know what else uses ACPICA, so no.


> >kmem caches are not exactly an appropriate tool to detect memory leaks. If
> >that were the case then we'd have million kmem caches everywhere.
> >
> >
> >  
> >>>Because acpi_os_purge_cache seems to want to free all active objects in 
> >>>the
> >>>cache, but kmem_cache_shrink actually does nothing of the sort. So there
> >>>ends up being a memory leak.
> >>> 
> >>>      
> >>No. acpi_os_purge_cache wants to free only unused objects, so it is a 
> >>direct map to
> >>    
> >
> >Ah OK I misread, that's the cache's freelist... ACPI shouldn't be poking
> >this button inside the slab allocator anyway, honestly. What is it
> >for?
> >  
> And it is not actually used -- you cannot unload ACPI interpreter, and
> this function is called only from there.

Should be deleted anyway. This seems to be the only user of kmem_cache_shrink
in the kernel and it's bogus anyway.


> >Is there a reasonable performance or memory win by using kmem cache? If
> >not, then they should not be used
> ACPI is still working in machines with several megabytes of RAM and 
> 100mhz Pentium processors. Do you say we should just not consider them 
> any longer?

No. As I said, I am trying to save RAM. If it turns out not to save RAM
in some configurations then of course I will reconsider.


> If so, then just delete all ACPICA caches altogether.
> And this still needs to be patch against ACPICA, not Linux -- at least 
> with BSD license attached.

I don't have a problem with that.

--
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>

  reply	other threads:[~2008-12-01 16:32 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 [this message]
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
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=20081201163257.GG10790@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=aystarik@gmail.com \
    --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