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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <70175233-F250-4072-AEF4-659DF73F9F7C@nvidia.com>
Date:   Thu, 17 Sep 2020 16:55:14 -0400
From:   Zi Yan <ziy@...dia.com>
To:     Daniel Jordan <daniel.m.jordan@...cle.com>
CC:     Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>,
        Anshuman Khandual <anshuman.khandual@....com>
Subject: Re: [PATCH] mm/migrate: correct thp migration stats.

On 17 Sep 2020, at 16:59, Daniel Jordan wrote:

> On Thu, Sep 17, 2020 at 04:27:29PM -0400, Zi Yan wrote:
>> From: Zi Yan <ziy@...dia.com>
>>
>> PageTransHuge returns true for both thp and hugetlb, so thp stats was
>> counting both thp and hugetlb migrations. Exclude hugetlb migration by
>> setting is_thp variable right.
>
> Yeah, shoot.
>
>> Fixes: 1a5bae25e3cf ("mm/vmstat: add events for THP migration without split")
>> Signed-off-by: Zi Yan <ziy@...dia.com>
>
> Reviewed-by: Daniel Jordan <daniel.m.jordan@...cle.com>

Thanks.

>
> If you wanted, you could also do this.
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index d1ad964165e5..6bc9559afc70 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -1471,7 +1471,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
>  				 * we encounter them after the rest of the list
>  				 * is processed.
>  				 */
> -				if (PageTransHuge(page) && !PageHuge(page)) {
> +				if (is_thp) {
>  					lock_page(page);
>  					rc = split_huge_page_to_list(page, from);
>  					unlock_page(page);
> @@ -1480,8 +1480,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page,
>  						nr_thp_split++;
>  						goto retry;
>  					}
> -				}
> -				if (is_thp) {
> +
>  					nr_thp_failed++;
>  					nr_failed += nr_subpages;
>  					goto out;

Yeah, makes sense to me. Let me send V2 to include this.

—
Best Regards,
Yan Zi

Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ