All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ARM: Tidying up huge pages in 3.11-rc1
@ 2013-07-17 13:26 Steve Capper
  2013-07-17 13:26 ` [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM Steve Capper
  2013-07-17 13:26 ` [PATCH 2/2] ARM: mm: Remove HugeTLB warning from dma-mapping.c Steve Capper
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Capper @ 2013-07-17 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

These two patches tidy up the huge page support in ARM that was
introduced in 3.11-rc1.

The first patch removes some duplicate code from arch/arm/mm by
referencing the mm/ functions introduced in my ARM64 huge page
series.

Whilst the second patch removes a compiler warning in the DMA
allocator that appears when huge pages are enabled.

Steve Capper (2):
  ARM: mm: Remove general hugetlb code from ARM.
  ARM: mm: Remove HugeTLB warning from dma-mapping.c

 arch/arm/Kconfig          |  3 +++
 arch/arm/mm/dma-mapping.c |  3 ---
 arch/arm/mm/hugetlbpage.c | 43 -------------------------------------------
 3 files changed, 3 insertions(+), 46 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM.
  2013-07-17 13:26 [PATCH 0/2] ARM: Tidying up huge pages in 3.11-rc1 Steve Capper
@ 2013-07-17 13:26 ` Steve Capper
  2013-07-17 15:43   ` Catalin Marinas
  2013-07-17 13:26 ` [PATCH 2/2] ARM: mm: Remove HugeTLB warning from dma-mapping.c Steve Capper
  1 sibling, 1 reply; 7+ messages in thread
From: Steve Capper @ 2013-07-17 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd
are now available in mm/hugetlb.c.

This patch removes the ARM copies of these functions and activates
the general ones by enabling:
CONFIG_ARCH_WANT_GENERAL_HUGETLB

Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
 arch/arm/Kconfig          |  3 +++
 arch/arm/mm/hugetlbpage.c | 43 -------------------------------------------
 2 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index ba412e0..d0fd5bf 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1757,6 +1757,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE
        def_bool y
        depends on ARM_LPAE
 
+config ARCH_WANT_GENERAL_HUGETLB
+	def_bool y
+
 source "mm/Kconfig"
 
 config FORCE_MAX_ZONEORDER
diff --git a/arch/arm/mm/hugetlbpage.c b/arch/arm/mm/hugetlbpage.c
index 3d1e4a2..66781bf 100644
--- a/arch/arm/mm/hugetlbpage.c
+++ b/arch/arm/mm/hugetlbpage.c
@@ -36,22 +36,6 @@
  * of type casting from pmd_t * to pte_t *.
  */
 
-pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
-{
-	pgd_t *pgd;
-	pud_t *pud;
-	pmd_t *pmd = NULL;
-
-	pgd = pgd_offset(mm, addr);
-	if (pgd_present(*pgd)) {
-		pud = pud_offset(pgd, addr);
-		if (pud_present(*pud))
-			pmd = pmd_offset(pud, addr);
-	}
-
-	return (pte_t *)pmd;
-}
-
 struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
 			      int write)
 {
@@ -68,33 +52,6 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
 	return 0;
 }
 
-pte_t *huge_pte_alloc(struct mm_struct *mm,
-			unsigned long addr, unsigned long sz)
-{
-	pgd_t *pgd;
-	pud_t *pud;
-	pte_t *pte = NULL;
-
-	pgd = pgd_offset(mm, addr);
-	pud = pud_alloc(mm, pgd, addr);
-	if (pud)
-		pte = (pte_t *)pmd_alloc(mm, pud, addr);
-
-	return pte;
-}
-
-struct page *
-follow_huge_pmd(struct mm_struct *mm, unsigned long address,
-		pmd_t *pmd, int write)
-{
-	struct page *page;
-
-	page = pte_page(*(pte_t *)pmd);
-	if (page)
-		page += ((address & ~PMD_MASK) >> PAGE_SHIFT);
-	return page;
-}
-
 int pmd_huge(pmd_t pmd)
 {
 	return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ARM: mm: Remove HugeTLB warning from dma-mapping.c
  2013-07-17 13:26 [PATCH 0/2] ARM: Tidying up huge pages in 3.11-rc1 Steve Capper
  2013-07-17 13:26 ` [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM Steve Capper
@ 2013-07-17 13:26 ` Steve Capper
  1 sibling, 0 replies; 7+ messages in thread
From: Steve Capper @ 2013-07-17 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

The coherant DMA allocator code contained a compile time warning
when HugeTLB support was enabled. It stated that huge pages were
not supported by the DMA allocator.

Apart from memory pressure, HugeTLB should not affect (or be
affected by) the higher order pages operated on by the DMA
allocator. Also, the user space mappings returned by arm_dma_mmap
are done via remap_pfn_range, so the Transparent Huge Page daemon
will leave them alone too.

This patch removes the huge page warning from dma-mapping.c.

Signed-off-by: Steve Capper <steve.capper@linaro.org>
---
 arch/arm/mm/dma-mapping.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 7f9b179..9486048 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -249,9 +249,6 @@ static void __dma_free_buffer(struct page *page, size_t size)
 }
 
 #ifdef CONFIG_MMU
-#ifdef CONFIG_HUGETLB_PAGE
-#warning ARM Coherent DMA allocator does not (yet) support huge TLB
-#endif
 
 static void *__alloc_from_contiguous(struct device *dev, size_t size,
 				     pgprot_t prot, struct page **ret_page,
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM.
  2013-07-17 13:26 ` [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM Steve Capper
@ 2013-07-17 15:43   ` Catalin Marinas
  2013-07-26 13:40     ` Steve Capper
  0 siblings, 1 reply; 7+ messages in thread
From: Catalin Marinas @ 2013-07-17 15:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 17, 2013 at 02:26:13PM +0100, Steve Capper wrote:
> General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd
> are now available in mm/hugetlb.c.
> 
> This patch removes the ARM copies of these functions and activates
> the general ones by enabling:
> CONFIG_ARCH_WANT_GENERAL_HUGETLB
> 
> Signed-off-by: Steve Capper <steve.capper@linaro.org>

Acked-by: Catalin Marinas <catalin.marinas@arm.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM.
  2013-07-17 15:43   ` Catalin Marinas
@ 2013-07-26 13:40     ` Steve Capper
  2013-07-26 13:49       ` Will Deacon
  0 siblings, 1 reply; 7+ messages in thread
From: Steve Capper @ 2013-07-26 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 17, 2013 at 04:43:38PM +0100, Catalin Marinas wrote:
> On Wed, Jul 17, 2013 at 02:26:13PM +0100, Steve Capper wrote:
> > General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd
> > are now available in mm/hugetlb.c.
> > 
> > This patch removes the ARM copies of these functions and activates
> > the general ones by enabling:
> > CONFIG_ARCH_WANT_GENERAL_HUGETLB
> > 
> > Signed-off-by: Steve Capper <steve.capper@linaro.org>
> 
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

If no-one has any objections should I put this into Russell's
patch system?

Cheers,
-- 
Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM.
  2013-07-26 13:40     ` Steve Capper
@ 2013-07-26 13:49       ` Will Deacon
  2013-07-26 14:00         ` Steve Capper
  0 siblings, 1 reply; 7+ messages in thread
From: Will Deacon @ 2013-07-26 13:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 26, 2013 at 02:40:48PM +0100, Steve Capper wrote:
> On Wed, Jul 17, 2013 at 04:43:38PM +0100, Catalin Marinas wrote:
> > On Wed, Jul 17, 2013 at 02:26:13PM +0100, Steve Capper wrote:
> > > General forms of huge_pte_alloc, huge_pte_offset and follow_huge_pmd
> > > are now available in mm/hugetlb.c.
> > > 
> > > This patch removes the ARM copies of these functions and activates
> > > the general ones by enabling:
> > > CONFIG_ARCH_WANT_GENERAL_HUGETLB
> > > 
> > > Signed-off-by: Steve Capper <steve.capper@linaro.org>
> > 
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> 
> If no-one has any objections should I put this into Russell's
> patch system?

Yes please.

Will

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM.
  2013-07-26 13:49       ` Will Deacon
@ 2013-07-26 14:00         ` Steve Capper
  0 siblings, 0 replies; 7+ messages in thread
From: Steve Capper @ 2013-07-26 14:00 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jul 26, 2013 at 02:49:20PM +0100, Will Deacon wrote:
> On Fri, Jul 26, 2013 at 02:40:48PM +0100, Steve Capper wrote:
> > 
> > If no-one has any objections should I put this into Russell's
> > patch system?
> 
> Yes please.
> 
> Will

I've added it now, its reference is 7792/1.

Cheers,
-- 
Steve

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-26 14:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 13:26 [PATCH 0/2] ARM: Tidying up huge pages in 3.11-rc1 Steve Capper
2013-07-17 13:26 ` [PATCH 1/2] ARM: mm: Remove general hugetlb code from ARM Steve Capper
2013-07-17 15:43   ` Catalin Marinas
2013-07-26 13:40     ` Steve Capper
2013-07-26 13:49       ` Will Deacon
2013-07-26 14:00         ` Steve Capper
2013-07-17 13:26 ` [PATCH 2/2] ARM: mm: Remove HugeTLB warning from dma-mapping.c Steve Capper

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.