From: Andrea Arcangeli <aarcange@redhat.com>
To: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
Adam Litke <agl@us.ibm.com>, Avi Kivity <avi@redhat.com>,
Izik Eidus <ieidus@redhat.com>,
Hugh Dickins <hugh.dickins@tiscali.co.uk>,
Nick Piggin <npiggin@suse.de>, Rik van Riel <riel@redhat.com>,
Mel Gorman <mel@csn.ul.ie>, Dave Hansen <dave@linux.vnet.ibm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Ingo Molnar <mingo@elte.hu>, Mike Travis <travis@sgi.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Christoph Lameter <cl@linux-foundation.org>,
Chris Wright <chrisw@sous-sol.org>,
bpicco@redhat.com,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Balbir Singh <balbir@linux.vnet.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
"Michael S. Tsirkin" <mst@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Subject: [PATCH 38 of 41] mincore transparent hugepage support
Date: Mon, 29 Mar 2010 20:37:51 +0200 [thread overview]
Message-ID: <a1e16491610ef651bac9.1269887871@v2.random> (raw)
In-Reply-To: <patchbomb.1269887833@v2.random>
From: Johannes Weiner <hannes@cmpxchg.org>
Handle transparent huge page pmd entries natively instead of splitting
them into subpages.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
---
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -19,6 +19,9 @@ extern struct page *follow_trans_huge_pm
extern int zap_huge_pmd(struct mmu_gather *tlb,
struct vm_area_struct *vma,
pmd_t *pmd);
+extern int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
+ unsigned long addr, unsigned long end,
+ unsigned char *vec);
enum transparent_hugepage_flag {
TRANSPARENT_HUGEPAGE_FLAG,
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -936,6 +936,31 @@ int zap_huge_pmd(struct mmu_gather *tlb,
return ret;
}
+int mincore_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
+ unsigned long addr, unsigned long end,
+ unsigned char *vec)
+{
+ int ret = 0;
+
+ spin_lock(&vma->vm_mm->page_table_lock);
+ if (likely(pmd_trans_huge(*pmd))) {
+ ret = !pmd_trans_splitting(*pmd);
+ spin_unlock(&vma->vm_mm->page_table_lock);
+ if (unlikely(!ret))
+ wait_split_huge_page(vma->anon_vma, pmd);
+ else {
+ /*
+ * All logical pages in the range are present
+ * if backed by a huge page.
+ */
+ memset(vec, 1, (end - addr) >> PAGE_SHIFT);
+ }
+ } else
+ spin_unlock(&vma->vm_mm->page_table_lock);
+
+ return ret;
+}
+
pmd_t *page_check_address_pmd(struct page *page,
struct mm_struct *mm,
unsigned long address,
diff --git a/mm/mincore.c b/mm/mincore.c
--- a/mm/mincore.c
+++ b/mm/mincore.c
@@ -154,7 +154,13 @@ static void mincore_pmd_range(struct vm_
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
- split_huge_page_pmd(vma->vm_mm, pmd);
+ if (pmd_trans_huge(*pmd)) {
+ if (mincore_huge_pmd(vma, pmd, addr, next, vec)) {
+ vec += (next - addr) >> PAGE_SHIFT;
+ continue;
+ }
+ /* fall through */
+ }
if (pmd_none_or_clear_bad(pmd))
mincore_unmapped_range(vma, addr, next, vec);
else
--
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>
next prev parent reply other threads:[~2010-03-29 18:41 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 18:37 [PATCH 00 of 41] Transparent Hugepage Support #16 Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 01 of 41] define MADV_HUGEPAGE Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 02 of 41] compound_lock Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 03 of 41] alter compound get_page/put_page Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 04 of 41] update futex compound knowledge Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 05 of 41] fix bad_page to show the real reason the page is bad Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 06 of 41] clear compound mapping Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 07 of 41] add native_set_pmd_at Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 08 of 41] add pmd paravirt ops Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 09 of 41] no paravirt version of pmd ops Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 10 of 41] export maybe_mkwrite Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 11 of 41] comment reminder in destroy_compound_page Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 12 of 41] config_transparent_hugepage Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 13 of 41] special pmd_trans_* functions Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 14 of 41] add pmd mangling generic functions Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 15 of 41] add pmd mangling functions to x86 Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 16 of 41] bail out gup_fast on splitting pmd Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 17 of 41] pte alloc trans splitting Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 18 of 41] add pmd mmu_notifier helpers Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 19 of 41] clear page compound Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 20 of 41] add pmd_huge_pte to mm_struct Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 21 of 41] split_huge_page_mm/vma Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 22 of 41] split_huge_page paging Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 23 of 41] clear_copy_huge_page Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 24 of 41] kvm mmu transparent hugepage support Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 25 of 41] _GFP_NO_KSWAPD Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 26 of 41] don't alloc harder for gfp nomemalloc even if nowait Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 27 of 41] transparent hugepage core Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 28 of 41] verify pmd_trans_huge isn't leaking Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 29 of 41] madvise(MADV_HUGEPAGE) Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 30 of 41] pmd_trans_huge migrate bugcheck Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 31 of 41] memcg compound Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 32 of 41] memcg huge memory Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 33 of 41] transparent hugepage vmstat Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 34 of 41] khugepaged Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 35 of 41] skip transhuge pages in ksm for now Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 36 of 41] remove PG_buddy Andrea Arcangeli
2010-03-29 18:49 ` Peter Zijlstra
2010-03-29 20:18 ` Benjamin Herrenschmidt
2010-03-29 22:17 ` Andrea Arcangeli
2010-03-29 22:30 ` Dave Hansen
2010-03-30 0:15 ` Andrea Arcangeli
2010-03-30 1:06 ` Andrea Arcangeli
2010-04-01 18:15 ` Andrea Arcangeli
2010-03-30 16:35 ` Christoph Lameter
2010-03-30 16:44 ` Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 37 of 41] add x86 32bit support Andrea Arcangeli
2010-03-29 18:37 ` Andrea Arcangeli [this message]
2010-03-29 18:37 ` [PATCH 39 of 41] add pmd_modify Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 40 of 41] mprotect: pass vma down to page table walkers Andrea Arcangeli
2010-03-29 18:37 ` [PATCH 41 of 41] mprotect: transparent huge page support Andrea Arcangeli
2010-03-31 5:10 ` [PATCH 00 of 41] Transparent Hugepage Support #16 KAMEZAWA Hiroyuki
2010-03-31 15:33 ` Andrea Arcangeli
2010-03-31 16:24 ` Christoph Lameter
2010-03-31 16:41 ` Andrea Arcangeli
2010-03-31 18:59 ` Christoph Lameter
-- strict thread matches above, loose matches on Subject: below --
2010-04-02 0:41 [PATCH 00 of 41] Transparent Hugepage Support #17 Andrea Arcangeli
2010-04-02 0:42 ` [PATCH 38 of 41] mincore transparent hugepage support Andrea Arcangeli
2010-03-26 17:00 [PATCH 00 of 41] Transparent Hugepage Support #15 Andrea Arcangeli
2010-03-26 17:00 ` [PATCH 38 of 41] mincore transparent hugepage support Andrea Arcangeli
2010-03-26 18:13 ` Rik van Riel
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=a1e16491610ef651bac9.1269887871@v2.random \
--to=aarcange@redhat.com \
--cc=agl@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=avi@redhat.com \
--cc=balbir@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=bpicco@redhat.com \
--cc=chrisw@sous-sol.org \
--cc=cl@linux-foundation.org \
--cc=dave@linux.vnet.ibm.com \
--cc=hannes@cmpxchg.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=ieidus@redhat.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mingo@elte.hu \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=npiggin@suse.de \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
--cc=travis@sgi.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).