Re: [External] Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-06 Thread Muchun Song
On Fri, Nov 6, 2020 at 5:46 PM Oscar Salvador wrote: > > On Fri, Nov 06, 2020 at 12:08:22AM +0800, Muchun Song wrote: > > > I do not think you need this. > > > We already have hugepages_supported(). > > > > Maybe some architectures support hugepage, but the vmemmap do not > > use the hugepage map.

Re: [External] Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-06 Thread Oscar Salvador
On Fri, Nov 06, 2020 at 12:08:22AM +0800, Muchun Song wrote: > > I do not think you need this. > > We already have hugepages_supported(). > > Maybe some architectures support hugepage, but the vmemmap do not > use the hugepage map. In this case, we need it. But I am not sure if it > exists in the

Re: [External] Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-05 Thread Muchun Song
On Thu, Nov 5, 2020 at 9:23 PM Oscar Salvador wrote: > > On Mon, Oct 26, 2020 at 10:51:00PM +0800, Muchun Song wrote: > > +#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP > > +#define VMEMMAP_HPAGE_SHIFT PMD_SHIFT > > +#define arch_vmemmap_support_huge_mapping() boot_cpu_has(X86_FEATURE_

Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-11-05 Thread Oscar Salvador
On Mon, Oct 26, 2020 at 10:51:00PM +0800, Muchun Song wrote: > +#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP > +#define VMEMMAP_HPAGE_SHIFT PMD_SHIFT > +#define arch_vmemmap_support_huge_mapping() boot_cpu_has(X86_FEATURE_PSE) I do not think you need this. We already have hugepages_su

Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-10-28 Thread Mike Kravetz
On 10/26/20 7:51 AM, Muchun Song wrote: > On some architectures, the vmemmap areas use huge page mapping. > If we want to free the unused vmemmap pages, we have to split > the huge pmd firstly. So we should pre-allocate pgtable to split > huge pmd. > > Signed-off-by: Muchun Song > --- > arch/x86

Re: [External] Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-10-28 Thread Mike Kravetz
On 10/28/20 12:26 AM, Muchun Song wrote: > On Wed, Oct 28, 2020 at 8:33 AM Mike Kravetz wrote: >> On 10/26/20 7:51 AM, Muchun Song wrote: >> >> I see the following routines follow the pattern for vmemmap manipulation >> in dax. > > Did you mean move those functions to mm/sparse-vmemmap.c? No. S

Re: [External] Re: [PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-10-28 Thread Muchun Song
On Wed, Oct 28, 2020 at 8:33 AM Mike Kravetz wrote: > > On 10/26/20 7:51 AM, Muchun Song wrote: > > On some architectures, the vmemmap areas use huge page mapping. > > If we want to free the unused vmemmap pages, we have to split > > the huge pmd firstly. So we should pre-allocate pgtable to split

[PATCH v2 05/19] mm/hugetlb: Introduce pgtable allocation/freeing helpers

2020-10-26 Thread Muchun Song
On some architectures, the vmemmap areas use huge page mapping. If we want to free the unused vmemmap pages, we have to split the huge pmd firstly. So we should pre-allocate pgtable to split huge pmd. Signed-off-by: Muchun Song --- arch/x86/include/asm/hugetlb.h | 5 ++ include/linux/hugetlb.h