Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7046585rwr; Tue, 2 May 2023 08:48:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DwijoR2z5wrHVhVz2PDs5MJf7BmvAYDPqR093uIEcarm/4HFS3ffeFPeHbk/8VuGYZptb X-Received: by 2002:a05:6a20:1443:b0:ea:fa7f:f879 with SMTP id a3-20020a056a20144300b000eafa7ff879mr23215503pzi.42.1683042497768; Tue, 02 May 2023 08:48:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683042497; cv=pass; d=google.com; s=arc-20160816; b=zxoWBMrW829o3y6CpfnRzegVxKc2IzmPG5eKpROkZZbX7RjjGKf2Nln1N/zZPEjQkh EcWR6QZX9Xf4xLxCYLPjYUXwewpYFh9T9ONrLrTk9ModW1F0HI5UfymcnjYAo2ooAkCW n4T8n/H+H9oJ5EvjsA4E3LzsQaGh4t8CC5/DJiWusRXC+L42JK/X1qmUMkPaGYNHAkGj X9gh0oPu7mefVEEK2WcG4x1btViHozn4GR4SioS/OCabklfO5udI9wVbnvRwi/aFto6t 51N1naANaMmb6er4sEu9jUPuTRFIZicL5I7U1ZoUWssvi5GkRJo6GW2yBS2th8qn2Gqg RpJA== 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=eoqNzSk7Gg9ENvCVGX4lJCfE019Co1trkdH3CubFIOo=; b=vxLBLaQtPoCP9+fpYOkmgFD+8ZAijM91Iir+PC8QMttSj+MwjsenzfnPvHl0M266vY TkmywEKRwlwnwtE/hO6ccQR/ojymbfTU0s/USnb9lo2F44OXXSKSkpJODnqAMwntRgG8 RAkD9CuRKZs278SRl3OSdlGv2kaWTFv0uqxMEZkmwSbvAw6WnqvRYiZjswN01XBvbJq1 XPWnKknli+ww63EDQUxPxoT4EHakA8wI90kezoGkjk/QIFGwVDYscBQasbbHlQPlCm/I BIgLck3k98zBsapxOtjRa+xnyvpwfpu1Bshbhgz/KXt4BCVoF/jOSVxBpZruedC+lgsk lVqw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=g4MxU750; 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 t127-20020a625f85000000b0063b897210a4si30970273pfb.14.2023.05.02.08.48.04; Tue, 02 May 2023 08:48:17 -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=g4MxU750; 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 S234528AbjEBPgj (ORCPT + 99 others); Tue, 2 May 2023 11:36:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231728AbjEBPgh (ORCPT ); Tue, 2 May 2023 11:36:37 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01E01E7; Tue, 2 May 2023 08:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jRChoImyjOEdPG0ZcK95sZqDubKWh5wHbJ9I2SUdo8l6XiwtJrVjZYeUWj8JdBRz0zBxjUIqzU4BhiB2QQPDc7E0l3c/BwnIzk43cdxr1H5M23//Eb5ILJEkWvE2A4Qy2khFv7QlDCbwH6easXG6r+ifWvNC/izJah8bOGCubbeyG5Y1bl8gUzE64hYkoPmlC1NDAOGBMwIbc9pxAv0lXCb4cHwpUEuepV2b3YLUm4DkEW7IyGzPFoDWQQvf1XKNIfYEma9ZMne82X4C+VreIftSQYuPV8lwA6Ifx+r9WCdZa1yjeTOWEOGE3PU3DNtH2ypMLEoUFPL85x/sw+Bo3Q== 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=eoqNzSk7Gg9ENvCVGX4lJCfE019Co1trkdH3CubFIOo=; b=cQmP7lJT/FG0aAc4KVgmNmFRRyx+d1+AjgVN8psho3qkZy+EJhlX+Ai1aB/QED/Fdo4lBg3oYGL3J5AI0MJx6r+BYpA7w/7XKJbx3JDD7aspMISXyNR4O6SRv6ZpwqnU8mjEnyr+d/qbWB5l2gaiOZzEemzwcScSzlZVBRwaG/FIp2sZQh17Nk+kbjr4CuiFP5T2KDonYnFKGpnU96n0dM0VZPzCu7VXYA4fQ9Sbn2fc9MsAUfQkLtHn6tzOxO+V/SO3bC0aqHFoiCOj+4cXJirgBGtnX0zQApyan+jc/04CdKkqirNO0n8I9fAr3vXEAxqovrE8VQhmJlCnNHazoQ== 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=eoqNzSk7Gg9ENvCVGX4lJCfE019Co1trkdH3CubFIOo=; b=g4MxU750GMU4IkEQKb2dFVEOjQSPJaGTSv2hvTVbXY//WTPQuDUegyFpflXV54OwWfsZkzZ6syKo3QHmNKdYjWlHMlVibt4Fy70ybc8qIKPvmh7Odsk+Lh1kJsMDpOtjVR6/YvOXbV5YpnkIfPg2OIwyl6KR4VL/OMI4yGqHbfYOo80fsjtPpak0ikH/jmNNfHYqdN+JSUwjXkrCW5MUeCRkO6GfBiMWGQsuKqgMNtugk8MaxHn1uDX+riFoDYE8+K6YJS3ysR8qcFFPMroBnlkoJMcj4FXZhQxsfVL7UDbFiPXAIpslpITUgtFmBxXZfnfA3CibaO8ZrGkdHzPlrQ== 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 DM4PR12MB6279.namprd12.prod.outlook.com (2603:10b6:8:a3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.31; Tue, 2 May 2023 15:36:32 +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.030; Tue, 2 May 2023 15:36:32 +0000 Date: Tue, 2 May 2023 12:36:30 -0300 From: Jason Gunthorpe To: Peter Xu Cc: Matthew Rosato , David Hildenbrand , Christian Borntraeger , 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 , Dave Chinner , Theodore Ts'o Subject: Re: [PATCH v6 3/3] mm/gup: disallow FOLL_LONGTERM GUP-fast writing to file-backed mappings Message-ID: References: <1ffbbfb7-6bca-0ab0-1a96-9ca81d5fa373@redhat.com> <3c17e07a-a7f9-18fc-fa99-fa55a5920803@linux.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR02CA0014.namprd02.prod.outlook.com (2603:10b6:208:fc::27) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|DM4PR12MB6279:EE_ X-MS-Office365-Filtering-Correlation-Id: 0eae0ddd-3e96-47c6-cd7d-08db4b230138 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZtkzqBbvcR6dLa0XCP881ARm451Yc29PzBVIa0dBHsroM527rsepfKMKZ/k7B7aeJhVhxhpphiKoQsml8pa+hdYnhskEVLtgUjJZfJddFgBDQY+Bd41FUwSM1ZBVGjvfG5ZenuBfMPpPM3I//mVLswXmTk5nEckFnidN3kolxlnFJZ4EQyIxvcyYLUTT59SNUgmrRMOxZDLUhKnUB5fDuon81yMuqlHz6euWSDAyj1KyRiXYKTLZPW5qz743GyBgj7bguBgcZ7CyDwn0XwqHmt/LvDSkh3qLgumf6VIH1phsTHYfL77a81+fJL78rVUo2A8YFeXYzs32p1mJRJ5cet7h71PH/pBFAdwP9osWl/gGZtJMR0m+4f++cfHgTpvbovP2g7TNnlvyYNm9Z0xBxlerk5aQgCtODPkQzFbpTigJV+Z/ggU4JnhJn/Wr/JeO1/TKHliRGd2oWGFmrE650Jeuggoc1Kh2A/vk1a+sPwXDqrqOzcRGc6Rm4GQapvkzITgqaoOwXr8820lmBNDzYQS83U6Gkts10ZAV3HmsxJ2sKOVV3LL/xtBnDSVqUbyw 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)(376002)(346002)(366004)(136003)(39860400002)(396003)(451199021)(6486002)(186003)(83380400001)(6506007)(6512007)(26005)(2616005)(36756003)(478600001)(54906003)(66899021)(4326008)(6916009)(66476007)(66556008)(66946007)(316002)(41300700001)(38100700002)(8936002)(8676002)(5660300002)(7406005)(7416002)(4744005)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fGXI12B6+S9ZAnArC2w/Rq2WAs4lKdmNmemzVSFduEtqSAlM2N2lM8UHq4VL?= =?us-ascii?Q?JBoFaeHeGkH+wEB5AlgbjxFFDDLan2q4XOlWD//BzrxOA8Y04IH47otWmbza?= =?us-ascii?Q?6/qZBRKMNvAB4P7uq4gJUabb8TGGAdwWzdgVsKKIovLwzFGldydFrLT4+3AO?= =?us-ascii?Q?cI1yvvJFjZcMyZZp26v52Ql6f9YZK6uSUtq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3b789IlqbaGvqbeLJP2QHzAlYzuxk7l0KybKshd?= =?us-ascii?Q?AMyJgHomEyKQKZhrVfR70rhyJ2cvCo9pLsbOh46yb2sgdv5JjKkvS8Qckb5B?= =?us-ascii?Q?4VKcWZCDV9+0k9QwiA/WHj3J2mCn857mYdZCsKU3fRaN/JZoH60qJy8rcQRS?= =?us-ascii?Q?xeZcHt4gDx12GW4F2kh5h1HXyHDh1IfvkZeXX2K2aeImujlW/bfMUfzTpKBg?= =?us-ascii?Q?h2wrujXvq6H8Uv0cnbFVHxFg5SnzB/R2j/oUwEV2vedstMj0bPrZZ294iDap?= =?us-ascii?Q?TVA2maRY3YP7Du66YWVYk9GlKnl5I33jPiI8cWjAZ9sbGvxt/sDgdIZgJmz7?= =?us-ascii?Q?t+5R7qZ03Ik0sEqFNs3VhgmragsjbOfaid9K2sZKTWlKTcIMQJshX66oUBS7?= =?us-ascii?Q?Tk3DE6p+fnkyt8txPaLeEo8j1lNaAWKtf0KycMb4UlrKEwgJsZLS5jYSL8Bs?= =?us-ascii?Q?1tz9C5b9aEWtLRNLLUH74hndoUDlyY4mr2ro+1PD?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0eae0ddd-3e96-47c6-cd7d-08db4b230138 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2023 15:36:32.2493 (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: SasMgi7G1rUQs1sIkVlh5vRbBa7ySTkvGGHeZtO7rka+wwql43r5M6iu7ZuIMpYD X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6279 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 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 Tue, May 02, 2023 at 11:32:57AM -0400, Peter Xu wrote: > > How does s390 avoid mmu notifiers without having lots of problems?? It > > is not really optional to hook the invalidations if you need to build > > a shadow page table.. > > Totally no idea on s390 details, but.. per my read above, if the firmware > needs to make sure the page is always available (so no way to fault it in > on demand), which means a longterm pinning seems appropriate here. > > Then if pinned a must, there's no need for mmu notifiers (as the page will > simply not be invalidated anyway)? And what if someone deliberately changes the mapping? memory hotplug in the VM, or whatever? We have ways to deal with this class of stuff in kvm and in iommufd/vfio - this does not. Jason