linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Starikovskiy <astarikovskiy@suse.de>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: Len Brown <lenb@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: [RFC][PATCH] ACPICA: Drop Operand cache
Date: Fri, 24 Apr 2009 18:22:25 +0400	[thread overview]
Message-ID: <49F1CB21.4090803@suse.de> (raw)
In-Reply-To: <4911F71203A09E4D9981D27F9D830858224A6B01@orsmsx503.amr.corp.intel.com>

Moore, Robert wrote:
> I've had a bit of time to start looking at this again.
> 
> I'm still a bit confused about what this is trying to accomplish.
> Is it a performance gain?
Yes, for in-kernel use. It has no performance difference with userland tools compiled without memory debug. It has negative performance gain 
on tools compiled with memory debug.
> Is it to reduce memory use or memory fragmentation?
Yes, both. Kernel people don't like us to keep separate caches for hundred byte allocation every 5 seconds. it's a waist of kernel resources.
> I know there has been discussion on and off concerning the use of caches, object sizes, the big union, etc., but please refresh me.
Yes, there was a outside patch to replace kernel caching with ACPICA caching. Then I explained implementation of ACPICA caching, patch was dropped (good thing), but people suggested that we simplify ACPICA memory usage to just malloc and don't use fits-all scheme for objects.
This is what my patch does -- it makes every object to only allocate it own size of memory. 

They also suggested dropping the object union, but this seems not practical as it is, because of huge number of casts between objects and common part (I've tried to do this first, but the patch became about 600k in size, containing mostly casts).
It is still possible to remove _use_ of object union there it is has benefits, for example, if function is supposed to only receive mutex object, there is a little reason to feed it with union.
> 
> As far as the operand objects, once the tables are loaded and the namespace is initialized, these are all dynamic with a lifetime of at 
> most the duration of an executing control method -- so I'm not clear as to what is to be gained by splitting a single-sized object into 
> a bunch of differently-sized objects. One would *think* that it would be more efficient to just allocate the single-sized objects 
> from a single fast cache.
Malloc in all Unix/Linux implementations use the same-size object caches (slabs) for kernel allocation for two decades now. So, inside kernel we don't gain anything by re-implementing this, mostly because we don't care about CPU caches, NUMA memory locality, etc.
There are several attempts to use slabs in malloc implementations for userspace libraries, but ACPICA is not that memory bound to require this. 

Regards,
Alex.

  reply	other threads:[~2009-04-24 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-17 18:25 [RFC][PATCH] ACPICA: Drop Operand cache Alexey Starikovskiy
2009-04-17 19:41 ` Moore, Robert
2009-04-17 19:55   ` Alexey Starikovskiy
2009-04-17 20:07     ` Alexey Starikovskiy
2009-04-18  3:46       ` Moore, Robert
2009-04-23 20:47     ` Moore, Robert
2009-04-24 14:22       ` Alexey Starikovskiy [this message]
2009-04-24 21:31         ` Moore, Robert

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=49F1CB21.4090803@suse.de \
    --to=astarikovskiy@suse.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=robert.moore@intel.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).