linux-mips
[Top] [All Lists]

Re: [PATCH 1/3] MIPS: Add support for transparent huge page

To: Hillf Danton <dhillf@gmail.com>
Subject: Re: [PATCH 1/3] MIPS: Add support for transparent huge page
From: David Daney <ddaney.cavm@gmail.com>
Date: Tue, 24 Apr 2012 16:27:05 -0700
Cc: Ralf Baechle <ralf@linux-mips.org>, Andrea Arcangeli <aarcange@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mips@linux-mips.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=SXviY1N3tuuHuWTq9GDaVxWoQI8R7ejIkuXAntOsgcs=; b=KMyKCWhsCBD3gBbNnLHGjkB2rvAkdIP6kqbighSBSlPsfl/yhPxMcku8cxIi3jc305 9en6Z3KVC2shjAUsq01mgKgJ1a6sGLNz/2Sank+9kslksr6UbU5x0xW3ld4hxsqc2Hu4 EVZI9L8OYNVBt/MgH1BuniiNNhFhKuS3tQftL8vEUwwQNYU6tz+iO4Ug/YWostQJzr7S SHrZq9Ez54LF7qXlsKMvWcrTuT5Hf0RO2MSqsMEULku1kWO7uqmkfn+EslURAgzSqMEb Y3CYaLhocr7FDCOf+iGsXgUibezTmoWU++suKNWsA8N5ThfrQ3YJ8hfb1yvO2ADslTfk GHHA==
In-reply-to: <CAJd=RBAXc+QSX+xnJ2W9vVwK64Etrzrr=iBqPkJXNvYgwujQ_Q@mail.gmail.com>
References: <CAJd=RBAXc+QSX+xnJ2W9vVwK64Etrzrr=iBqPkJXNvYgwujQ_Q@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
On 11/26/2011 06:35 AM, Hillf Danton wrote:
This patchset adds THP support for MIPS.

Two page-table-entry bits, namely huge and splitting, are required by THP.
The huge bit is already defined and used for huge TLB, THP simply uses it.

For the splitting bit, the present bit is selected, since for regular pmd
entry pmd_present() is defined to be not directly related to the bit. If this
selection is not sane, this work as a whole is a mess. So selected then the
current work of huge TLB could also be used for THP, see next patch.

Other pmd mangling primitives are added in a straight manner, and they are
confined to a single file, asm/thp.h.


Signed-off-by: Hillf Danton<dhillf@gmail.com>
---

--- a/arch/mips/include/asm/pgtable-bits.h      Thu Nov 24 21:16:22 2011
+++ b/arch/mips/include/asm/pgtable-bits.h      Sat Nov 26 20:49:31 2011
@@ -94,7 +94,7 @@
  /* set:pagecache unset:swap */
  #define _PAGE_FILE            (_PAGE_MODIFIED)

-#ifdef CONFIG_HUGETLB_PAGE
+#if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE)
  /* huge tlb page */
  #define _PAGE_HUGE_SHIFT      (_PAGE_MODIFIED_SHIFT + 1)
  #define _PAGE_HUGE            (1<<  _PAGE_HUGE_SHIFT)
--- a/arch/mips/include/asm/pgtable.h   Thu Nov 24 21:17:38 2011
+++ b/arch/mips/include/asm/pgtable.h   Sat Nov 26 20:50:52 2011
@@ -394,6 +394,9 @@ static inline int io_remap_pfn_range(str
                remap_pfn_range(vma, vaddr, pfn, size, prot)
  #endif

+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
+#include<asm/thp.h>
+#endif
  #include<asm-generic/pgtable.h>

  /*
--- /dev/null   Sat Nov 26 21:04:52 2011
+++ b/arch/mips/include/asm/thp.h       Sat Nov 26 21:02:52 2011
@@ -0,0 +1,167 @@
+#ifndef _ASM_PGTABLE_THP_H
+#define _ASM_PGTABLE_THP_H
+/*
+ * pmd primitives for transparent huge page
+ *
+ * Copyright (C) 2011 David Daney

I'm not sure where that copyright came from.


Other than that, these seem plausible.

David Daney


<Prev in Thread] Current Thread [Next in Thread>