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]
Date: Mon, 15 Jan 2024 14:51:07 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: peterx@...hat.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	James Houghton <jthoughton@...gle.com>,
	David Hildenbrand <david@...hat.com>,
	"Kirill A . Shutemov" <kirill@...temov.name>,
	Yang Shi <shy828301@...il.com>, linux-riscv@...ts.infradead.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Aneesh Kumar K . V" <aneesh.kumar@...nel.org>,
	Rik van Riel <riel@...riel.com>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Axel Rasmussen <axelrasmussen@...gle.com>,
	Mike Rapoport <rppt@...nel.org>, John Hubbard <jhubbard@...dia.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Michael Ellerman <mpe@...erman.id.au>,
	Christophe Leroy <christophe.leroy@...roup.eu>,
	Andrew Jones <andrew.jones@...ux.dev>,
	linuxppc-dev@...ts.ozlabs.org,
	Mike Kravetz <mike.kravetz@...cle.com>,
	Muchun Song <muchun.song@...ux.dev>,
	linux-arm-kernel@...ts.infradead.org,
	Christoph Hellwig <hch@...radead.org>,
	Lorenzo Stoakes <lstoakes@...il.com>,
	Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH v2 11/13] mm/gup: Handle huge pmd for follow_pmd_mask()

On Wed, Jan 03, 2024 at 05:14:21PM +0800, peterx@...hat.com wrote:
> From: Peter Xu <peterx@...hat.com>
> 
> Replace pmd_trans_huge() with pmd_thp_or_huge() to also cover pmd_huge() as
> long as enabled.
> 
> FOLL_TOUCH and FOLL_SPLIT_PMD only apply to THP, not yet huge.
> 
> Since now follow_trans_huge_pmd() can process hugetlb pages, renaming it
> into follow_huge_pmd() to match what it does.  Move it into gup.c so not
> depend on CONFIG_THP.
> 
> When at it, move the ctx->page_mask setup into follow_huge_pmd(), only set
> it when the page is valid.  It was not a bug to set it before even if GUP
> failed (page==NULL), because follow_page_mask() callers always ignores
> page_mask if so.  But doing so makes the code cleaner.
> 
> Signed-off-by: Peter Xu <peterx@...hat.com>
> ---
>  mm/gup.c         | 107 ++++++++++++++++++++++++++++++++++++++++++++---
>  mm/huge_memory.c |  86 +------------------------------------
>  mm/internal.h    |   5 +--
>  3 files changed, 105 insertions(+), 93 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@...dia.com>

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ