mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: marcelo.tosatti@cyclades.com
Cc: dan@embeddededge.com, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: increased translation cache footprint in v2.6
Date: Sun, 26 Jun 2005 17:53:47 -0700 (PDT)	[thread overview]
Message-ID: <20050626.175347.104031526.davem@davemloft.net> (raw)
In-Reply-To: <20050626190944.GC6091@logos.cnet>

From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Date: Sun, 26 Jun 2005 16:09:44 -0300

> Thats a very interesting idea, will probably optimize performance in 
> general ("why did nobody thought of it before?" kind). 
> 
> The increase in TLB miss handler size might be offset by the reduced
> kernel misses...
> 
> Dan, what do you think? 

I doubt it, it cost a single comparison on sparc64 to implement this.

Basically, the TLB miss handler for data accesses on sparc64 looks
like the following.

Load the miss information:

	ldxa		[%g1 + %g1] ASI_DMMU, %g4	! Get TAG_ACCESS

If "TAG_CONTEXT_BITS" is zero, it's for the kernel:

	andcc		%g4, TAG_CONTEXT_BITS, %g0	! From Nucleus?
	be,pn		%xcc, 3f			! Yep, special processing
 ...

If the virtual address has the top-most bit set (and thus it's
"negative"), then it's in the physical memory direct mapping
area.  The trap handler register %g2 is preloaded with a fixed
value, that when XOR'd with the fault address information
produces a suitable PTE for loading right into the TLB.  This
PTE uses 4MB pages.

3:	brlz,pt		%g4, 9b				! Kernel virtual map?
	 xor		%g2, %g4, %g5			! Finish bit twiddles

 ...

Store the calculated TLB entry and return from the trap.

9:	stxa		%g5, [%g0] ASI_DTLB_DATA_IN	! Reload TLB
	retry						! Trap return

So that's 7 instructions, 2 instruction cache lines, with no main
memory accesses.  Surely the PPC folks can do something similar. :-)

  reply	other threads:[~2005-06-27  0:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26 17:23 Marcelo Tosatti
2005-06-26 23:42 ` Paul Mackerras
2005-06-26 18:31   ` Marcelo Tosatti
2005-06-26 23:49 ` Andrew Morton
2005-06-26 18:52   ` Marcelo Tosatti
2005-06-27  0:33     ` David S. Miller
2005-06-26 19:09       ` Marcelo Tosatti
2005-06-27  0:53         ` David S. Miller [this message]
2005-06-27 15:57           ` Dan Malek
2005-06-27 19:50             ` David S. Miller
2005-06-27 20:35               ` Dan Malek
2005-06-28  6:18                 ` Benjamin Herrenschmidt
2005-06-28 13:42                   ` Dan Malek
2005-06-27 15:46         ` Dan Malek
2005-06-28  6:21           ` Benjamin Herrenschmidt
2005-06-28 13:49             ` Dan Malek
2005-06-27  1:55       ` Benjamin Herrenschmidt
2005-06-27 19:04 Al Boldi

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=20050626.175347.104031526.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=akpm@osdl.org \
    --cc=dan@embeddededge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.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®