Re: [PATCH v13 09/12] mm: hugetlb: add a kernel parameter hugetlb_free_vmemmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 25, 2021 at 12:43:23PM +0100, David Hildenbrand wrote:
> > -	if (end - start < PAGES_PER_SECTION * sizeof(struct page))
> > +	if (is_hugetlb_free_vmemmap_enabled() ||
> > +	    end - start < PAGES_PER_SECTION * sizeof(struct page))
> 
> This looks irresponsible. You ignore any altmap, even though current
> altmap users (ZONE_DEVICE) will not actually result in applicable
> vmemmaps that huge pages could ever use.
> 
> Why do you ignore the altmap completely? This has to be properly
> documented, but IMHO it's not even the right approach to mess with
> altmap here.

The goal was not to ignore altmap but to disable PMD mapping sections
when the feature was enabled.
Shame on me I did not notice that with this, altmap will be ignored.

Something like below maybe:

int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
                struct vmem_altmap *altmap)
{
        int err;
        bool populate_base_pages = false;

        if ((end - start < PAGES_PER_SECTION * sizeof(struct page)) ||
            (is_hugetlb_free_vmemmap_enabled() && !altmap))
                populate_base_pages = true;

        if (populate_base_pages) {
                err = vmemmap_populate_basepages(start, end, node, NULL);
        } else if (boot_cpu_has(X86_FEATURE_PSE)) {
	....


> 
> -- 
> Thanks,
> 
> David / dhildenb
> 
> 

-- 
Oscar Salvador
SUSE L3



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux