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: <069d55ca-ca62-0841-b52f-c4352f37959a@oracle.com>
Date:   Tue, 31 May 2022 10:06:51 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Muchun Song <songmuchun@...edance.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Michal Hocko <mhocko@...e.com>, Peter Xu <peterx@...hat.com>,
        Naoya Horiguchi <naoya.horiguchi@...ux.dev>,
        James Houghton <jthoughton@...gle.com>,
        Mina Almasry <almasrymina@...gle.com>,
        "Aneesh Kumar K . V" <aneesh.kumar@...ux.vnet.ibm.com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 2/3] hugetlb: do not update address in
 huge_pmd_unshare

On 5/30/22 08:36, Muchun Song wrote:
> On Fri, May 27, 2022 at 03:58:48PM -0700, Mike Kravetz wrote:
>> As an optimization for loops sequentially processing hugetlb address
>> ranges, huge_pmd_unshare would update a passed address if it unshared a
>> pmd.  Updating a loop control variable outside the loop like this is
>> generally a bad idea.  These loops are now using hugetlb_mask_last_hp
> 
> Totally agree.
> 
>> to optimize scanning when non-present ptes are discovered.  The same
>> can be done when huge_pmd_unshare returns 1 indicating a pmd was
>> unshared.
>>
>> Remove address update from huge_pmd_unshare.  Change the passed argument
>> type and update all callers.  In loops sequentially processing addresses
>> use hugetlb_mask_last_hp to update address if pmd is unshared.
>>
>> Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
> 
> Acked-by: Muchun Song <songmuchun@...edance.com>
> 
> Some nits below.
> 
>>  		ptep = huge_pte_offset(mm, address, sz);
>>  		if (!ptep)
>>  			continue;
>>  		ptl = huge_pte_lock(h, mm, ptep);
>>  		/* We don't want 'address' to be changed */
> 
> Dead comment, should be removed.

Thanks!  I missed that.

-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ