From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/2] ARMv7: Invalidate the TLB before freeing page tables
Date: Wed, 9 Mar 2011 15:40:05 +0000 [thread overview]
Message-ID: <AANLkTindKihW3Hv4gdWakPcBAfFCrnd5wzSXN7K=Ac0h@mail.gmail.com> (raw)
In-Reply-To: <20110215121437.GG4152@n2100.arm.linux.org.uk>
On 15 February 2011 12:14, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Note that the generic code doesn't allow us to delay frees on UP as it
> assumes that if there's no TLB entry, the CPU won't speculatively
> prefetch. ?This seems to be where ARM differs from the rest of the
> planet. ?Please confirm that this is indeed the case.
>
> ?arch/arm/include/asm/tlb.h | ? 79 +++++++++++++++++++++++++++++++++++++-------
> ?1 files changed, 67 insertions(+), 12 deletions(-)
>
> diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
> index f41a6f5..1ca3e16 100644
> --- a/arch/arm/include/asm/tlb.h
> +++ b/arch/arm/include/asm/tlb.h
[...]
> +static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr)
> +{
> + ? ? ? if (!tlb->fullmm) {
> + ? ? ? ? ? ? ? if (addr < tlb->range_start)
> + ? ? ? ? ? ? ? ? ? ? ? tlb->range_start = addr;
> + ? ? ? ? ? ? ? if (addr + PAGE_SIZE > tlb->range_end)
> + ? ? ? ? ? ? ? ? ? ? ? tlb->range_end = addr + PAGE_SIZE;
> + ? ? ? }
> +}
[...]
> +static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
> + ? ? ? unsigned long addr)
> +{
> + ? ? ? pgtable_page_dtor(pte);
> + ? ? ? tlb_add_flush(addr);
> + ? ? ? tlb_remove_page(tlb, pte);
> ?}
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?
--
Catalin
next prev parent reply other threads:[~2011-03-09 15:40 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 [this message]
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
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='AANLkTindKihW3Hv4gdWakPcBAfFCrnd5wzSXN7K=Ac0h@mail.gmail.com' \
--to=catalin.marinas@arm.com \
--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).