Re: [RFC V2] mm/vmstat: Add events for HugeTLB migration

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

 



On Wed, Sep 30, 2020 at 11:30:49AM +0530, Anshuman Khandual wrote:
> -			is_thp = PageTransHuge(page) && !PageHuge(page);
> -			nr_subpages = thp_nr_pages(page);
> +			is_thp = false;
> +			is_hugetlb = false;
> +			if (PageTransHuge(page)) {
> +				if (PageHuge(page))
> +					is_hugetlb = true;
> +				else
> +					is_thp = true;
> +			}

Since PageHuge only returns true for hugetlb pages, I think the following is
more simple?

	if (PageHuge(page))
		is_hugetlb = true;
	else if (PageTransHuge(page))
		is_thp = true


Besides that, it looks good to me:

Reviewed-by: Oscar Salvador <osalvador@xxxxxxx>

-- 
Oscar Salvador
SUSE L3




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux