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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230907185710.GE3640@monkey>
Date:   Thu, 7 Sep 2023 11:57:10 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Muchun Song <muchun.song@...ux.dev>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Muchun Song <songmuchun@...edance.com>,
        Joao Martins <joao.m.martins@...cle.com>,
        Oscar Salvador <osalvador@...e.de>,
        David Hildenbrand <david@...hat.com>,
        Miaohe Lin <linmiaohe@...wei.com>,
        David Rientjes <rientjes@...gle.com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Naoya Horiguchi <naoya.horiguchi@...ux.dev>,
        Barry Song <song.bao.hua@...ilicon.com>,
        Michal Hocko <mhocko@...e.com>,
        Matthew Wilcox <willy@...radead.org>,
        Xiongchun Duan <duanxiongchun@...edance.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v2 10/11] hugetlb: batch TLB flushes when freeing vmemmap

On 09/07/23 14:55, Muchun Song wrote:
> 
> 
> On 2023/9/6 05:44, Mike Kravetz wrote:
> > From: Joao Martins <joao.m.martins@...cle.com>
> > 
> > Now that a list of pages is deduplicated at once, the TLB
> > flush can be batched for all vmemmap pages that got remapped.
> > 
> > Add a flags field and pass whether it's a bulk allocation or
> > just a single page to decide to remap.
> > 
> > The TLB flush is global as we don't have guarantees from caller
> > that the set of folios is contiguous, or to add complexity in
> > composing a list of kVAs to flush.
> > 
> > Modified by Mike Kravetz to perform TLB flush on single folio if an
> > error is encountered.
> > 
> > Signed-off-by: Joao Martins <joao.m.martins@...cle.com>
> > Signed-off-by: Mike Kravetz <mike.kravetz@...cle.com>
> > ---
> >   mm/hugetlb_vmemmap.c | 38 ++++++++++++++++++++++++++++++--------
> >   1 file changed, 30 insertions(+), 8 deletions(-)
> > 
> > diff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c

> > @@ -638,7 +658,7 @@ void hugetlb_vmemmap_optimize(const struct hstate *h, struct page *head)
> >   {
> >   	LIST_HEAD(vmemmap_pages);
> > -	__hugetlb_vmemmap_optimize(h, head, &vmemmap_pages);
> > +	__hugetlb_vmemmap_optimize(h, head, &vmemmap_pages, 0UL);
> 
> UL suffix could be dropped. Right?

Yes, it can be dropped.

> 
> >   	free_vmemmap_page_list(&vmemmap_pages);
> >   }

-- 
Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ