From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dan Malek <dan@embeddedalley.com>
Cc: Scott Wood <scottwood@freescale.com>,
"linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>,
Rex Feany <RFeany@mrv.com>
Subject: Re: [PATCH 3/6] 8xx: invalidate non present TLBs
Date: Fri, 09 Oct 2009 09:23:48 +1100 [thread overview]
Message-ID: <1255040628.2146.54.camel@pasglop> (raw)
In-Reply-To: <34A4641D-8121-4EBC-9880-26CB70DD3339@embeddedalley.com>
On Thu, 2009-10-08 at 15:08 -0700, Dan Malek wrote:
> Hi Ben.
>
> On Oct 8, 2009, at 1:28 PM, Benjamin Herrenschmidt wrote:
>
> > While you are around ... I have a question :-)
>
> I'll try. Many brain cells have been replaced or lost
> over the years :-)
Replaced ? You lucky ! I only lose mines :-)
> I thought we did a tlbie() (or whatever the equivalent is today)
> when the PTE was updated in the table. An optimization was to
> load the TLB with the entry at that time to avoid a subsequent miss.
> In any case, the TLB entry has to be modified by the software.
Ok, that's my understanding too and I think we had the tlbie in
update_mmu_cache to do the trick, though the comment is misleading
making it think that the only reason it's there is for the dcbst
problem. At least that's my understanding. That was lost recently in 2.6
so I'll have to put it back properly.
I don't think we do the pre-load to avoid the second fault, but we
certainly could and should.
> I don't remember how C was used in the past, but I suspect
> it just mirrored the Linux VM state. I'm quite certain the MMU
> HW would never change a TLB entry. Where did you read this?
MPC855UM, chapter 8.6 "Memory attributes":
<<
• Reference and change bit updates—The MPC850 does not generate an exception for
an R (reference) bit update. In fact, there is no entry for an R bit in the TLB.
The change bit (C) is bit 23 in the level-two descriptor, described in Table 8-4.
Software updates C (changed) bits, but hardware treats the C bit (negated) as a
write-protect attribute. Therefore, attempting to write to a page marked unmodified
invalidates that entry and causes an implementation-specific DTLB error exception.
^^^^^^^^^^^^^^^^^^^^^^
If change bits are not needed, set the C bit to one by default in the PTEs.
>>
And yes, it's weird and that's the only place I think where this is
mentioned which makes me think it could well be a doco bug.
> For most of the 8xx "early days," I used to just mark all write
> pages as dirty. For some reason I just overloaded the write/changed
> into one bit, it avoided TLB Error overhead and I think even some
> silicon bugs. Since they were tiny and fairly static embedded
> systems, it didn't have any effect on the way VM was managed.
Well, nowadays at least, most of the time, a writeable page is also
dirty unless it's a writeable shared mapping, and in that later case
you really want to do proper dirty tracking. So I suspect we can
simplify some of that and let the generic code handle dirty by mapping
_PAGE_DIRTY to C and removing _PAGE_HWWRITE. We can also remove all
of the asm munging from DataTLBError, and let the generic C code fixup
DIRTY and ACCESSED when needed, since those should only rarely need a
fixup.
> The MMU HW on the 8xx is just a translator. I'm now really
> certain it won't ever change a TLB entry. It's completely up to
> software to make all TLB changes.
That makes sense.
> Just make it simple :-)
Yeah. I think we can simplify the current code a lot, which will speed
up TLB misses (well, nothing much you can do about the infamous errata
#6 but that's another story). It won't give 2.6 back the 2.4 speed due
to sheer bloat of the generic code but it might at least offset some of
the loss by improving the overall TLB miss performance.
Now, I don't have any 8xx gear, so it will be up to Joakim, Scott etc...
to get that stuff right :-)
Thanks for your feedback.
Cheers,
Ben.
> Thanks.
>
> -- Dan
next prev parent reply other threads:[~2009-10-08 22:24 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-07 20:45 [PATCH 0/6] 8xx TLB fixes Joakim Tjernlund
2009-10-07 20:45 ` [PATCH 1/6] 8xx: DTLB Error must check for more errors Joakim Tjernlund
2009-10-07 20:46 ` [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU Joakim Tjernlund
2009-10-07 20:46 ` [PATCH 3/6] 8xx: invalidate non present TLBs Joakim Tjernlund
2009-10-07 20:46 ` [PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions Joakim Tjernlund
2009-10-07 20:46 ` [PATCH 5/6] 8xx: Fixup DAR from buggy dcbX instructions Joakim Tjernlund
2009-10-07 20:46 ` [PATCH 6/6] 8xx: start using dcbX instructions in various copy routines Joakim Tjernlund
2009-10-07 21:18 ` [PATCH 4/6] 8xx: Tag DAR with 0x00f0 to catch buggy instructions Benjamin Herrenschmidt
2009-10-07 22:13 ` Joakim Tjernlund
2009-10-07 22:21 ` Benjamin Herrenschmidt
2009-10-07 23:12 ` Joakim Tjernlund
2009-10-07 21:18 ` [PATCH 3/6] 8xx: invalidate non present TLBs Benjamin Herrenschmidt
2009-10-07 22:12 ` Joakim Tjernlund
2009-10-07 22:20 ` Benjamin Herrenschmidt
2009-10-08 19:22 ` Joakim Tjernlund
2009-10-08 20:11 ` Dan Malek
2009-10-08 20:18 ` Benjamin Herrenschmidt
2009-10-08 20:28 ` Benjamin Herrenschmidt
2009-10-08 22:08 ` Dan Malek
2009-10-08 22:23 ` Benjamin Herrenschmidt [this message]
2009-10-08 23:01 ` Joakim Tjernlund
2009-10-09 0:56 ` Benjamin Herrenschmidt
2009-10-09 0:36 ` Dan Malek
2009-10-09 0:57 ` Benjamin Herrenschmidt
2009-10-08 20:37 ` Joakim Tjernlund
2009-10-08 20:44 ` Benjamin Herrenschmidt
2009-10-09 0:05 ` Dan Malek
2009-10-08 20:42 ` Benjamin Herrenschmidt
2009-10-07 21:14 ` [PATCH 2/6] 8xx: get rid of _PAGE_HWWRITE dependency in MMU Benjamin Herrenschmidt
2009-10-07 22:08 ` Joakim Tjernlund
2009-10-07 22:20 ` Benjamin Herrenschmidt
2009-10-07 23:11 ` Joakim Tjernlund
2009-10-08 0:04 ` Benjamin Herrenschmidt
2009-10-08 0:19 ` Joakim Tjernlund
2009-10-08 0:28 ` Benjamin Herrenschmidt
2009-10-08 6:45 ` Joakim Tjernlund
2009-10-08 20:21 ` Benjamin Herrenschmidt
[not found] ` <OFCA7943E6.AFEF924A-ONC1257648.007E27B0-C1257648.007F62E9@LocalDomain>
2009-10-07 23:34 ` Joakim Tjernlund
-- strict thread matches above, loose matches on Subject: below --
2009-10-08 13:24 [PATCH 0/6] 8xx MMU fixes Joakim Tjernlund
2009-10-08 13:24 ` [PATCH 1/6] 8xx: DTLB Error must check for more errors Joakim Tjernlund
2009-10-08 13:24 ` [PATCH 2/6] 8xx: Update TLB asm so it behaves as linux mm expects Joakim Tjernlund
2009-10-08 13:24 ` [PATCH 3/6] 8xx: invalidate non present TLBs Joakim Tjernlund
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=1255040628.2146.54.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=RFeany@mrv.com \
--cc=dan@embeddedalley.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.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).