Minor changes to common hugetlb code for ARM
Subsystems (5)
cover Minor changes to common hugetlb code for ARM
Hello,
A few changes are required to common hugetlb code before the ARM support can be merged. I posted the main one previously, which has been picked up by akpm:
http://marc.info/?l=linux-mm&m=134573987631394&w=2
The remaining three patches (included here) are all fairly minor but do affect other architectures.
All comments welcome,
Will
Catalin Marinas (2):
mm: thp: Fix the pmd_clear() arguments in pmdp_get_and_clear()
mm: thp: Fix the update_mmu_cache() last argument passing in
mm/huge_memory.c
Steve Capper (1):
mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
arch/x86/Kconfig | 4 ++++ include/asm-generic/pgtable.h | 2 +- mm/Kconfig | 2 +- mm/huge_memory.c | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
1.7.4.1
PATCH 1/3 mm: thp: Fix the pmd_clear() arguments in pmdp_get_and_clear()
From: Catalin Marinas <[email protected]>
The CONFIG_TRANSPARENT_HUGEPAGE implementation of pmdp_get_and_clear() calls pmd_clear() with 3 arguments instead of 1.
--- include/asm-generic/pgtable.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/asm-generic/pgtable.h +1 -1
@@ -87,7 +87,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, pmd_t *pmdp) {pmd_t pmd = *pmdp; -pmd_clear (mm, address, pmdp); +pmd_clear (pmdp);return pmd; }#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
Signature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 2/3 mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
In reply to Will DeaconFrom: Catalin Marinas <[email protected]>
The update_mmu_cache() takes a pointer (to pte_t by default) as the last argument but the huge_memory.c passes a pmd_t value. The patch changes the argument to the pmd_t * pointer.
--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
mm/huge_memory.c +3 -3
@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd); ret |=VM_FAULT_WRITE ; goto out_unlock; }
@@ -986,7 +986,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,pmdp_clear_flush_notify (vma, haddr, pmd);page_add_new_anon_rmap (new_page, vma, haddr);set_pmd_at (mm, haddr, pmd, entry); -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);page_remove_rmap (page);put_page (page); ret |=VM_FAULT_WRITE ;
@@ -1989,7 +1989,7 @@ static void collapse_huge_page(struct mm_struct *mm,BUG_ON (!pmd_none (*pmd));page_add_new_anon_rmap (new_page, vma, address);set_pmd_at (mm, address, pmd, _pmd); -update_mmu_cache (vma, address, _pmd); +update_mmu_cache (vma, address, pmd);prepare_pmd_huge_pte (pgtable, mm);spin_unlock (&mm->page_table_lock);
Signature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 3/3 mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Will DeaconFrom: Steve Capper <[email protected]>
Different architectures have slightly different pre-requisites for supporting Transparent Huge Pages. To simplify the layout of mm/Kconfig, a new option HAVE_ARCH_TRANSPARENT_HUGEPAGE is introduced and set in each architecture's Kconfig file (at the moment x86, with ARM being set in a future patch).
--- arch/x86/Kconfig | 4 ++++ mm/Kconfig | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)
arch/x86/Kconfig +4 -0
@@ -1297,6 +1297,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU + source "mm/Kconfig" config HIGHPTE
mm/Kconfig +1 -1
@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages and
Signature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/3] mm: thp: Fix the pmd_clear() arguments in pmdp_get_and_clear()
In reply to Will DeaconQuoted 9 lines · Will Deacon
From: Catalin Marinas <[email protected]>
The
CONFIG_TRANSPARENT_HUGEPAGEimplementation ofpmdp_get_and_clear()callspmd_clear()with 3 arguments instead of 1.Cc Arnd Bergmann <[email protected]>Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>
Quoted 25 lines
--- include/asm-generic/pgtable.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/pgtable.h +1
-1@@ -87,7 +87,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, pmd_t *pmdp) {pmd_t pmd = *pmdp; -pmd_clear (mm, address, pmdp); +pmd_clear (pmdp);return pmd; }#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ Signature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
In reply to Will DeaconQuoted 9 lines · Will Deacon
From: Catalin Marinas <[email protected]>
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>
Quoted 43 lines
--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)mm/huge_memory.c +3
-3@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd); ret |=VM_FAULT_WRITE ; goto out_unlock; }@@ -986,7 +986,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,pmdp_clear_flush_notify (vma, haddr, pmd);page_add_new_anon_rmap (new_page, vma, haddr);set_pmd_at (mm, haddr, pmd, entry); -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);page_remove_rmap (page);put_page (page); ret |=VM_FAULT_WRITE ;@@ -1989,7 +1989,7 @@ static void collapse_huge_page(struct mm_struct *mm,BUG_ON (!pmd_none (*pmd));page_add_new_anon_rmap (new_page, vma, address);set_pmd_at (mm, address, pmd, _pmd); -update_mmu_cache (vma, address, _pmd); +update_mmu_cache (vma, address, pmd);prepare_pmd_huge_pte (pgtable, mm);spin_unlock (&mm->page_table_lock);Signature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 7 lines
Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Will DeaconQuoted 9 lines · Will Deacon
From: Steve Capper <[email protected]>
Different architectures have slightly different pre-requisites for supporting Transparent Huge Pages. To simplify the layout of mm/Kconfig, a new option
HAVE_ARCH_TRANSPARENT_HUGEPAGEis introduced and set in each architecture'sKconfigfile (at the moment x86, with ARM being set in a future patch).Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>
Quoted 41 lines
--- arch/x86/Kconfig | 4 ++++ mm/Kconfig | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)arch/x86/Kconfig +4
-0@@ -1297,6 +1297,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU + source "mm/Kconfig" config HIGHPTEmm/Kconfig +1
-1@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages andSignature · 7 lines
1.7.4.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Signature · 1 line
Kirill A. Shutemov
Quoted 1 line · Will Deacon
Hello,
Hi,
Quoted 8 lines
A few changes are required to common hugetlb code before the ARM support can be merged. I posted the main one previously, which has been picked up by akpm:
http://marc.info/?l=linux-mm&m=134573987631394&w=2
The remaining three patches (included here) are all fairly minor but do affect other architectures.
I am quite confused. Why THP changes are required for hugetlb code for ARM?
Besides that I would suggest adding Andrea to the CC (added now the whole series can be found here http://lkml.org/lkml/2012/9/11/322) list for all THP changes.
Quoted 22 lines
All comments welcome,
Will
Catalin Marinas (2):
mm: thp: Fix thepmd_clear()arguments inpmdp_get_and_clear()
mm: thp: Fix theupdate_mmu_cache()last argument passing in
mm/huge_memory.cSteve Capper (1):
mm: IntroduceHAVE_ARCH_TRANSPARENT_HUGEPAGEarch/x86/Kconfig | 4 ++++ include/asm-generic/pgtable.h | 2 +- mm/Kconfig | 2 +- mm/huge_memory.c | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-)Signature · 1 line
1.7.4.1
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 1/3] mm: thp: Fix the pmd_clear() arguments in pmdp_get_and_clear()
In reply to Will DeaconQuoted 4 lines · Will Deacon
From: Catalin Marinas <[email protected]>
The
CONFIG_TRANSPARENT_HUGEPAGEimplementation ofpmdp_get_and_clear()callspmd_clear()with 3 arguments instead of 1.
only for !__HAVE_ARCH_PMDP_GET_AND_CLEAR which doesn't seem to happen because x86 defines this and it uses pmd_update.
Quoted 5 lines
Cc Arnd Bergmann <[email protected]>Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>
Other than that it looks good.
Quoted 20 lines
--- include/asm-generic/pgtable.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)include/asm-generic/pgtable.h +1
-1@@ -87,7 +87,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm, pmd_t *pmdp) {pmd_t pmd = *pmdp; -pmd_clear (mm, address, pmdp); +pmd_clear (pmdp);return pmd; }#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ Signature · 1 line
1.7.4.1
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Will DeaconQuoted 9 lines · Will Deacon
From: Steve Capper <[email protected]>
Different architectures have slightly different pre-requisites for supporting Transparent Huge Pages. To simplify the layout of mm/Kconfig, a new option
HAVE_ARCH_TRANSPARENT_HUGEPAGEis introduced and set in each architecture'sKconfigfile (at the moment x86, with ARM being set in a future patch).Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>
Makes sense if there are going to be more archs to support THP.
Quoted 36 lines
--- arch/x86/Kconfig | 4 ++++ mm/Kconfig | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)arch/x86/Kconfig +4
-0@@ -1297,6 +1297,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU + source "mm/Kconfig" config HIGHPTEmm/Kconfig +1
-1@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages andSignature · 1 line
1.7.4.1
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
In reply to Will DeaconQuoted 18 lines · Will Deacon
From: Catalin Marinas <[email protected]>
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)mm/huge_memory.c +0
-0
mm/huge_memory.c int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, · line 937
Quoted 5 lines
mm/huge_memory.c +1
-1@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);
I am not sure but shouldn't we use the new entry rather than the given pmd?
Quoted 24 lines
mm/huge_memory.c +2
-2ret |=VM_FAULT_WRITE ; goto out_unlock; }@@ -986,7 +986,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,pmdp_clear_flush_notify (vma, haddr, pmd);page_add_new_anon_rmap (new_page, vma, haddr);set_pmd_at (mm, haddr, pmd, entry); -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);page_remove_rmap (page);put_page (page); ret |=VM_FAULT_WRITE ;@@ -1989,7 +1989,7 @@ static void collapse_huge_page(struct mm_struct *mm,BUG_ON (!pmd_none (*pmd));page_add_new_anon_rmap (new_page, vma, address);set_pmd_at (mm, address, pmd, _pmd); -update_mmu_cache (vma, address, _pmd); +update_mmu_cache (vma, address, pmd);prepare_pmd_huge_pte (pgtable, mm);spin_unlock (&mm->page_table_lock);Signature · 1 line
1.7.4.1
Signature · 2 lines
Michal Hocko SUSE Labs
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Quoted 14 lines · Michal Hocko
Quoted 13 lines · Will Deacon
From: Catalin Marinas <[email protected]>
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
Quoted 13 lines
mm/huge_memory.c int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, · line 937
Quoted 10 lines
mm/huge_memory.c +1
-1@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);I am not sure but shouldn't we use the new entry rather than the given pmd?
The pmd pointer is the new pmd and 'entry' is the new value derived from orig_pmd. update_mmu_cache() expects a pointer to pte_t or pmd_t rather than it's value.
Signature · 7 lines
Catalin -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Michal Hocko
Quoted 4 lines · Will Deacon
A few changes are required to common hugetlb code before the ARM support can be merged. I posted the main one previously, which has been picked up by akpm:
Quoted 7 lines
Quoted 4 lines
http://marc.info/?l=linux-mm&m=134573987631394&w=2
The remaining three patches (included here) are all fairly minor but do affect other architectures.
I am quite confused. Why THP changes are required for hugetlb code for ARM?
Sorry, I was being too vague. We add ARM support for THP in the same patch series as hugetlb, so I was loosely referring to that lot.
Quoted 3 lines
Besides that I would suggest adding Andrea to the CC (added now the whole series can be found here http://lkml.org/lkml/2012/9/11/322) list for all THP changes.
Thanks for that, I'll add Andrew to future submissions.
Will
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Michal HockoQuoted 1 line · Michal Hocko
Makes sense if there are going to be more archs to support THP.
The tile architecture currently supports it in our in-house tree, though we haven't returned it to the community yet.
Signature · 2 lines
Chris Metcalf, Tilera Corp. http://www.tilera.com
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
Quoted 5 lines · Chris Metcalf
Quoted 1 line · Michal Hocko
Makes sense if there are going to be more archs to support THP.
The tile architecture currently supports it in our in-house tree, though we haven't returned it to the community yet.
That's a similar situation for AArch64. We hope to post the arm patches pretty soon though, just ironing out some issues with the thp code.
Unfortunately, it looks like there might be one more change to the core code as we don't have hardware page aging and need to manipulate the YOUNG bit explicitly.
Will
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrea Arcangeli
Reviewed-byHi everyone,
Quoted 9 lines · Michal Hocko
Quoted 1 line · Will Deacon
Hello,
Hi,
Quoted 4 lines
A few changes are required to common hugetlb code before the ARM support can be merged. I posted the main one previously, which has been picked up by akpm:
Quoted 7 lines
Quoted 4 lines
http://marc.info/?l=linux-mm&m=134573987631394&w=2
The remaining three patches (included here) are all fairly minor but do affect other architectures.
I am quite confused. Why THP changes are required for hugetlb code for ARM?
Some functions are just noops on x86 and with no arch other than x86 building the huge_memory.c file, those x86-noop parts that needed minor interface adjustments couldn't be noticed until now.
Hopefully we got the brainer part right (i.e. the location of the x86 noop callouts), it's clearly untested.
Quoted 13 lines
Besides that I would suggest adding Andrea to the CC (added now the whole series can be found here http://lkml.org/lkml/2012/9/11/322) list for all THP changes.
Quoted 9 lines
All comments welcome,
Will
Catalin Marinas (2):
mm: thp: Fix thepmd_clear()arguments inpmdp_get_and_clear()
mm: thp: Fix theupdate_mmu_cache()last argument passing in
mm/huge_memory.c
Both:
Quoted 3 lines
Quoted 3 lines
Steve Capper (1):
mm: IntroduceHAVE_ARCH_TRANSPARENT_HUGEPAGE
This was already introduced by the s390 THP support which I reviewed a few days ago, and it's already included in -mm, so it can be dropped.
Thanks!
Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 8 lines · Will Deacon
Quoted 7 lines · Michal Hocko
Quoted 6 lines · Will Deacon
A few changes are required to common hugetlb code before the ARM support can be merged. I posted the main one previously, which has been picked up by akpm:
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
The remaining three patches (included here) are all fairly minor but do affect other architectures.
I am quite confused. Why THP changes are required for hugetlb code for ARM?
Sorry, I was being too vague. We add ARM support for THP in the same patch series as hugetlb, so I was loosely referring to that lot.
OK, it makes more sense now. Thanks for the clarification.
Signature · 2 lines
Michal Hocko SUSE Labs
Andrew Morton
maintainerRe: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Will DeaconQuoted 25 lines · On Tue, 11 Sep 2012 17:47:16 +0100 Will Deacon <[email protected]> wrote:
From: Steve Capper <[email protected]>
Different architectures have slightly different pre-requisites for supporting Transparent Huge Pages. To simplify the layout of mm/Kconfig, a new option
HAVE_ARCH_TRANSPARENT_HUGEPAGEis introduced and set in each architecture'sKconfigfile (at the moment x86, with ARM being set in a future patch).arch/x86/Kconfig +4
-0@@ -1297,6 +1297,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU + source "mm/Kconfig" config HIGHPTEmm/Kconfig +0
-0
mm/Kconfig config NOMMU_INITIAL_TRIM_EXCESS · line 324
Quoted 8 lines
mm/Kconfig +1
-1@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages and
We need to talk with Gerald concerning
http://ozlabs.org/~akpm/mmotm/broken-out/thp-x86-introduce-have_arch_transparent_hugepage.patch
I did this. Please check.
From: Steve Capper <[email protected]>
Subject: mm: introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
Different architectures have slightly different pre-requisites for supporting Transparent Huge Pages. To simplify the layout of mm/Kconfig, a new option HAVE_ARCH_TRANSPARENT_HUGEPAGE is introduced and set in each architecture's Kconfig file (at the moment x86, with ARM being set in a future patch).
---
arch/x86/Kconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepage +4 -1
@@ -83,7 +83,6 @@ config X86 select IRQ_FORCED_THREADING select USE_GENERIC_SMP_HELPERS if SMP select HAVE_BPF_JIT if X86_64 - select HAVE_ARCH_TRANSPARENT_HUGEPAGE select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP
@@ -1330,6 +1329,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU + source "mm/Kconfig" config HIGHPTE
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
Hi Andrew,
Quoted 20 lines · Andrew Morton
mm/Kconfig config NOMMU_INITIAL_TRIM_EXCESS · line 324
Quoted 13 lines · On Tue, 11 Sep 2012 17:47:16 +0100 Will Deacon <[email protected]> wrote:
mm/Kconfig +1
-1@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages andWe need to talk with Gerald concerning
http://ozlabs.org/~akpm/mmotm/broken-out/thp-x86-introduce-have_arch_transparent_hugepage.patch
Quoted 1 line
I did this. Please check.
[...]
We missed Gerald's patch for s390 and, having picked it into our tree, it acts as a drop-in replacement for what we came up with. So I think you can just drop our patch ("mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE") altogether.
Cheers,
Will
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
In reply to Andrew MortonHi Andrew,
arch/x86/Kconfig config X86 · line 86
Quoted 9 lines · On Thu, 13 Sep 2012 12:05:14 -0700 Andrew Morton <[email protected]>…
diff -puN
arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepagearch/x86/Kconfigarch/x86/Kconfig renamed from arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepage +0
-1@@ -83,7 +83,6 @@ config X86 select IRQ_FORCED_THREADING select USE_GENERIC_SMP_HELPERS if SMP select HAVE_BPF_JIT if X86_64 - select HAVE_ARCH_TRANSPARENT_HUGEPAGE
Why not
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if MMU
Quoted 11 lines
arch/x86/Kconfig renamed from arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepage +4
-0select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP@@ -1330,6 +1329,10 @@ config ILLEGAL_POINTER_VALUE default 0 if X86_32 default 0xdead000000000000 if X86_64 +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + def_bool y + depends on MMU +
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Andrew Morton
maintainerRe: [PATCH 3/3] mm: Introduce HAVE_ARCH_TRANSPARENT_HUGEPAGE
Quoted 4 lines · On Fri, 14 Sep 2012 07:27:32 +1000 Stephen Rothwell <[email protected]>…
Hi Andrew,
Quoted 1 line · On Thu, 13 Sep 2012 12:05:14 -0700 Andrew Morton <[email protected]>…
Quoted 12 lines
arch/x86/Kconfig config X86 · line 86
Quoted 8 lines
diff -puN
arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepagearch/x86/Kconfigarch/x86/Kconfig renamed from arch/x86/Kconfig~mm-introduce-have_arch_transparent_hugepage +0
-1@@ -83,7 +83,6 @@ config X86 select IRQ_FORCED_THREADING select USE_GENERIC_SMP_HELPERS if SMP select HAVE_BPF_JIT if X86_64 - select HAVE_ARCH_TRANSPARENT_HUGEPAGEWhy not
selectHAVE_ARCH_TRANSPARENT_HUGEPAGEif MMU
Well, this is in arch/x86/Kconfig, where MMU is known to always be set.
Yes, I think Gerald's patch will suffice:
arch/Kconfig renamed from arch/Kconfig~thp-x86-introduce-have_arch_transparent_hugepage +3 -0
@@ -326,4 +326,7 @@ config HAVE_RCU_USER_QS are already protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on irq exit still need to be protected. +config HAVE_ARCH_TRANSPARENT_HUGEPAGE + bool + source "kernel/gcov/Kconfig"
arch/x86/Kconfig renamed from arch/x86/Kconfig~thp-x86-introduce-have_arch_transparent_hugepage +1 -0
@@ -83,6 +83,7 @@ config X86 select IRQ_FORCED_THREADING select USE_GENERIC_SMP_HELPERS if SMP select HAVE_BPF_JIT if X86_64 + select HAVE_ARCH_TRANSPARENT_HUGEPAGE select CLKEVT_I8253 select ARCH_HAVE_NMI_SAFE_CMPXCHG select GENERIC_IOMAP
mm/Kconfig renamed from mm/Kconfig~thp-x86-introduce-have_arch_transparent_hugepage +1 -1
@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS config TRANSPARENT_HUGEPAGE bool "Transparent Hugepage Support" - depends on X86 && MMU + depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE select COMPACTION help Transparent Hugepages allows the kernel to use huge pages and
_
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
In reply to Will DeaconQuoted 16 lines · Will Deacon
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)mm/huge_memory.c +0
-0
mm/huge_memory.c int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, · line 937
Quoted 5 lines
mm/huge_memory.c +1
-1@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);
Documentation/cachetlb.txt will need an update as well. Currently it says:
5) void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
I would prefer we introduce something like update_mmu_cache_huge_page(vma, address, pmd) and leave the classic update_mmu_cache() unchanged.
Ralf
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerRe: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Quoted 26 lines · On Sat, 15 Sep 2012 15:38:33 +0200 Ralf Baechle <[email protected]> wrote:
Quoted 16 lines · Will Deacon
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)mm/huge_memory.c +0
-0mm/huge_memory.c int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, · line 937
Quoted 5 lines
mm/huge_memory.c +1
-1@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);
Documentation/cachetlb.txtwill need an update as well. Currently it says:
Quoted 2 lines
5) void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)
Yes please.
Quoted 2 lines
I would prefer we introduce something like
update_mmu_cache_huge_page(vma, address, pmd)and leave the classicupdate_mmu_cache()unchanged.
Why?
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Quoted 27 lines · Andrew Morton
Quoted 25 lines · On Sat, 15 Sep 2012 15:38:33 +0200 Ralf Baechle <[email protected]> wrote:
Quoted 16 lines · Will Deacon
The
update_mmu_cache()takes a pointer (topte_tby default) as the last argument but thehuge_memory.cpasses apmd_tvalue. The patch changes the argument to thepmd_t* pointer.Signed-off-by Catalin Marinas <[email protected]>Signed-off-by Steve Capper <[email protected]>Signed-off-by Will Deacon <[email protected]>--- mm/huge_memory.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)mm/huge_memory.c +0
-0mm/huge_memory.c int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, · line 937
Quoted 5 lines
mm/huge_memory.c +1
-1@@ -934,7 +934,7 @@ int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, entry =pmd_mkyoung (orig_pmd); entry =maybe_pmd_mkwrite (pmd_mkdirty (entry), vma);if (pmdp_set_access_flags (vma, haddr, pmd, entry,1 )) -update_mmu_cache (vma, address, entry); +update_mmu_cache (vma, address, pmd);
Documentation/cachetlb.txtwill need an update as well. Currently it says:
Quoted 4 lines
Quoted 2 lines
5) void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)Yes please.
Should we just use a generic (void *) for the last argument or force a cast in mm/huge_memory.c?
Ralf's point is that transparent huge page code calls update_mmu_cache with a (pmd_t *) as the last argument. This could make sense for THP as it assumes that huge pages can only be created at the pmd level. But that's unlike mm/hugetlb.c which casts huge page types to pte_t, even though on ARM they are implemented at the pmd level.
On ARM (with VIPT caches) update_mmu_cache() is empty like on x86, though a static inline rather than macro.
Signature · 1 line
Catalin
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Quoted 8 lines · Catalin Marinas
Quoted 4 lines
Quoted 2 lines
5) void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)Yes please.
Should we just use a generic (void *) for the last argument or force a cast in
mm/huge_memory.c?
Quoted 8 lines
Ralf's point is that transparent huge page code calls
update_mmu_cachewith a (pmd_t*) as the last argument. This could make sense for THP as it assumes that huge pages can only be created at the pmd level. But that's unlikemm/hugetlb.cwhich casts huge page types topte_t, even though on ARM they are implemented at the pmd level.On ARM (with VIPT caches)
update_mmu_cache()is empty like on x86, though a static inline rather than macro.
It's even worse - mm/huge_memory.c is passing a pmd_t, not a pointer so changing the type of update_mmu_cache's 3rd argument alone won't cut it.
This went unnoticed so far because all existing architectures supporting transparent huge pages implement update_mmu_cache() as do { } while (0).
MIPS uses update_mmu_cache() as the hook to deal with cache aliases and pre-faulting a TLB entry. But aliases don't affect small pages and having a separate variant of update_mmu_cache for huge pages will allow some other optimizations. That's minor but it's the argument types that really need to be fixed and because MIPS also implements huge pages at PMD level I'd be happy if we settle on pte_t * for mm/huge_memory.c.
Ralf
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
Hi Ralf,
Quoted 25 lines · Ralf Baechle
Quoted 8 lines · Catalin Marinas
Quoted 4 lines
Quoted 2 lines
5) void
update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep)Yes please.
Should we just use a generic (void *) for the last argument or force a cast in
mm/huge_memory.c?Quoted 8 lines
Ralf's point is that transparent huge page code calls
update_mmu_cachewith a (pmd_t*) as the last argument. This could make sense for THP as it assumes that huge pages can only be created at the pmd level. But that's unlikemm/hugetlb.cwhich casts huge page types topte_t, even though on ARM they are implemented at the pmd level.On ARM (with VIPT caches)
update_mmu_cache()is empty like on x86, though a static inline rather than macro.It's even worse -
mm/huge_memory.cis passing apmd_t, not a pointer so changing the type of update_mmu_cache's 3rd argument alone won't cut it.This went unnoticed so far because all existing architectures supporting transparent huge pages implement
update_mmu_cache()as do { } while (0).
Quoted 6 lines
MIPS uses
update_mmu_cache()as the hook to deal with cache aliases and pre-faulting a TLB entry. But aliases don't affect small pages and having a separate variant ofupdate_mmu_cachefor huge pages will allow some other optimizations. That's minor but it's the argument types that really need to be fixed and because MIPS also implements huge pages at PMD level I'd be happy if we settle onpte_t* formm/huge_memory.c.
Just to clarify: do you want a cast from pmd_t * to pte_t * or instead copy the hugetlb code and pass ptes around instead of pmds? The latter is pretty invasive...
Will
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 2/3] mm: thp: Fix the update_mmu_cache() last argument passing in mm/huge_memory.c
From: Will Deacon <[email protected]>
Date: Thu, 20 Sep 2012 13:44:01 +0100
Quoted 3 lines
Just to clarify: do you want a cast from
pmd_t* topte_t* or instead copy the hugetlb code and pass ptes around instead of pmds? The latter is pretty invasive...
But will be necessary for SPARC64 and POWERPC where the hugetlb entries are encoded at the PTE level.