All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: ykzhao <yakui.zhao@intel.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC] - Mapping ACPI tables as CACHED
Date: Tue, 17 Aug 2010 09:42:37 -0500	[thread overview]
Message-ID: <20100817144237.GB14091@sgi.com> (raw)
In-Reply-To: <20100723072301.GC23461@elte.hu>

On Fri, Jul 23, 2010 at 09:23:01AM +0200, Ingo Molnar wrote:
> 
> * ykzhao <yakui.zhao@intel.com> wrote:
> 
> > From the above description maybe the E820_ACPI region can be mapped as 
> > cached. But this still depends on the BIOS. If the some shared data resides 
> > in the E820_ACPI region on some BIOS, maybe we can't map the E820_ACPI 
> > region as cached again.
> 
> I dont think we can do this safely unless some other OS (Windows) does it as 
> well. (the reason is that if some BIOS messes this up then it will cause nasty 
> bugs/problems only on Linux.)
> 
> But the benefits of caching are very clear and well measured by Jack, so we 
> want the feature. What we can do is to add an exception for 'known good' hw 
> vendors - i.e. something quite close to Jack's RFC patch, but implemented a 
> bit more cleanly:
> 
> Exposing x86_platform and e820 details to generic ACPI code isnt particularly 
> clean - there should be an ACPI accessor function for that or so: a new 
> acpi_table_can_be_cached(table) function or so.

Agree. I am looking for the right set of abstractions for this.


> 
> In fact since __acpi_map_table(addr,size) is defined by architectures already, 
> this could be done purely within x86 code.

No. Unfortunately the function __acpi_map_tables()  is not called on the
path that does the permanent mappings. The code is (somewhat simplified):

        drivers/acpi/osl.c:

        acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
        {
                if (acpi_gbl_permanent_mmap)
                        return ioremap((unsigned long)phys, size);
                else
                        return __acpi_map_table((unsigned long)phys, size);
        }

Early in boot before "acpi_gbl_permanent_mmap" is set, __acpi_map_table()
is called to map tables.  __acpi_map_table() calls early_iomap() and all
early mappings are subsequently unmapped.

For the permanent mappings, we need a way to make the acpi code call
ioremap_cache() instead of ioremap() for all tables that are actually
in WB memory.

Timings made during boot show only a small benefit __acpi_map_table()
mapping tables cacheable. (I didn't check, but perhaps the early mapping
are only checking table IDs - not the full table).

The performance benefit of WB is for the permanent mapping made after
acpi_gbl_permanent_mmap is set. For some reason, most of the time
consuming references occur after this point. In addition ALL offnode
references occur after this point.


--- jack

  parent reply	other threads:[~2010-08-17 14:42 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 15:22 [RFC] - Mapping ACPI tables as CACHED Jack Steiner
2010-07-22 15:52 ` Len Brown
2010-07-23 16:38   ` Jack Steiner
2010-07-23  1:46 ` ykzhao
2010-07-23  7:23   ` Ingo Molnar
2010-07-23 14:26     ` ykzhao
2010-08-17 14:45       ` Jack Steiner
2010-08-17 15:51       ` H. Peter Anvin
2010-08-17 14:42     ` Jack Steiner [this message]
2010-08-17 14:39   ` Jack Steiner
2010-07-24  0:14 ` Henrique de Moraes Holschuh
2010-07-24  0:45   ` Matthew Garrett
2010-07-24 12:26     ` Henrique de Moraes Holschuh
2010-08-17 14:49   ` Jack Steiner
2010-08-17 16:02     ` Linus Torvalds
2010-08-17 16:02       ` Linus Torvalds
2010-08-24 21:39   ` H. Peter Anvin
2010-08-26 17:17     ` [RFC - V2] " Jack Steiner
2010-08-26 18:08       ` H. Peter Anvin
2010-12-08 21:22         ` Jack Steiner
2010-12-09  1:27           ` H. Peter Anvin
2010-12-09  3:50             ` Jack Steiner
2010-12-09  6:12               ` Len Brown
2010-08-17 15:59 ` [RFC] " Jack Steiner
2010-08-26 17:47   ` 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=20100817144237.GB14091@sgi.com \
    --to=steiner@sgi.com \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yakui.zhao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.