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: <28bc0263-c297-4392-b70a-df8214ca1a67@arm.com>
Date:   Mon, 27 Nov 2023 14:54:25 +0000
From:   Ryan Roberts <ryan.roberts@....com>
To:     David Hildenbrand <david@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Matthew Wilcox <willy@...radead.org>,
        Yin Fengwei <fengwei.yin@...el.com>,
        Yu Zhao <yuzhao@...gle.com>,
        Catalin Marinas <catalin.marinas@....com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Yang Shi <shy828301@...il.com>,
        "Huang, Ying" <ying.huang@...el.com>, Zi Yan <ziy@...dia.com>,
        Luis Chamberlain <mcgrof@...nel.org>,
        Itaru Kitayama <itaru.kitayama@...il.com>,
        "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
        John Hubbard <jhubbard@...dia.com>,
        David Rientjes <rientjes@...gle.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Hugh Dickins <hughd@...gle.com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     linux-mm@...ck.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH v7 10/10] selftests/mm/cow: Add tests for anonymous
 small-sized THP

On 27/11/2023 14:50, David Hildenbrand wrote:
> On 27.11.23 15:02, Ryan Roberts wrote:
>> On 22/11/2023 16:29, Ryan Roberts wrote:
>>> Add tests similar to the existing PMD-sized THP tests, but which operate
>>> on memory backed by (PTE-mapped) small-sized THP. This reuses all the
>>> existing infrastructure. If the test suite detects that small-sized THP
>>> is not supported by the kernel, the new tests are skipped.
>>>
>>> Signed-off-by: Ryan Roberts <ryan.roberts@....com>
>>> ---
>>>   tools/testing/selftests/mm/cow.c | 71 +++++++++++++++++++++++++++++++-
>>>   1 file changed, 70 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
>>> index d03c453cfd5c..3efc395c7077 100644
>>> --- a/tools/testing/selftests/mm/cow.c
>>> +++ b/tools/testing/selftests/mm/cow.c
>>> @@ -29,15 +29,49 @@
>>>   #include "../../../../mm/gup_test.h"
>>>   #include "../kselftest.h"
>>>   #include "vm_util.h"
>>> +#include "thp_settings.h"
>>>
>>>   static size_t pagesize;
>>>   static int pagemap_fd;
>>>   static size_t pmdsize;
>>> +static int nr_thpsmallsizes;
>>> +static size_t thpsmallsizes[20];
>>
>> Off the back of some comments David made againt the previous patch [1], I'm
>> proposing to rework this a bit so that ALL thp sizes are stored in this array,
>> not just the non-PMD-sized sizes. This makes the changes overall a bit smaller
>> and easier to understand, I think...
>>
>>>   static int nr_hugetlbsizes;
>>>   static size_t hugetlbsizes[10];
>>>   static int gup_fd;
>>>   static bool has_huge_zeropage;
>>>
>>> +static int sz2ord(size_t size)
>>> +{
>>> +    return __builtin_ctzll(size / pagesize);
>>> +}
>>> +
>>> +static int detect_smallthp_sizes(size_t sizes[], int max)
>>
>> This changes to detect_thp_sizes() and deposits all sizes in sizes[]
> 
> Just what I wanted to propose :) Makes it simpler by removing the "small"
> terminology and just detecting thp sizes.

Great! All done and queued up for the next version. Just waiting for some
feedback on the 2 crucial patches in this series (3 & 4) :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ