mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Paul Mackerras <paulus@samba.org>,
	Jesse Barnes <jbarnes@engr.sgi.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org, riel@redhat.com,
	Ian.Pratt@cl.cam.ac.uk, kurt@garloff.de,
	Christian.Limpach@cl.cam.ac.uk
Subject: Re: [PATCH] Xen/i386 cleanups - AGP bus/phys cleanups
Date: 19 Mar 2005 03:07:18 -0700	[thread overview]
Message-ID: <m1k6o40x0p.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <E1DBsgI-0001Cg-00@mta1.cl.cam.ac.uk>

Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:

> > > now, the patch lines that poke into the GATT I guess stay as they are. 
> > > We can maintain an out-of-tree patch for Xen, or perhaps if 
> > > virt_to_phys() is not used very much we can override its definition.
> > 
> > It sounds like xen is trying to overload the concepts of physical and
> > bus addresses to represent the mapping from "logical" addresses seen
> > by the kernel to "absolute" addresses (the "real" physical
> > addresses).  IMHO that is a mistake and will only lead to trouble.
> 
> Well, actually it has worked well for us so far. Our model of memory
> allocation amongst Xen guests is fine-grained (page granularity). The
> fact a guest can get random sparse physical pages does not fit well
> with Linux's expectation (even with discontig-mem builds) of at least
> getting fairly large contiguous physical chunks of RAM.

There is data excess data structure but it fits fine.  You simply
allocate one region and set PG_reserved on all of the pages that
the OS does not have access too.  Trivial and you don't have
to hack anything.

Larger than 4K granularity pages are important for performance reasons
in a number of contexts.  The primary reason is the large pages allow
a reduction in tlb misses.  But it is worth noting that DRAM pages
can be as large as 32KiB.  So there are other cases where there are
benefits in dealing with contiguous memory addresses besides reducing
the tlb miss count.

> For this reason, we do rather abuse the notion of 'phys'
> addresses. But we get away with it because it really doesn't matter to
> the VM system that these addresses bear no relation to reality. In
> most cases that it does matter it is because we are programming an I/O
> device, in which case we have convenient hook points (bus-address
> macros and the DMA-mapping interface). Another slightly tricky one was
> block-I/O buffer merging but, again, we found a fairly clean way of
> hooking that in an appropriate manner.

You also have broken kexec.  

And how well does hugetlbfs work under Xen?
 
> I'd be happy to cook up a patch to do this if it isn't too offensive
> for anyone.

For this specific case there may be another resolution but could
you please, please look at marking the missing pages PG_reserved
and not hacking phys_to_virt.

At this point anything short of explicitly introducing an intermediate
step say virt_to_logical() logical_to_virt() will be extremely
confusing and lead to very hard to spot bugs.  Silently changing
the semantics of functions is bad.

Eric

  reply	other threads:[~2005-03-19 10:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 11:48 Keir Fraser
2005-03-16 14:31 ` Christoph Hellwig
2005-03-16 14:58   ` Keir Fraser
2005-03-16 15:01   ` Rik van Riel
2005-03-16 18:10     ` Christoph Hellwig
2005-03-16 18:35       ` Keir Fraser
2005-03-16 18:42         ` Jesse Barnes
2005-03-16 19:08           ` Keir Fraser
2005-03-16 19:06         ` Christoph Hellwig
2005-03-16 19:11           ` Keir Fraser
2005-03-16 17:40   ` Alan Cox
2005-03-16 17:54 ` Jesse Barnes
2005-03-16 21:24 ` Paul Mackerras
2005-03-16 22:06   ` Jesse Barnes
2005-03-16 23:55     ` Rik van Riel
2005-03-17  0:39       ` Paul Mackerras
2005-03-17  1:05         ` Tupshin Harper
2005-03-17  3:44         ` Rik van Riel
2005-03-17  4:42       ` Christoph Hellwig
2005-03-17  4:58         ` Rik van Riel
2005-03-17  9:16     ` Keir Fraser
2005-03-17  9:34       ` Paul Mackerras
2005-03-17 10:56         ` Keir Fraser
2005-03-19 10:07           ` Eric W. Biederman [this message]
2005-03-19 10:56             ` Christian Limpach
2005-03-19 13:01               ` Keir Fraser
2005-03-17 13:53         ` Alan Cox
2005-03-18  0:16           ` Paul Mackerras
2005-03-18  4:23             ` Rik van Riel
2005-03-18  9:05             ` Keir Fraser

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=m1k6o40x0p.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=Christian.Limpach@cl.cam.ac.uk \
    --cc=Ian.Pratt@cl.cam.ac.uk \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=akpm@osdl.org \
    --cc=jbarnes@engr.sgi.com \
    --cc=kurt@garloff.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=riel@redhat.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

all inboxes | Powered by JetHome®