Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2468353rwr; Fri, 28 Apr 2023 10:41:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4sCU4dmTbvLvPIW4MGf+yONryqK0K3pQPB7Op0sSxjor4XkTuUX+i3RK29qCyJAlaLfsvB X-Received: by 2002:a05:6a20:3d8e:b0:f2:1a72:2a8d with SMTP id s14-20020a056a203d8e00b000f21a722a8dmr7252986pzi.14.1682703707910; Fri, 28 Apr 2023 10:41:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1682703707; cv=pass; d=google.com; s=arc-20160816; b=Iw783QLW8S2UjV1RdnZ2Nw25Wwwni5BGQ7CqnuywbVg4AsYo/nyne5ZtD1ZmQbbBvY pmV2PStXBjrToJpda8T4wYm4hyxMVbskKK+XAkD3J53syYZckQuH9Ic6dGXoDT112MhN GBQPTiaD0+AojFYD8TmGVVChiV2ObRKZ7/FGK9WDtPWNksehGQYRIyyYuHB5lu75VTtG I3YZLrDUDck5ClcLRIYh1Nt34igJg+akH9N4TlLUV7nMQSzw5cwGOaasJUic6CQQhUD8 WjMrwhGJMAgGl8JXapKM+UnZueX9c7UCsWY5W+/dmvxj2/qe20lvGtBGnQySg//mKEkP do6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E1Vfgu3cqCPPEyTOt1jyATDNwDp7qFRmohQV5JSOXAc=; b=GrWmvB3VUzZ+cvikJWrSKHavTRqNW4y8YbBPj9tXIh7uCEgUGGSdiFJMSywaej5fhE C1QG04dp3mEN1FDXghCFmDjHT7YYzPFkL6zfUc2iwExI9+RLw8oCJpJOauo/P8xM9J8g /F9IwNTus4z7gxOAty0A/gfZA6oHAQ2SBxpkIuRRE0F+BM3IKdZSH33bgHooGAgkaTuv 5BAaqlA/xow+LRlZl0B9QnVftPwwQ7HGiST6g1d0pkz1e46j6zKLX0wtflHT5Giwx+Uo Hu1O0EwWnC7mlTE5Y74pPHoT7S+4Tg98pgzd26hLc80aHjEofjr3AQRZDjGRhY9GdEVD FIBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=QiyX6vi0; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 205-20020a6303d6000000b0052504ae7539si16309619pgd.145.2023.04.28.10.41.34; Fri, 28 Apr 2023 10:41:47 -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=@Nvidia.com header.s=selector2 header.b=QiyX6vi0; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346066AbjD1Rdz (ORCPT + 99 others); Fri, 28 Apr 2023 13:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229687AbjD1Rdw (ORCPT ); Fri, 28 Apr 2023 13:33:52 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2040.outbound.protection.outlook.com [40.107.93.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185612117; Fri, 28 Apr 2023 10:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RgT3WIM7j3+Kc6+TAShTIyRM4IUOAIARzSCUIR3zYTG9HokeotppAqqnbsXJeIe4LAga/iSG68gyhiDsDhCG/7XQNlT2usvAfnOLxC52xvonAnsQQemVrLOlJWb1WjxNGTh4jaQN2h9XMlGAchGO8CSBmu7dNZUDPq+gZwrcdZY+moSq2tQ4OkhKUhqiBq/+p80jcfyDcPVSB4qKObCd5FFpqb8Ue2IA/JQ82u7vvKuHporYtRZEUOAKomcXL/PSTqqRsgkCpuBeATQ577uF37DJ+Gt5Kp9mRPT/97tDx5w/B6JlDUkkyYksDEkH6AyHN/Xg0KhTT4J/SMaLY1H4TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E1Vfgu3cqCPPEyTOt1jyATDNwDp7qFRmohQV5JSOXAc=; b=Fodr/Q/8YTXMefndPOky7gzzBasS6lkH3JY3ns1lZLsguGZ+rXHvvxWB13fVImjMnnL3PHD3gpomiZN1R3oUcT20tAcaIlL7tIJTTu/jXHovGI5p1OZfRDSTzvijq5Db5T2wYboTLMr+4OpUVP3zz1Rt+wttU2EXqdgP71dUjLhFJCgLXNHR937wmSvlZIyNXwqSkYnaRUFEzS1BTel9KYXtU1Zi4dmadm2YHh83efpWsf3Yblmf7PhEryqdFSBsjqZG70Xr18m881JUo+UaYAT64JOeIkAw2Vs7WkdS70LhYWEF5JXlZKsLVjNBHG3uu/x8swIV3T/vUmjACv9rNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E1Vfgu3cqCPPEyTOt1jyATDNwDp7qFRmohQV5JSOXAc=; b=QiyX6vi0UVtbHfbieKgUA9ThcPokZg8ozDPn8qRAtePc5w6GuPAkPNLnTUZTTMnt2vxJndH8TdjHE/2dOdFN/bOyjBdxAxMTk6cVPo6qUaHqaR4L95kw+A2izcdhdGEUp9vhYxLmumdTl65w4QBbXjjt//7Yec8uCkXQ/IBbuysGXBNI3VS/mbKBC2ASLteXon1qXasEtQ9gFENrDAnSxXEWQWCQWF7/YoJiz7Fg0Hq+NCf9ztFJw5b1Hs0PcB1AKrRZfS8EDoWVbUXqe7jiBmdd/PFG7CvFs5RioECIj9N/QB4W/hOdm57KVIVaxqLWf1tBFO2yJdDwDbRnAO8htg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by MW3PR12MB4572.namprd12.prod.outlook.com (2603:10b6:303:5e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.23; Fri, 28 Apr 2023 17:33:47 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::f7a7:a561:87e9:5fab%6]) with mapi id 15.20.6340.024; Fri, 28 Apr 2023 17:33:47 +0000 Date: Fri, 28 Apr 2023 14:33:46 -0300 From: Jason Gunthorpe To: Peter Xu Cc: David Hildenbrand , Lorenzo Stoakes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Jens Axboe , Matthew Wilcox , Dennis Dalessandro , Leon Romanovsky , Christian Benvenuti , Nelson Escobar , Bernard Metzler , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Bjorn Topel , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Brauner , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Oleg Nesterov , John Hubbard , Jan Kara , "Kirill A . Shutemov" , Pavel Begunkov , Mika Penttila , David Howells , Christoph Hellwig Subject: Re: [PATCH v5] mm/gup: disallow GUP writing to file-backed mappings by default Message-ID: References: <6b73e692c2929dc4613af711bdf92e2ec1956a66.1682638385.git.lstoakes@gmail.com> <094d2074-5b69-5d61-07f7-9f962014fa68@redhat.com> <400da248-a14e-46a4-420a-a3e075291085@redhat.com> <077c4b21-8806-455f-be98-d7052a584259@lucifer.local> <62ec50da-5f73-559c-c4b3-bde4eb215e08@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BL0PR02CA0078.namprd02.prod.outlook.com (2603:10b6:208:51::19) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|MW3PR12MB4572:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f9cba5e-00eb-4965-557b-08db480eb8fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JUcEFjaNrY7RIBySwyEAWv4dlsYdb+0F6yLHwPlDrHKdDzY2GN2ibABkha96m1iyA7GOcQOIS25zNwyaU+LuyM2mQtSjP1vMvYV+yY4UuJbpOuV+xBqzK1yRjKJ2tTg/YhmXgGKkQCVtQX3waCNMVWTkcg/rWAJp5dLzP2iFuUZdkTqd8bNdU+EmfykCoztkWVR5PCpZwgAhuK7RisVANvCX3JN03qsuDht8ooWSkO7fATrVqCVU7CQBBisfLWp33kvVyuAvFB51kpkDhpRrZfZy5YRVwfo9ECAy9pUU3g6X4X3BlasKWUAsSWfXw2MdI6BIzEVNWZ79A6GcnKZLpRj4ShBL7xytdznXub0cqCoixqcN4HCWeAIhWGUyiMiH+wFKlqVtrSMSULO/C3I1b5j0W3HcVZMC5oEQD5QG+CuEM5xTMQ1374t1lyucR4yGT5qHRwlAng2kpL4ptNj0JZ9mft4H6kBWoOe1pJNrfznzb4gWP00zwGVBAQ0YRinycsGH+0gYZY5ZmVs8sft7B6va/QaKcUVUMXQsNgu7ZAQwPZQuURoly+RcLjgrdlA7 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(136003)(396003)(39860400002)(366004)(346002)(376002)(451199021)(36756003)(26005)(6512007)(6506007)(186003)(6916009)(66476007)(66946007)(66556008)(4326008)(316002)(86362001)(478600001)(54906003)(8676002)(8936002)(5660300002)(7406005)(7416002)(38100700002)(4744005)(2906002)(83380400001)(41300700001)(6486002)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?gCst05YJ2moqIhX9sX+LLoAStVoFy5D/7SBajLa2l8VZSYKdwbFsAcN34h1O?= =?us-ascii?Q?DB4pUVEawB8oykHQVW75+nF1KUU67oqKLf59MUXN14swmtScx5OpAkPW8+ow?= =?us-ascii?Q?mKHa+FuEoncdJFtU39aWcRZwOLOo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Xa04TLuixyT6f?= =?us-ascii?Q?LriagI9xfaMYfSPhV031pIH/EhauFs3AEHriwy06AGDee/9zPJoEvwa+QiOP?= =?us-ascii?Q?IsnoA6m37ylkIPGZFXh179wR7oHgPUqOrm8qZAwN37A1ixUfzLiDSqiBtiRv?= =?us-ascii?Q?uGhiCXTlLbW5oW6lUpANFbg+BLvTZAO4f2FxEFmFmryGcia/O0uyDo0qLhYD?= =?us-ascii?Q?LS9GplZ1gx3wVeKb+1bvna6+sZXTeWXXw2weTyn4bU51DPN1c/kZ5QkS/Cb9?= =?us-ascii?Q?1P1G8Geom/2LmMgidmkjdR1+cVrsMRSDAu0gI1j3bHocA8xz8gh13xV3Fn5z?= =?us-ascii?Q?qqJP768G8zzCYRLBGxiVimNu+3y8FK9sX3uztrLGsa7KvIsQEdA7SUDaFVi/?= =?us-ascii?Q?9oJsAJ7kVUolcelM6mcqRf/GpYDoGmLeiwfNVP8cfh+V8cQBXQdj5AyCFuY6?= =?us-ascii?Q?vZAgbu2GQ8duOH8fFsChNo3Pru4/e33iwmPsNSOnidryswEBIavFLNObHDZ2?= =?us-ascii?Q?YYQ0ELNO+zW6jZaV6u5jOKF38GPJ64SeFe2yxRKdTuoqmpylzv2U4feQ74sb?= =?us-ascii?Q?9rUJGu0qNrIlkmUZMM7Kay9FOUYuLmoys0qEcwp2?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f9cba5e-00eb-4965-557b-08db480eb8fe X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Apr 2023 17:33:47.5496 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bz/XCfi9YFwdmbgjZW7VPPpHyDuRTAAxFr1u0cj67+WAMow5aLRO/C4IYW8LSFl2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4572 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 Fri, Apr 28, 2023 at 11:56:55AM -0400, Peter Xu wrote: > > PageAnon(page) can be called from GUP-fast after grabbing a reference. See > > gup_must_unshare(). > > Hmm.. Is it a good idea at all to sacrifise all "!anon" fast-gups for this? > People will silently got degrade even on legal pins on shmem/hugetlb, I > think, which seems to be still a very major use case. Remember gup fast was like this until quite recently - DAX wrecked it. I fixed it when I changed DAX to not post-scan the VMA list.. I'm not sure longterm and really fast need to go together. Jason