linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steve Capper <steve.capper@linaro.org>
To: linux@arm.linux.org.uk, akpm@linux-foundation.org
Cc: will.deacon@arm.com, catalin.marinas@arm.com,
	robherring2@gmail.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, gerald.schaefer@de.ibm.com,
	Steve Capper <steve.capper@linaro.org>
Subject: [PATCH V2 3/5] arm: mm: Make mmu_gather aware of huge pages
Date: Wed, 16 Apr 2014 12:46:41 +0100	[thread overview]
Message-ID: <1397648803-15961-4-git-send-email-steve.capper@linaro.org> (raw)
In-Reply-To: <1397648803-15961-1-git-send-email-steve.capper@linaro.org>

Huge pages on short descriptors are arranged as pairs of 1MB sections.
We need to be careful and ensure that the TLBs for both sections are
flushed when we tlb_add_flush on a HugeTLB page.

This patch extends the tlb flush range to HPAGE_SIZE rather than
PAGE_SIZE when addresses belonging to huge page VMAs are added to
the flush range.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
 arch/arm/include/asm/tlb.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 0baf7f0..b2498e6 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -81,10 +81,17 @@ static inline void tlb_flush(struct mmu_gather *tlb)
 static inline void tlb_add_flush(struct mmu_gather *tlb, unsigned long addr)
 {
 	if (!tlb->fullmm) {
+		unsigned long size = PAGE_SIZE;
+
 		if (addr < tlb->range_start)
 			tlb->range_start = addr;
-		if (addr + PAGE_SIZE > tlb->range_end)
-			tlb->range_end = addr + PAGE_SIZE;
+
+		if (!config_enabled(CONFIG_ARM_LPAE) && tlb->vma
+				&& is_vm_hugetlb_page(tlb->vma))
+			size = HPAGE_SIZE;
+
+		if (addr + size > tlb->range_end)
+			tlb->range_end = addr + size;
 	}
 }
 
-- 
1.8.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2014-04-16 11:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16 11:46 [PATCH V2 0/5] Huge pages for short descriptors on ARM Steve Capper
2014-04-16 11:46 ` [PATCH V2 1/5] mm: hugetlb: Introduce huge_pte_{page,present,young} Steve Capper
2014-04-16 11:46 ` [PATCH V2 2/5] arm: mm: Adjust the parameters for __sync_icache_dcache Steve Capper
2014-04-16 11:46 ` Steve Capper [this message]
2014-04-16 11:46 ` [PATCH V2 4/5] arm: mm: HugeTLB support for non-LPAE systems Steve Capper
2014-04-16 11:46 ` [PATCH V2 5/5] arm: mm: Add Transparent HugePage support for non-LPAE Steve Capper
2014-04-24 10:22 ` [PATCH V2 0/5] Huge pages for short descriptors on ARM Steve Capper
2014-04-24 10:36   ` Will Deacon
2014-04-24 10:42     ` Russell King - ARM Linux
2014-04-24 10:46       ` Will Deacon
2014-04-24 10:55       ` Steve Capper
2014-04-24 11:03         ` Russell King - ARM Linux
2014-04-24 12:03           ` Steve Capper
2014-06-03  0:27           ` Grazvydas Ignotas
2014-04-24 13:33     ` Rob Herring

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=1397648803-15961-4-git-send-email-steve.capper@linaro.org \
    --to=steve.capper@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@arm.linux.org.uk \
    --cc=robherring2@gmail.com \
    --cc=will.deacon@arm.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).