Message ID | 20230613215346.1022773-5-peterx@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp852428vqr; Tue, 13 Jun 2023 15:09:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7t1Y5crOc6GbxYu8ShV7azIf7K4wUNehw/3cOMcH/f24knV75o6T4X/ZzaWVagxslam6Q7 X-Received: by 2002:a05:6808:2195:b0:398:11e1:ae6a with SMTP id be21-20020a056808219500b0039811e1ae6amr11745294oib.22.1686694147048; Tue, 13 Jun 2023 15:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686694147; cv=none; d=google.com; s=arc-20160816; b=hpAfdrEDuSB76oJUuefX78/cAZ0/GVYkFJR03aNsNjvmYyGPEgpY5vsh4SwYjpJA5c 3GMVIysvvOd8j5Fn9RZv6p24B0BFZ53+ukjgVCeCr4MUN/IBWCIEd4CmoHeFxRTKApst cwFuZxAJRUTDZiUZbUks0T7+V43YOGFjThCf+dQWqAhI5uIjp/HPQbJAAx9OooM1bg+m 0+9epixTCx8dZwV/7shBKXj74umYkBG2L9jOHp0wngAnD6dYVHfzLoMwC7K5IksY3TMw MU2PiNeZtfKk0IAwUSQty6Mw/n+kwwqVC2mib4Xl5Rvd1p+p+nCGLLunw/TvHfx2wXNa YL+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nVhPI7Qoz7ZqnzsG9+Pwmnk6AKrA3Y9yvdpVEt0mHXM=; b=IFxdCEXryNuLWGEsgS+C2KkxlV9iX0y0YiycuTkB/Oj1RTlHcAAqKuFwpXXe6LRYgU 4nKxZkkV+IolpoRtot36gECFYw3U2rzIG10gpermJkYZ0L946Nsnvhm11N4A97Ff2q6R 2+ZKwPdqWu+HK273AsNEsjpi6T6PLILZtJbIrU8ZuV0IIuVZmAZs4zXqOT9ZW6zsTOn4 193aIFHK7OJjMQViA4yaFopmRAgblagZI18IVuyXUKVC5je6LJSghUuAnkQUBuyeH1uY JIo6m1EsO9FzfZ4t7QOWVHx4/Jy7P4Boqegn35FXq01ErxDHw8/2KYWQftGcacvzyDj0 9CZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="D5w6/rEX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l64-20020a639143000000b005307ce6fd07si6669632pge.850.2023.06.13.15.08.52; Tue, 13 Jun 2023 15:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="D5w6/rEX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240471AbjFMVzD (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Tue, 13 Jun 2023 17:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjFMVy7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 13 Jun 2023 17:54:59 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9A81BDA for <linux-kernel@vger.kernel.org>; Tue, 13 Jun 2023 14:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686693251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nVhPI7Qoz7ZqnzsG9+Pwmnk6AKrA3Y9yvdpVEt0mHXM=; b=D5w6/rEXPnNuZccOm0IGyU7DxTPzzNTB1q6pvGDJ8fcJtyGF601vQuZ4DPfrFDTibFN96T kCjSq5AZbf6Mii5yW7x5672VwCVR+orT2u0cND+AWKWJhb2WL2yTvHlN4/8jJnkY3mn3xS pWB6izUF++9ZqIigsmgQOVI95Nk9Cd0= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-um5Iev9jM6-lj1Mt6ltFQQ-1; Tue, 13 Jun 2023 17:54:01 -0400 X-MC-Unique: um5Iev9jM6-lj1Mt6ltFQQ-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-3fb2e6ca6eeso2354341cf.1 for <linux-kernel@vger.kernel.org>; Tue, 13 Jun 2023 14:54:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686693240; x=1689285240; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nVhPI7Qoz7ZqnzsG9+Pwmnk6AKrA3Y9yvdpVEt0mHXM=; b=C/IkRDqnSdoerU5bi0Fhw1AbXTZ5ueAMOiUk8D8ZNv3dhVhtuWR5g1AjAQjbmMDj5i jg/gR+lPQIE1+vGCGF1dQUaVy2CmAtou+OqS6w9ofZrOeuqMJJwaXEsETcfm2+AYYDrG Hn424eNPQp2rPL2FB/qihlC1/BFz6AONlzCf6F5F/HlPb9errCraPKgGObOGDQnl9xQb W1nUlD/E7dC2Yr+UDkBXLoCZ2IrDiTZFVRtScWfec66OSY6NiDVP/gfJjNt8r2r/JZIC 6LRBkw4YhsNBGtps0IOY3c7SDZNsUG6drsgtNIpInPxn0x/wW1a83dgqA/3ZxNn+MJ0P YnpA== X-Gm-Message-State: AC+VfDxc/5l/M4xt8wpe+gFi3t3jcsGYCbhjznNSNxzX4SdKL3pTt85+ EK2NqOONaMCkwMnA79tLA8pFBHGc0KXkSbALTkkpEIILXe2TvaK6Jl73YhLM5d9eE2GFcLgbZvH 6nUQmZ2r1RTmEjBQEs5DMMfeU6009FBPgMMsbFFno2I1flv9+O7ofaBBcaaswv6jWovDYqQYqK4 NVFeaGbA== X-Received: by 2002:a05:622a:288:b0:3ef:3dc3:4a3e with SMTP id z8-20020a05622a028800b003ef3dc34a3emr17942049qtw.0.1686693239911; Tue, 13 Jun 2023 14:53:59 -0700 (PDT) X-Received: by 2002:a05:622a:288:b0:3ef:3dc3:4a3e with SMTP id z8-20020a05622a028800b003ef3dc34a3emr17942021qtw.0.1686693239513; Tue, 13 Jun 2023 14:53:59 -0700 (PDT) Received: from x1n.redhat.com (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id fz24-20020a05622a5a9800b003f9bccc3182sm4522330qtb.32.2023.06.13.14.53.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jun 2023 14:53:58 -0700 (PDT) From: Peter Xu <peterx@redhat.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox <willy@infradead.org>, Andrea Arcangeli <aarcange@redhat.com>, John Hubbard <jhubbard@nvidia.com>, Mike Rapoport <rppt@kernel.org>, David Hildenbrand <david@redhat.com>, Vlastimil Babka <vbabka@suse.cz>, peterx@redhat.com, "Kirill A . Shutemov" <kirill@shutemov.name>, Andrew Morton <akpm@linux-foundation.org>, Mike Kravetz <mike.kravetz@oracle.com>, James Houghton <jthoughton@google.com>, Hugh Dickins <hughd@google.com> Subject: [PATCH 4/7] mm/hugetlb: Prepare hugetlb_follow_page_mask() for FOLL_PIN Date: Tue, 13 Jun 2023 17:53:43 -0400 Message-Id: <20230613215346.1022773-5-peterx@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230613215346.1022773-1-peterx@redhat.com> References: <20230613215346.1022773-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768627001919554681?= X-GMAIL-MSGID: =?utf-8?q?1768627001919554681?= |
Series |
mm/gup: Unify hugetlb, speed up thp
|
|
Commit Message
Peter Xu
June 13, 2023, 9:53 p.m. UTC
It's coming, not yet, but soon. Loose the restriction.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
mm/hugetlb.c | 7 -------
1 file changed, 7 deletions(-)
Comments
On 13.06.23 23:53, Peter Xu wrote: > It's coming, not yet, but soon. Loose the restriction. > > Signed-off-by: Peter Xu <peterx@redhat.com> > --- > mm/hugetlb.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index f037eaf9d819..31d8f18bc2e4 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, > spinlock_t *ptl; > pte_t *pte, entry; > > - /* > - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via > - * follow_hugetlb_page(). > - */ > - if (WARN_ON_ONCE(flags & FOLL_PIN)) > - return NULL; > - > hugetlb_vma_lock_read(vma); > pte = hugetlb_walk(vma, haddr, huge_page_size(h)); > if (!pte) Did you fix why the warning was placed there in the first place? (IIRC, at least unsharing support needs to be added, maybe more)
On Wed, Jun 14, 2023 at 04:57:37PM +0200, David Hildenbrand wrote: > On 13.06.23 23:53, Peter Xu wrote: > > It's coming, not yet, but soon. Loose the restriction. > > > > Signed-off-by: Peter Xu <peterx@redhat.com> > > --- > > mm/hugetlb.c | 7 ------- > > 1 file changed, 7 deletions(-) > > > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > > index f037eaf9d819..31d8f18bc2e4 100644 > > --- a/mm/hugetlb.c > > +++ b/mm/hugetlb.c > > @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, > > spinlock_t *ptl; > > pte_t *pte, entry; > > - /* > > - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via > > - * follow_hugetlb_page(). > > - */ > > - if (WARN_ON_ONCE(flags & FOLL_PIN)) > > - return NULL; > > - > > hugetlb_vma_lock_read(vma); > > pte = hugetlb_walk(vma, haddr, huge_page_size(h)); > > if (!pte) > Did you fix why the warning was placed there in the first place? (IIRC, at > least unsharing support needs to be added, maybe more) Feel free to have a look at patch 2 - it should be done there, hopefully in the right way. And IIUC it could be a bug to not do that before (besides CoR there was also the pgtable permission checks that was missing). More details in patch 2's commit message. Thanks,
On 14.06.23 17:11, Peter Xu wrote: > On Wed, Jun 14, 2023 at 04:57:37PM +0200, David Hildenbrand wrote: >> On 13.06.23 23:53, Peter Xu wrote: >>> It's coming, not yet, but soon. Loose the restriction. >>> >>> Signed-off-by: Peter Xu <peterx@redhat.com> >>> --- >>> mm/hugetlb.c | 7 ------- >>> 1 file changed, 7 deletions(-) >>> >>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >>> index f037eaf9d819..31d8f18bc2e4 100644 >>> --- a/mm/hugetlb.c >>> +++ b/mm/hugetlb.c >>> @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, >>> spinlock_t *ptl; >>> pte_t *pte, entry; >>> - /* >>> - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via >>> - * follow_hugetlb_page(). >>> - */ >>> - if (WARN_ON_ONCE(flags & FOLL_PIN)) >>> - return NULL; >>> - >>> hugetlb_vma_lock_read(vma); >>> pte = hugetlb_walk(vma, haddr, huge_page_size(h)); >>> if (!pte) >> Did you fix why the warning was placed there in the first place? (IIRC, at >> least unsharing support needs to be added, maybe more) > > Feel free to have a look at patch 2 - it should be done there, hopefully in > the right way. And IIUC it could be a bug to not do that before (besides > CoR there was also the pgtable permission checks that was missing). More > details in patch 2's commit message. Thanks, Oh, that slipped my eyes (unsharing is not really a permission check) -- and the patch description could have been more explicit about why we can now lift the restrictions. For the records: we don't use CoR terminology upstream. As suggested by John, we use "GUP-triggered unsharing". As unsharing only applies to FOLL_PIN, it doesn't quite fit into patch #2. Either move that to this patch or squash both.
On Wed, Jun 14, 2023 at 05:17:13PM +0200, David Hildenbrand wrote: > On 14.06.23 17:11, Peter Xu wrote: > > On Wed, Jun 14, 2023 at 04:57:37PM +0200, David Hildenbrand wrote: > > > On 13.06.23 23:53, Peter Xu wrote: > > > > It's coming, not yet, but soon. Loose the restriction. > > > > > > > > Signed-off-by: Peter Xu <peterx@redhat.com> > > > > --- > > > > mm/hugetlb.c | 7 ------- > > > > 1 file changed, 7 deletions(-) > > > > > > > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > > > > index f037eaf9d819..31d8f18bc2e4 100644 > > > > --- a/mm/hugetlb.c > > > > +++ b/mm/hugetlb.c > > > > @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, > > > > spinlock_t *ptl; > > > > pte_t *pte, entry; > > > > - /* > > > > - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via > > > > - * follow_hugetlb_page(). > > > > - */ > > > > - if (WARN_ON_ONCE(flags & FOLL_PIN)) > > > > - return NULL; > > > > - > > > > hugetlb_vma_lock_read(vma); > > > > pte = hugetlb_walk(vma, haddr, huge_page_size(h)); > > > > if (!pte) > > > Did you fix why the warning was placed there in the first place? (IIRC, at > > > least unsharing support needs to be added, maybe more) > > > > Feel free to have a look at patch 2 - it should be done there, hopefully in > > the right way. And IIUC it could be a bug to not do that before (besides > > CoR there was also the pgtable permission checks that was missing). More > > details in patch 2's commit message. Thanks, > > Oh, that slipped my eyes (unsharing is not really a permission check) -- and I think it is still a "permission check"? It means, we forbid anyone R/O taking the page if it's not exclusively owned, just like we forbid anyone RW taking the page if it's not writable? It's just that the permission check only applies to PIN which follow_page() doesn't yet care, so it won't ever trigger. > the patch description could have been more explicit about why we can now > lift the restrictions. > > For the records: we don't use CoR terminology upstream. As suggested by > John, we use "GUP-triggered unsharing". Sure. > > As unsharing only applies to FOLL_PIN, it doesn't quite fit into patch #2. > Either move that to this patch or squash both. Sure, no strong opinions here. The plan is _if_ someone wants to backport patch 2, this patch should not be part of it. But then maybe it makes more sense to move the CoR change there into this one, not because "it's not permission check", but because CoR is not relevant in follow_page(), so not relevant to a backport.
On 14.06.23 17:31, Peter Xu wrote: > On Wed, Jun 14, 2023 at 05:17:13PM +0200, David Hildenbrand wrote: >> On 14.06.23 17:11, Peter Xu wrote: >>> On Wed, Jun 14, 2023 at 04:57:37PM +0200, David Hildenbrand wrote: >>>> On 13.06.23 23:53, Peter Xu wrote: >>>>> It's coming, not yet, but soon. Loose the restriction. >>>>> >>>>> Signed-off-by: Peter Xu <peterx@redhat.com> >>>>> --- >>>>> mm/hugetlb.c | 7 ------- >>>>> 1 file changed, 7 deletions(-) >>>>> >>>>> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >>>>> index f037eaf9d819..31d8f18bc2e4 100644 >>>>> --- a/mm/hugetlb.c >>>>> +++ b/mm/hugetlb.c >>>>> @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, >>>>> spinlock_t *ptl; >>>>> pte_t *pte, entry; >>>>> - /* >>>>> - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via >>>>> - * follow_hugetlb_page(). >>>>> - */ >>>>> - if (WARN_ON_ONCE(flags & FOLL_PIN)) >>>>> - return NULL; >>>>> - >>>>> hugetlb_vma_lock_read(vma); >>>>> pte = hugetlb_walk(vma, haddr, huge_page_size(h)); >>>>> if (!pte) >>>> Did you fix why the warning was placed there in the first place? (IIRC, at >>>> least unsharing support needs to be added, maybe more) >>> >>> Feel free to have a look at patch 2 - it should be done there, hopefully in >>> the right way. And IIUC it could be a bug to not do that before (besides >>> CoR there was also the pgtable permission checks that was missing). More >>> details in patch 2's commit message. Thanks, >> >> Oh, that slipped my eyes (unsharing is not really a permission check) -- and > > I think it is still a "permission check"? It means, we forbid anyone R/O > taking the page if it's not exclusively owned, just like we forbid anyone > RW taking the page if it's not writable? Agreed, just not in the traditional PTE-protection case. > > It's just that the permission check only applies to PIN which follow_page() > doesn't yet care, so it won't ever trigger. > >> the patch description could have been more explicit about why we can now >> lift the restrictions. >> >> For the records: we don't use CoR terminology upstream. As suggested by >> John, we use "GUP-triggered unsharing". > > Sure. > >> >> As unsharing only applies to FOLL_PIN, it doesn't quite fit into patch #2. >> Either move that to this patch or squash both. > > Sure, no strong opinions here. > > The plan is _if_ someone wants to backport patch 2, this patch should not > be part of it. But then maybe it makes more sense to move the CoR change > there into this one, not because "it's not permission check", but because > CoR is not relevant in follow_page(), so not relevant to a backport. Right. Then just call patch #2 "Add missing write-permission check" and this patch "Support FOLL_PIN in hugetlb_follow_page_mask()" or sth. like that. Regarding the backport, I really wonder if patch #2 is required at all, because I didn't sport any applicable FOLL_WRITE users. Maybe there were some? Hm. If it's not applicable, a single "Support FOLL_PIN in hugetlb_follow_page_mask()" patch might be cleanest.
On Wed, Jun 14, 2023 at 05:47:31PM +0200, David Hildenbrand wrote: > Right. Then just call patch #2 "Add missing write-permission check" and this > patch "Support FOLL_PIN in hugetlb_follow_page_mask()" or sth. like that. > > Regarding the backport, I really wonder if patch #2 is required at all, > because I didn't sport any applicable FOLL_WRITE users. Maybe there were > some? Hm. If it's not applicable, a single "Support FOLL_PIN in > hugetlb_follow_page_mask()" patch might be cleanest. Yeah, I agree. The code is definitely needed, not the split of patches if no need for a backport. Let me merge then.
On 06/14/23 11:51, Peter Xu wrote: > On Wed, Jun 14, 2023 at 05:47:31PM +0200, David Hildenbrand wrote: > > Right. Then just call patch #2 "Add missing write-permission check" and this > > patch "Support FOLL_PIN in hugetlb_follow_page_mask()" or sth. like that. > > > > Regarding the backport, I really wonder if patch #2 is required at all, > > because I didn't sport any applicable FOLL_WRITE users. Maybe there were > > some? Hm. If it's not applicable, a single "Support FOLL_PIN in > > hugetlb_follow_page_mask()" patch might be cleanest. > > Yeah, I agree. The code is definitely needed, not the split of patches if > no need for a backport. Let me merge then. > Should have read this before adding my RB to patch 2. I assumed no backport. Agree, than merging the gup_must_unshare here makes more sense.
On Wed, Jun 14, 2023 at 05:25:25PM -0700, Mike Kravetz wrote: > On 06/14/23 11:51, Peter Xu wrote: > > On Wed, Jun 14, 2023 at 05:47:31PM +0200, David Hildenbrand wrote: > > > Right. Then just call patch #2 "Add missing write-permission check" and this > > > patch "Support FOLL_PIN in hugetlb_follow_page_mask()" or sth. like that. > > > > > > Regarding the backport, I really wonder if patch #2 is required at all, > > > because I didn't sport any applicable FOLL_WRITE users. Maybe there were > > > some? Hm. If it's not applicable, a single "Support FOLL_PIN in > > > hugetlb_follow_page_mask()" patch might be cleanest. > > > > Yeah, I agree. The code is definitely needed, not the split of patches if > > no need for a backport. Let me merge then. > > > > Should have read this before adding my RB to patch 2. I assumed no > backport. Agree, than merging the gup_must_unshare here makes more sense. Thanks for taking a look! No worries, I'll make bold to just take your R-b over the merged patch when I repost, according to your R-b in patch 2 and the comment here. I hope it's fine to you.
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f037eaf9d819..31d8f18bc2e4 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6467,13 +6467,6 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, spinlock_t *ptl; pte_t *pte, entry; - /* - * FOLL_PIN is not supported for follow_page(). Ordinary GUP goes via - * follow_hugetlb_page(). - */ - if (WARN_ON_ONCE(flags & FOLL_PIN)) - return NULL; - hugetlb_vma_lock_read(vma); pte = hugetlb_walk(vma, haddr, huge_page_size(h)); if (!pte)