Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2902385rwd; Wed, 14 Jun 2023 08:41:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JF7KtSYznsqMqczzl4CJtvsA7y7gm0DceJun6O/aKNyerDq39oBfhPq4+lKS5YayCvCXW X-Received: by 2002:a17:902:7243:b0:1b1:d0b2:b9b3 with SMTP id c3-20020a170902724300b001b1d0b2b9b3mr12525651pll.23.1686757271525; Wed, 14 Jun 2023 08:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686757271; cv=none; d=google.com; s=arc-20160816; b=ZnRVDM5iQEGxuO2n+KgEia9sEnWHXGjBcidqvG/DXMQXDeBpBmzJ0v2YIoFGnbkSlw AyNusMpqnHbTHoV8yYP3LXJsfBdxOB3YtGhtwH02ON3bpLGGHC4j95KvPP7850MfXYBJ e9c5xPFLlcY8s+qBuyT2o/2fzvgBSZrFGP/M5/IV8sOK8+TAL8c+3FcaNdVvfVAjupVV 8Acqk58lGeyRXwj1LF8LqnzXiyjfQbP/A3aE/pf8Ym0dr04CqrOnZaLMSCIO8tgezF4p t6sN77MK3szvcfrvipTKf0snXwXd4qDSL6g7fjJn5IeiCcUhFRg8Pt13+s9uzIoqkNm/ WJ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FVZChglvS+O5VeulYeKIgpHYT7pfIMFY3lkOqv9HePk=; b=RHbSnYUG7EVHiPZGFwATKk6x5xTYTui0D1QhSeB9Kl3ChElW03fsepaVUUvlb1NpUk V60UIUPQMx6W7A7NNumqZqGiMGsmLG9VmV15nieS29fj/y/hWfWfGDyuekBKhDcqQXLU os5WS3OTyoEbPsbJ4UtAwnN8a6F37ZbejfOBZ98Rfx+uF3FIR6D7s7SIzXLaJYFflw0l jT8eZ+DEzPsj5YqyfCEBzL2yPMnSj8sucRsf5kQC4QlNonuAID0/wrkypAQYIopDUDrP rvtRHJUOCTuBXLGSC+UFVRXQN7XDSb08uqN+C9pW5OjzLVDQo4XRsYyNZ36K/b4AQv1N pazQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d5XYwUNj; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bf5-20020a170902b90500b001b231cb6f51si8145192plb.150.2023.06.14.08.40.58; Wed, 14 Jun 2023 08:41:11 -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=d5XYwUNj; 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 S1343558AbjFNPMC (ORCPT + 99 others); Wed, 14 Jun 2023 11:12:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245752AbjFNPMA (ORCPT ); Wed, 14 Jun 2023 11:12:00 -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 B8AA11FC4 for ; Wed, 14 Jun 2023 08:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686755469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FVZChglvS+O5VeulYeKIgpHYT7pfIMFY3lkOqv9HePk=; b=d5XYwUNj7W0KXnlU8f1h/xuoLrM4pQ8Rz5Dpb1cLuNPgZicLb+yXypQxrMzmOePybeTm8s aAIiRRCZ8o/xtx6DAySS9y4+53CJxpYkNUjkGi4rs8Gcixd5lE7L00QsXJzr4w3iSklB93 Ebk5nUEtfYO/i6Lq+pVZgJUxLbqMQ4w= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-173-lC4WygcxOgyTtqk-_H4C4A-1; Wed, 14 Jun 2023 11:11:06 -0400 X-MC-Unique: lC4WygcxOgyTtqk-_H4C4A-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-75eb82ada06so154476885a.1 for ; Wed, 14 Jun 2023 08:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686755466; x=1689347466; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FVZChglvS+O5VeulYeKIgpHYT7pfIMFY3lkOqv9HePk=; b=TezRz1Bo9tqmdlCmCIetsJvD+5iHTD/YHCifOmpQpNL7e80P5EqYUOutX8k20pjuHy sB6wdG0/Rk03bjDy3ZPVAJEy6UqlQO+pQ5r1GaLhvMPAKQRYv0Nuxb2fQ2RsoD5nYbDs lsaUC/jGP/bAXD9dkPTeQCOPrFrwloSTtBQrfMlw0EmRMb+1giM4u9ALW5UqWTY7GVRV cMMHSZuUtCT/+ZMOqOnRNBI5+X2mMvHsbhxxHQVyEjZR9GaWettp0UEv8ffJqXDNSQuH feWxSRu4TkneNDQdTqJmnQsNlq9pvN916mzghbwCszuXd6CWFFPcx1C57RdYyBAx1VHQ k9zg== X-Gm-Message-State: AC+VfDycUOYnGJrTOI0ZkFlQSt2EcMCZxjCxgd54HC4qTO/079oDOlW0 8va9Lk06VJ88zu2shrD2LHeeYCl1/8WVCLv30W7oPyFjNbJX5GPASjQWzc4t5N/ijm7J7p2YoqK An4hbg+WdH/8H1zvUXYRDKUz6 X-Received: by 2002:a05:620a:84c5:b0:761:fc4c:b6f6 with SMTP id pq5-20020a05620a84c500b00761fc4cb6f6mr4259153qkn.7.1686755466442; Wed, 14 Jun 2023 08:11:06 -0700 (PDT) X-Received: by 2002:a05:620a:84c5:b0:761:fc4c:b6f6 with SMTP id pq5-20020a05620a84c500b00761fc4cb6f6mr4259129qkn.7.1686755466190; Wed, 14 Jun 2023 08:11:06 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id o23-20020a05620a15d700b0075cdad9648dsm4370929qkm.25.2023.06.14.08.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 08:11:05 -0700 (PDT) Date: Wed, 14 Jun 2023 11:11:03 -0400 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Matthew Wilcox , Andrea Arcangeli , John Hubbard , Mike Rapoport , Vlastimil Babka , "Kirill A . Shutemov" , Andrew Morton , Mike Kravetz , James Houghton , Hugh Dickins Subject: Re: [PATCH 4/7] mm/hugetlb: Prepare hugetlb_follow_page_mask() for FOLL_PIN Message-ID: References: <20230613215346.1022773-1-peterx@redhat.com> <20230613215346.1022773-5-peterx@redhat.com> <533c32cf-9a18-1590-4d29-f076d6bd58c1@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <533c32cf-9a18-1590-4d29-f076d6bd58c1@redhat.com> 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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, -- Peter Xu