linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: mingo@elte.hu, tglx@linutronix.de, lenb@kernel.org,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] - Mapping ACPI tables as CACHED
Date: Tue, 17 Aug 2010 09:49:17 -0500	[thread overview]
Message-ID: <20100817144917.GD14091@sgi.com> (raw)
In-Reply-To: <20100724001449.GA9618@khazad-dum.debian.net>

On Fri, Jul 23, 2010 at 09:14:50PM -0300, Henrique de Moraes Holschuh wrote:
> On Thu, 22 Jul 2010, Jack Steiner wrote:
> > Large SGI UV systems (3072p, 5TB) take a long time to boot. A significant
> > part of the boot time is scanning ACPI tables. ACPI tables on UV systems
> > are located in RAM memory that is physically attached to node 0.
> > 
> > User programs (ex., acpidump) read the ACPI tables by mapping them thru
> > /dev/mem.  Although mmap tries to map the tables as CACHED, there are
> > existing kernel UNCACHED mapping that conflict and the tables end up as
> > being mapped UNCACHED.  (See the call to track_pfn_vma_new() in
> > remap_pfn_range()).
> 
> Well, as it was raised in this thread, ACPI tables are likely to be near RAM
> regions used for IPC with the firmware or SMBIOS, and we have no idea of the
> kind of crap that could happen if we enable caching on those areas.

I'm certainly not suggesting that ALL platforms map ACPI tables as WB. That
would be a disaster. Only platforms where BIOS specifically reports that
that tables are in WB memory should be mapped as MB.


> 
> OTOH, we *know* of systems that force us to copy the ACPI tables to regular
> RAM, otherwise, the utterly broken BIOS corrupts the ACPI tables after the
> kernel has loaded.
> 
> Couldn't we simply always copy all tables to regular RAM and mark THAT as
> cacheable (since there will be no IPC regions in it)?  For the tables that
> are only used once, we can free the RAM later.

I'm really out of the area of the kernel that I understand   :-)

What are the implications of copying the ACPI tables to another location?
Does BIOS ever make changes to their tables that would make it necessary
to update the OS copy?

While copying tables might sound attractive, it seems like there is a
ripple effect.  For example, acpidump does the following:

        - opens /sys/firmware/efi/systable
        - reads the physical address of the ACPI20 table
                (strace)
                open("/sys/firmware/efi/systab", O_RDONLY) = 3
                read(3, "MPS=0x0\nACPI20=0x78d76014\nACPI=0"..., 4096) = 83
                (contents)
                ACPI20=0x78d76014
                SMBIOS=0x78c33000

        - opens /dev/mem
                (strace)
                open("/dev/mem", O_RDONLY) = 4
                mmap(NULL, 396, PROT_READ, MAP_PRIVATE, 4, 0x78d76000)

        - mmaps the physical address of the ACPI20 table
        - reads the table

If the ACPI tables are copied to a different location, I don't see a
clean/simple way to make this work.

It seems like the best approach would to provide platform specific hooks
in ACPI to map the tables as WB in the first place - IF the platform supports it.


--- jack

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

Thread overview: 24+ 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
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 [this message]
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=20100817144917.GD14091@sgi.com \
    --to=steiner@sgi.com \
    --cc=hmh@hmh.eng.br \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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).