linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Surovegin <ebs@ebshome.net>
To: Marius Groeger <mgroeger@sysgo.com>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: [RFC] Simple ioremap cache
Date: Mon, 7 Jun 2004 01:48:12 -0700	[thread overview]
Message-ID: <20040607084812.GA5808@gate.ebshome.net> (raw)
In-Reply-To: <Pine.LNX.4.56.0406070931180.3147@mag.sysgo.com>


On Mon, Jun 07, 2004 at 09:46:16AM +0200, Marius Groeger wrote:
> I'm not sure, however, whether your current patch actually saves _TLB_
> misses.

Huh?

Let's consider two drivers - serial & emac on 44x. Both of them ioremap
different parts of the same phys page, but without the patch these will be
_different_ virtual mappings, e.g. if they access their respective I/O registers
_two_ TLB entries will be used.

Here is real example (see my original e-mail):

UART0 ioremaps 0x0000000140000200 and gets 0xfdfea200 as a virtual kernel
address

EMAC0 ioremaps 0x0000000140000800 and gets 0xd1000800.

You'll need _two_ TLB entries for these mappings:

0xfdfea000 -> 0x0000000140000000
0xd1000000 -> 0x0000000140000000

With my patch only _one_ TLB mapping will be required for _all_ 4K-sized
ioremaps of 0x0000000140000000:

0xfdfea000 -> 0x0000000140000000

440GP has a 64 entry TLB and believe me, when you are running user mode app,
there are a lot of TLB misses, and decreasing TLB pressure (e.g. requiring less
TLB entries for driver I/O) _will_ save you some TLB misses.

> Have you counted them to prove it?

No, it seemed quite obvious to me :)

> To do this, I think you also need
> to flag a bigger virtual page size to the MMU, eg. program a different
> PAGESZ_* value (see include/asm-ppc/mmu.h). If you don't, the MMU has to
> manage diffent chunks all the same, they just happen to be virtually
> contiguous.

I don't follow you here, sorry. Could you give some examples with the real TLB
contents for the cases you are describing?

> So I think what you're saving right now is just mapping entries (which also
> is a valid thing to gain).

What do you mean "just mapping entries" ? TLB slots contain these "mapping
entries", that's the whole purpose of TLB.

Eugene.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2004-06-07  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-05  0:29 [RFC] Simple ioremap cache Eugene Surovegin
2004-06-07  7:46 ` Marius Groeger
2004-06-07  8:48   ` Eugene Surovegin [this message]
2004-06-07  9:12     ` Marius Groeger
2004-06-07  9:26       ` Eugene Surovegin
2004-06-07 14:58 ` Kumar Gala
2004-06-07 15:27   ` Benjamin Herrenschmidt
2004-06-07 17:47   ` Kumar Gala

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=20040607084812.GA5808@gate.ebshome.net \
    --to=ebs@ebshome.net \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=mgroeger@sysgo.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).