linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/2] ARMv7: Invalidate the TLB before freeing page tables
Date: Fri, 11 Mar 2011 19:24:55 +0000	[thread overview]
Message-ID: <20110311192455.GA23109@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1299864778.7239.57.camel@e102109-lin.cambridge.arm.com>

On Fri, Mar 11, 2011 at 05:32:58PM +0000, Catalin Marinas wrote:
> On Wed, 2011-03-09 at 18:35 +0000, Russell King - ARM Linux wrote:
> > On Wed, Mar 09, 2011 at 03:40:05PM +0000, Catalin Marinas wrote:
> > > The above call to tlb_add_flush() would only add a PAGE_SIZE. But
> > > since we free an entire PTE, shouldn't the range cover addr ..
> > > addr+PTRS_PER_PTE*PAGE_SIZE?
> > 
> > Why do we need to?  We're not flushing away the individual PTE entries
> > when we remove an entire page table - we will have already walked the
> > page table removing those entries, which will already have been added.
> 
> Ah, I missed the fact that tlb_flush() invalidates the whole TLB when
> there is no tlb->vma (the shift_arg_pages case). We could optimise this
> to add the range covered by the PTE page and avoid the !tlb->vma check
> (and a flush_tlb_mm), though not sure it's worth.

If we're removing pte entries then tlb->vma is non-NULL.  Please look at
the comments - I've documented the three modes of use there along with
how things are setup for each of those modes, and what we do with each.
I don't add comments just for the hell of it.

> > This code is to cover the case with LPAE where we need to flush out the
> > L1 entries.  It's nothing to do with the TLB itself.
> 
> This would happen even with the classic page tables on Cortex-A15, L1
> entries are cached.

That's why its there at pte level.  On classic page tables there's no pmds
or puds to consider.

  reply	other threads:[~2011-03-11 19:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-14 17:39 [RFC PATCH 2/2] ARMv7: Invalidate the TLB before freeing page tables Catalin Marinas
2011-02-15 10:31 ` Russell King - ARM Linux
2011-02-15 11:02   ` Catalin Marinas
2011-02-15 11:32     ` Russell King - ARM Linux
2011-02-15 12:14       ` Russell King - ARM Linux
2011-02-15 14:42         ` Catalin Marinas
2011-02-20 12:12           ` Russell King - ARM Linux
2011-02-21  9:39             ` Catalin Marinas
2011-02-21 10:30               ` Russell King - ARM Linux
2011-02-21 11:04                 ` Catalin Marinas
2011-02-21 11:17                   ` Russell King - ARM Linux
2011-03-09 15:40         ` Catalin Marinas
2011-03-09 18:35           ` Russell King - ARM Linux
2011-03-11 17:32             ` Catalin Marinas
2011-03-11 19:24               ` Russell King - ARM Linux [this message]
2011-03-14 11:15                 ` Catalin Marinas
2011-03-14 11:19                   ` Russell King - ARM Linux
2011-02-15 12:29       ` Catalin Marinas

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=20110311192455.GA23109@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).