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: <67C72AD3-120C-4825-B67B-AECD4245EC4E@nvidia.com>
Date:   Thu, 14 May 2020 10:28:53 -0400
From:   Zi Yan <ziy@...dia.com>
To:     Anshuman Khandual <anshuman.khandual@....com>
CC:     <linux-mm@...ck.org>, Andrew Morton <akpm@...ux-foundation.org>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] mm/vmstat: Add events for THP migration without split

On 12 May 2020, at 0:22, Anshuman Khandual wrote:

> Add the following new trace events which will help in validating migration
> events involving PMD based THP pages.
>
> 1. THP_PMD_MIGRATION_ENTRY_SET
> 2. THP_PMD_MIGRATION_ENTRY_REMOVE
>
> There are no clear method to confirm whether a THP migration happened with
> out involving it's split. These trace events along with PGMIGRATE_SUCCESS
> and PGMIGRATE_FAILURE will provide additional insights. After this change,
>
> A single 2M THP (2K base page) when migrated
>
> 1. Without split
>
> ................
> pgmigrate_success 1
> pgmigrate_fail 0
> ................
> thp_pmd_migration_entry_set 1
> thp_pmd_migration_entry_remove 1
> ................
>
> 2. With split
>
> ................
> pgmigrate_success 512
> pgmigrate_fail 0
> ................
> thp_pmd_migration_entry_set 0
> thp_pmd_migration_entry_remove 0
> ................
>
> pgmigrate_success as 1 instead of 512, provides a hint for possible THP
> migration event. But then it gets mixed with normal page migrations over
> time. These additional trace events provide required co-relation.

To track successful THP migrations, the code below should work, right?

diff --git a/mm/migrate.c b/mm/migrate.c
index b1092876e537..d394f5331288 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1220,6 +1220,8 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,
         * we want to retry.
         */
        if (rc == MIGRATEPAGE_SUCCESS) {
+               if (PageTransHuge(newpage))
+                       count_vm_event(THP_PMD_MIGRATION_SUCCESS);
                put_page(page);
                if (reason == MR_MEMORY_FAILURE) {
                        /*

Maybe you could give more details on why you want to add the THP migration event and
how you are going to use the event in your use case. That would be very helpful to this
code review. Are you going to do anything if you see THP migration failures?

Thanks.

—
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