lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200930074639.GA26786@linux>
Date:   Wed, 30 Sep 2020 09:46:46 +0200
From:   Oscar Salvador <osalvador@...e.de>
To:     Anshuman Khandual <anshuman.khandual@....com>
Cc:     linux-mm@...ck.org, Daniel Jordan <daniel.m.jordan@...cle.com>,
        Zi Yan <ziy@...dia.com>, John Hubbard <jhubbard@...dia.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC V2] mm/vmstat: Add events for HugeTLB migration

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@...e.de>

-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ