From patchwork Thu Nov 16 01:29:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 165643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2924228vqg; Wed, 15 Nov 2023 17:29:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBf/NkXxMPlzQXI1WFP04SAP0tE08tbYyc2otgPiZiWHL7xNx3tuE+wvicdsIo9wuAenzd X-Received: by 2002:a05:6830:5:b0:6c0:ae30:671e with SMTP id c5-20020a056830000500b006c0ae30671emr8276065otp.20.1700098185676; Wed, 15 Nov 2023 17:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700098185; cv=none; d=google.com; s=arc-20160816; b=kz7UDpZrPOuF5nTS04XSFqHZlH3TQnhXYpXltIGLZsnJ5gC11YhUglDG1zQdbi9B8C GT8KS7OY5WKO2zkCE4u546/cjgsBWkJeRK9bh7crcgYCuGzTdYF8LT9KnWiwpc0uktOf H+oybIWTy8dhPYF2pbFvbYvETVe1w+bSr3CDwHr0a8JR4I9+6PxZ288rVPaqO1pSExJx 45OGd3TCRELtir4Ak6CfZMxXxJdx2O/tczzWCjmuE/RkHsn6DQKdANJUvraCuGEjOAvm FQvCyh8GNFrCpDk7Ia3gqVzsNxsshz4xw3BchMHKqqTwdEn2vAoWOSUgVuPJEBn+odRG PlUg== 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=bUKDadnp+1aD4MuuhezpyppaSOr8lCSuMGXbTAXddpQ=; fh=nvfIpCvT5SnQ83HxwVfj1I4jmL6Kgaw3F1yj79JBUNM=; b=mJbbrZIyvPttWUk80fpaGyu7vqSHH0+Vl/vUtIIG4e1zrEHPF0RF+bQtKMm49TVCuE Q9Y9lCIDJYWGcz6FYtBp7kzxZg9zyT36f7qbs2W7K9VK+ErPUteiLFVPvfcNN/IXAMNp Yg/DiAmoazKwaQ2iGD7Rv0PdDADeLQL0tVWl8ckP2D0ia04oCFhiOk0OPqyCTd3XslsZ hMVXeVN6lS6dliVH6bTbj9RB+/S+Et/8HHmDKDfMEz7uoBDrNA+pIr0/aqq7XIHlyH8+ AozuU/JvDHepnEN47UTRbyO2mcoy/GrkrN13/PpsbKsKGCWJLhiF40OismRGvupd/AS0 t0VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EQ9DHPYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ck6-20020a056a02090600b005b8f24e6526si11870235pgb.234.2023.11.15.17.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:29:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EQ9DHPYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EFF1C81121EB; Wed, 15 Nov 2023 17:29:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344450AbjKPB3h (ORCPT + 28 others); Wed, 15 Nov 2023 20:29:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344498AbjKPB3e (ORCPT ); Wed, 15 Nov 2023 20:29:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC8DB199 for ; Wed, 15 Nov 2023 17:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700098163; 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=bUKDadnp+1aD4MuuhezpyppaSOr8lCSuMGXbTAXddpQ=; b=EQ9DHPYog5gjUZU2fkQMByjxMp4TytU1nvXgGzlu7Qx8kOBVGotuAfA4DZZg/X+HQpsfay R7uUAF/At2X+V0FiQeYu7Mk8XrSuxtK2iM41rRw8rcffqaBypE9rtFb+qEbE3/VdIt1me5 zy1k4uWq4Fx9WeH551GIij5CmWwD/Oc= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-184-4Qd8MIcmOk-Nvc_gpjxIoQ-1; Wed, 15 Nov 2023 20:29:21 -0500 X-MC-Unique: 4Qd8MIcmOk-Nvc_gpjxIoQ-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-41cbafdb4b6so931571cf.0 for ; Wed, 15 Nov 2023 17:29:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700098161; x=1700702961; 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=bUKDadnp+1aD4MuuhezpyppaSOr8lCSuMGXbTAXddpQ=; b=k9eEFSbhhlgrcGtAikDFRan7CnSbGRU1FQkSi3E5dvBWBXKdmrfxSwbuIbJRqSJmOH 5VYE1YAu8LdMxpnZqB06FAWOpSTBEkS/BaL0zenC6ETYUeIYPijpodxApMBIzHRnw6+G qhD83jcuSiXTP0xiRhqY25OQXDFza/MQTQxONxh3DCppN3e8ERaHB/AVuKMu0hl8shmg 1Bqd2LyStajvfU78XJ3sMY/EEVhcfBgkQm9K7TmiACl/SeBr59TihLxwSwXT6nYpp7hM vgOwJOyn9/YnFhIpgq2/zYTHgpiVRF9BUHRAf1vFHiB3Ba9wsUDwvgv1zf5b3RUHVmkk HNEA== X-Gm-Message-State: AOJu0Yzh6vWbY0n/PDkqTVsRE04oxzCGL9W1hpHiO4npGoz7kPy92W8U gBgqUZ6BTQOaTMpgeB/8JR8cOlo0sg/5mdMO4bGrx1jCVSKen/8g3iLDWMyLgoeEW+lqyXQwncj bWzZNx43CXF8Ny7ajiBBifzp09uapLQEqqFK/twIyTjaZcNOzdBWRlS0XEowj9dRcVgL/gz0qbl NpiWFygw== X-Received: by 2002:a05:622a:810e:b0:41c:d433:6c86 with SMTP id jx14-20020a05622a810e00b0041cd4336c86mr6482576qtb.4.1700098161061; Wed, 15 Nov 2023 17:29:21 -0800 (PST) X-Received: by 2002:a05:622a:810e:b0:41c:d433:6c86 with SMTP id jx14-20020a05622a810e00b0041cd4336c86mr6482544qtb.4.1700098160768; Wed, 15 Nov 2023 17:29:20 -0800 (PST) Received: from x1n.redhat.com (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id c24-20020ac85198000000b0041e383d527esm3922598qtn.66.2023.11.15.17.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 17:29:20 -0800 (PST) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Mike Kravetz , "Kirill A . Shutemov" , Lorenzo Stoakes , Axel Rasmussen , Matthew Wilcox , John Hubbard , Mike Rapoport , peterx@redhat.com, Hugh Dickins , David Hildenbrand , Andrea Arcangeli , Rik van Riel , James Houghton , Yang Shi , Jason Gunthorpe , Vlastimil Babka , Andrew Morton , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing Date: Wed, 15 Nov 2023 20:29:02 -0500 Message-ID: <20231116012908.392077-7-peterx@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231116012908.392077-1-peterx@redhat.com> References: <20231116012908.392077-1-peterx@redhat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 17:29:45 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782682155051627968 X-GMAIL-MSGID: 1782682155051627968 Hugepd format is only used in PowerPC with hugetlbfs. In commit a6e79df92e4a ("mm/gup: disallow FOLL_LONGTERM GUP-fast writing to file-backed mappings"), we added a check to fail gup-fast if there's potential risk of violating GUP over writeback file systems. That should never apply to hugepd. Drop that check, not only because it'll never be true for hugepd, but also it paves way for reusing the function outside fast-gup. Cc: Lorenzo Stoakes Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Peter Xu --- mm/gup.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 0e00204761d2..424d45e1afb3 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2816,11 +2816,6 @@ static int gup_hugepte(pte_t *ptep, unsigned long sz, unsigned long addr, return 0; } - if (!folio_fast_pin_allowed(folio, flags)) { - gup_put_folio(folio, refs, flags); - return 0; - } - if (!pte_write(pte) && gup_must_unshare(NULL, flags, &folio->page)) { gup_put_folio(folio, refs, flags); return 0;