From: David Howells <dhowells@redhat.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Ian Molton <spyro@f2s.com>,
nickpiggin@yahoo.com.au, akpm@osdl.org, tony.luck@intel.com,
benh@kernel.crashing.org, ak@suse.de,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] freepgt: free_pgtables use vma list
Date: Wed, 30 Mar 2005 11:46:17 +0100 [thread overview]
Message-ID: <22627.1112179577@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0503292223090.18131@goblin.wat.veritas.com>
Hugh Dickins <hugh@veritas.com> wrote:
> On Fri, 25 Mar 2005, David S. Miller wrote:
>
> [ of flush_tlb_pgtables ]
>
> > Since sparc64 is the only user of this thing...
>
> Not quite. sparc64 is the only user which makes any use of the
> addresses passed to it, but frv does a little assembler with it,
> and arm26 does a printk - eh? I'd take that to mean that it never
> gets called there, but I don't see what prevents it, before or now.
> Ian, does current -mm give you "flush_tlb_pgtables" printks?
That bit of assembly invalidates some data cached by the TLB-miss handler in
registers SCR0 and SCR1 to improve performance in the next TLB-miss event.
What happens is that the TLB-miss handler sets a static mapping for a page
table and stores the base virtual address for the region covered by that page
table in SCR0 (ITLB) or SCR1 (DTLB). Then when dealing with the next TLB-miss
event we can do:
((SCRx ^ virtaddr) >> 26) == 0
to very quickly work out whether we can re-use the static mapping left from
the previous TLB-miss event.
However, if the mapping from virtual address to page table changes, then the
cached static mappings may no longer be valid. We can invalidate them simply
by zapping SCR0 and SCR1.
It occurs to me that:
#define flush_tlb_pgtables(mm,start,end) \
asm volatile("movgs gr0,scr0 ! movgs gr0,scr1");
is actually wrong. It doesn't actually invalidate anything; it just changes
the virtual range for that page table to be 0x00000000-0x04000000, no matter
whether that page table should be backing that region or not. It should
instead be:
#define flush_tlb_pgtables(mm,start,end) \
asm volatile("movgs %0,scr0 ! movgs %0,scr1" :: "r"(-1));
Because the addresses in the range 0xFC000000-0xFFFFFFFF are all statically
mapped to the Boot ROM chip select.
This doesn't matter for most programs as they never use more than the bottom
page table anyway (which covers 64MB).
> > Let's make it so that the flush can be queued up
> > at pmd_clear() time, as that's what we really want.
> >
> > Something like:
> >
> > pmd_clear(mm, vaddr, pmdp);
> >
> > I'll try to play with something like this later.
>
> Depends really on what DavidH wants there, not clear to me.
> I suspect Ian can live without his printk!
I could do the zapping in pmd_clear() instead, I suppose. It's just that it
only needs to be done once when tearing down the page tables; not for every
PMD.
David
next prev parent reply other threads:[~2005-03-30 10:46 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-23 17:10 [PATCH 0/6] freepgt: free_pgtables shakeup Hugh Dickins
2005-03-23 17:11 ` [PATCH 1/6] freepgt: free_pgtables use vma list Hugh Dickins
2005-03-24 12:26 ` Andi Kleen
2005-03-29 22:03 ` Hugh Dickins
2005-03-30 15:08 ` Andi Kleen
2005-03-30 17:15 ` Hugh Dickins
2005-03-31 10:57 ` Andi Kleen
2005-03-25 5:32 ` Nick Piggin
2005-03-25 5:35 ` Nick Piggin
2005-03-25 17:23 ` David S. Miller
2005-03-25 17:23 ` David S. Miller
2005-03-26 0:29 ` David S. Miller
2005-03-29 21:32 ` Hugh Dickins
2005-03-30 10:46 ` David Howells [this message]
2005-03-30 11:32 ` Ian Molton
2005-03-30 12:22 ` Hugh Dickins
2005-03-30 18:15 ` David S. Miller
2005-03-23 17:12 ` [PATCH 2/6] freepgt: remove MM_VM_SIZE(mm) Hugh Dickins
2005-03-23 17:13 ` [PATCH 3/6] freepgt: hugetlb_free_pgd_range Hugh Dickins
2005-03-23 17:14 ` [PATCH 4/6] freepgt: remove arch pgd_addr_end Hugh Dickins
2005-03-23 17:15 ` [PATCH 5/6] freepgt: mpnt to vma cleanup Hugh Dickins
2005-03-23 17:16 ` [PATCH 6/6] freepgt: hugetlb area is clean Hugh Dickins
2005-03-23 19:57 ` [PATCH 0/6] freepgt: free_pgtables shakeup David S. Miller
2005-03-24 0:26 ` Nick Piggin
2005-03-24 5:44 ` David S. Miller
2005-03-30 19:30 ` Hugh Dickins
2005-03-30 23:40 ` Nick Piggin
2005-03-25 21:22 ` Russell King
2005-03-26 2:06 ` Nick Piggin
2005-03-26 11:35 ` Russell King
2005-03-26 13:37 ` Russell King
2005-03-26 13:51 ` Nick Piggin
2005-03-26 15:03 ` Russell King
2005-03-30 17:00 ` Hugh Dickins
2005-03-30 17:39 ` Russell King
2005-03-26 13:42 ` Nick Piggin
2005-03-26 15:52 ` Russell King
2005-03-27 3:41 ` Nick Piggin
2005-03-27 7:57 ` Russell King
2005-03-27 18:17 ` David S. Miller
2005-03-28 7:51 ` Russell King
2005-03-28 18:47 ` David S. Miller
2005-03-30 16:30 ` Hugh Dickins
-- strict thread matches above, loose matches on Subject: below --
2005-03-23 19:16 [PATCH 1/6] freepgt: free_pgtables use vma list Luck, Tony
2005-03-23 19:19 ` David S. Miller
2005-03-29 20:50 ` Hugh Dickins
2005-03-23 22:07 ` Paul Mackerras
2005-03-23 22:19 ` Andreas Schwab
2005-03-30 18:23 Luck, Tony
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=22627.1112179577@redhat.com \
--to=dhowells@redhat.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=spyro@f2s.com \
--cc=tony.luck@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.