Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp12482imn; Thu, 28 Jul 2022 20:12:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ue5afqlK/2xNoDzekd5nM3MU9cMIRCd3CWXbj7PAFzwpD6FaPhwXMRemU/kY1d9sH8MHOF X-Received: by 2002:a05:6a00:1412:b0:528:47a6:8569 with SMTP id l18-20020a056a00141200b0052847a68569mr1727636pfu.39.1659064365274; Thu, 28 Jul 2022 20:12:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659064365; cv=pass; d=google.com; s=arc-20160816; b=J3GRbMp/FtB7kZFZ6cHusHotaJ3QvlM4fZ87CuKQMkHur6xcsM4e1mKySjxjuS/gaA r0dbxIUHYrsAUXDDzKVHSC3A45/1qCV5hhA6yNYDZWlMvbiGjyZANO4sSrb+gQLIysrf Tu6gQuQYaeqBu8XTX2QhXur4B2x6fnDKS+ec95W3/NOJkbLk3nqcYbKiJWvdd4ifT94r EwaSCa3aS+mobOqDbY510pJH4junuNUl7YPIpaVplfRpJ4IoogvFldOdmKkV3hWiXgXp 334rC+KtdsGjWwgisyrnzsztU4abdUtGaVVCKyuleCI4eNFObeaW0W0+airvG1ChWmMz P0wQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=4w1cDHURP4iy04Ch4xIwXJIvCUoR0pWVmGMGATvrg6Q=; b=CbOBJKcHQVMcCJ35qpr4IPovk46MlPsXgqVpw7NV9vKIVweCSnpM3XaSpzKAuOR/IR uU4aXwIMcPIt0Uiewn0uqg2Nekd9ks1aA0Jx9UCIBNfro3VPMnBOvMLb/laikOryNseO kVthQLtz8SwXxedkv0BCt1dWND786GrwcF3WrVGxuwpp1sa0/bTK+oDbEiQayhkhTQgZ 5WfNiUM7MDa9SgFpxKaA70rMT/abrnWZ0Pds0Jvkd9HDBDOQvaNVWVvOo6UX8YgmQcFI IUM2RF40LnPHSMfxAhEiJFrLaT2shkkiUTZI7lm60DXLPqPE7khrqiC9J53U7xgfq7Xi 259g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=W3Eb+dKq; 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 d10-20020a170902854a00b0016d9266278dsi2448467plo.309.2022.07.28.20.12.20; Thu, 28 Jul 2022 20:12:45 -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=W3Eb+dKq; 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 S231883AbiG2Cwn (ORCPT + 99 others); Thu, 28 Jul 2022 22:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbiG2Cwl (ORCPT ); Thu, 28 Jul 2022 22:52:41 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4A2513D32 for ; Thu, 28 Jul 2022 19:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEOvsp3FmR5YVsgfDwcke8EI/LXbxk7SeiBiLyDa9TWIoDgYgcnWHUEc88UOJ3T7L1+B20sHuO0lc3i5TTmSEClPJqaJPIvXG7OdeQ7CILwIp9eHCQWjFKQfPJXPziKsIQfuWZBdbwhf+qpdI7EbLrYWPlfZe3TmSNN+gRxUAJ7M8oqSXygfo/VmIaZeqY9jdzQ+dEoJjMjd06oxiguOqBtjqC0NnBaGy1jQzy5hBUqNDk4/DUHXzXP7OMzfWhWLDpQQD3r8WdEMDmL4+I0nyDPmidCfw1tlq20025AlsHs5sKaUl3t05UFT84PLT5B50JZTixQK1Z1xzaO1NJtAXw== 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=4w1cDHURP4iy04Ch4xIwXJIvCUoR0pWVmGMGATvrg6Q=; b=Eu1UoIOIbTTecIraqPUs0spPK+R6bEGBs0zWRcAw1AiiRTuARF2ZqCJZG8p8kkLXVEauvje8ZnnKZa77fmXCPnz1Dqs73uiPqccm1k5VcPCkaE8ZR2Q85iSSc1ExYSBNq3AGCw7zxe0puA9AuR8NeqbLMSzYSq93hP84KvGROpu8LeLSVItD92xCaZC+rhuSg5NYQluHEmFD4d6Ujjx2EsR/aBT0wq/sDYIef/8D5tIAPLoqtaDmrR2Lxyo6XfX+JIGbMoiDErq+VdUKQItjEFMyVsTDEf9KI/WSHbkRMzN/4J5qRH/MylSOBaqD1pD4STYgpkGy8zkc/OibOx8Siw== 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=4w1cDHURP4iy04Ch4xIwXJIvCUoR0pWVmGMGATvrg6Q=; b=W3Eb+dKq51Al7VLp6i9RGLkaJjcHPGhDpawVXLjR3MwKut5McC/i2jl0n2yZB+COTA9qBJlXQg7qX0xWqMhjtrPEsGnsY/8yNbPxTdrKPrB8Qz+7kbMltpB9ExXqC0tnWstywpwJzKa41szrwSOnXyxrkN+58Yv2qN13uZcyszFBhjCyaJgKRJ+T8+HscOxlqAzicMfMNc1C3EcJi7jujarKsSVJAC1iu0mLtqzsPa2Zq7zn/yl2V/cKUP69VEHj8cliQotnOs3WmlrzCKwdM/x6cyZinnhKvlQ+pedtVIcthkaWxN7JjqwvHH4cQmuqN8cUstoB/R/TLZ0sy52vsA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) by MN0PR12MB6077.namprd12.prod.outlook.com (2603:10b6:208:3cb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.19; Fri, 29 Jul 2022 02:52:39 +0000 Received: from BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::eca6:a4a7:e2b2:27e7]) by BYAPR12MB3176.namprd12.prod.outlook.com ([fe80::eca6:a4a7:e2b2:27e7%5]) with mapi id 15.20.5458.024; Fri, 29 Jul 2022 02:52:38 +0000 References: <165490039431.944052.12458624139225785964.stgit@omen> <20220615155659.GA7684@nvidia.com> <20220623142139.462a0841.alex.williamson@redhat.com> <20220623204712.GG4147@nvidia.com> <87a6a2zyxk.fsf@nvdebian.thelocal> <20220624013415.GI4147@nvidia.com> <874k0ax1s0.fsf@nvdebian.thelocal> <878rodvcty.fsf@nvdebian.thelocal> <6492e852-8acf-95a9-a3a0-8ce8bbaf46d6@redhat.com> User-agent: mu4e 1.6.9; emacs 27.1 From: Alistair Popple To: David Hildenbrand Cc: Jason Gunthorpe , Alex Williamson , akpm@linux-foundation.org, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, jhubbard@nvidia.com, joaodias@google.com Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns Date: Fri, 29 Jul 2022 12:49:00 +1000 In-reply-to: <6492e852-8acf-95a9-a3a0-8ce8bbaf46d6@redhat.com> Message-ID: <87zggstyto.fsf@nvdebian.thelocal> Content-Type: text/plain X-ClientProxiedBy: BYAPR03CA0008.namprd03.prod.outlook.com (2603:10b6:a02:a8::21) To BYAPR12MB3176.namprd12.prod.outlook.com (2603:10b6:a03:134::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e90cc4d-ebc0-4b01-3347-08da710d659b X-MS-TrafficTypeDiagnostic: MN0PR12MB6077:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qNycKe/fSsLjX+XGjlrfKun6tDgL+Fv4/cx0OkxyQvktwpLAha+fGCqtF/TrApW1EM9XWFpxEJT6rx8yt3uk4PG/rVOcjASICwiV+bejEIEF8SMlgtpMW6NDMBPC0uN0eetZ+UKIgBwchHd2KSGoqNp6VTJWjldD6gOOAu046FLazpCPQp3qmr7x626eYxM/g/F0/8tIbS2iF0/xdzkiMs2tmVx+iySGDVrKsAwRV4uTTnq9GD7hq3FTKQGOEweNJ1x4Gtf7Ys3OLKV5WObOBlQ4rCJ0bTD1qcli60OslTCcZNvWK5aswbGyQkequXYjZQbdOhUv9NQM/EZ4p+zqanLrLH1yoLTVorbSFtGk2IJOQv4IgqL36ct7azJN6mVfDTBH3ZoFP6ZX+HSq9zTJTpyORF+sUR2spM0ZhxbFmXn2eV5SFTxqQU7OX86V5gOQfz0WLrEcsSZNXZAx00sAt7f/Z9ashM6DYRVzIRVMw92A6XaLP5L+nVL4WYrJQ824fAMqV4elb+0rrTGIqPRbfUqxBDlhMLT1Uw2t2EFJn5VUnU+Z8hmHVsXLwlgjECtSOW3y8nCbjn5Khv6EyevMqGfgiF4/vP6/Mvd7R7Nng9U5UcdDt7RRsf4YzHst02b3sxrKiOBPaDILpDYnv5Wtb0zoGCzkXJI/G71b5CLU5lmGPIZyys6iIzAndOH3UhGQoWWlL4fB77Z8L0qGU0nZXxz8B91ymFQOkrMUWl87MR8MnmrIMb3FHqGvrxPW3wPv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3176.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(396003)(346002)(136003)(366004)(376002)(38100700002)(6512007)(8936002)(8676002)(6486002)(86362001)(6916009)(26005)(6666004)(6506007)(478600001)(41300700001)(54906003)(53546011)(316002)(4326008)(66946007)(2906002)(5660300002)(9686003)(186003)(66476007)(83380400001)(66556008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?tBo4uNvcN9Jr+kEV9gJzPq0h2JmNe6gaDtPRyfrWewbzh/2/l9OBc9HqpiOA?= =?us-ascii?Q?SROwxg7iEG8CbSGSd8dln3CtkqarD4G8Y+B92cUjiiVUkBUq2efyW9XM7/U9?= =?us-ascii?Q?ABCZqAvI8FcbyMN1bjVhOdQfX4/Evbio0bqjd5whxcDzMmR5XLg67OM0IVUQ?= =?us-ascii?Q?E4haFuPAuzU4Gm72ap62l54e+rcIhMGa+P0EEhHTm7JD54mQieqYrKkrnX+S?= =?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9Qadc4yLl6/E5Ndqonm61xC/Vq9Ao1?= =?us-ascii?Q?eNn8l2hP65zaSJHjRpbEOUHUstHeyju3SzvbujFNW4JBlN5JEpb3TU8hFWx1?= =?us-ascii?Q?O7s310RPDFQq+J6VdeSMO18jcSnjxZUwn7z2EgKTHbQUvR/VuOsMHaWAMu5Y?= =?us-ascii?Q?73+JaGcpmujvFPkmwgZCkZagEeUD6fPNvvljnFd/ndL921HWcaytAuX3VaK8?= =?us-ascii?Q?O+CqEqF8MOy88NC1I9SjBB0tSS+1J6yas5xpUGfOooAvRV+bN6/4jZSwzqVZ?= =?us-ascii?Q?nIjq8n1zowSBtODggA7QMljHqJuhOE67sApmSrUipCfb7ZWl9bsBSu4vzDS0?= =?us-ascii?Q?Z3faXlvCObP8xbAuYkeg+4JsLzU8BYhwCXkRbUqnOFE3uMU9sL4HGjzkkrTr?= =?us-ascii?Q?rMo7Pe7txmBZC/pMYijDEvC2isz3HfPtBZ6F4Lf6lZClxo1m8D9BRGnu8RaS?= =?us-ascii?Q?8rhb1tZXUFJ5/JBZvaDuUFJO0f9Og+fUAJ7treSz?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e90cc4d-ebc0-4b01-3347-08da710d659b X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3176.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2022 02:52:38.0936 (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: hYq1KyFjvrMxoKVIF2xznDQuTkTCqrsdGUuNktm1uVqtJgpaFpihnRvGM6qctnP4lKD9T7mSQ2pHqe3oHXcKWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6077 X-Spam-Status: No, score=-1.6 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 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 David Hildenbrand writes: > On 28.07.22 10:45, Alistair Popple wrote: >> >> Looks like the original patch might need rebasing. I am about to post a >> clean-up for the tortured logic in check_and_migrate_movable_pages() so >> can incorporate it there, but I'm wondering what the consensus was for >> pinning of zero pfn? > > We have to keep it working right now, but in most cases (inside > MAP_PRIVATE regions) it's shaky and undesired. Ok. Well I've looked at this now so may as well stick Reviewed-by: Alistair Popple on it. However I think it needs rebasing, should I send an updated version? >> >> Currently my clean-up will result in PUP returning an error for the zero >> pfn rather than looping indefinitely in the kernel. However it wasn't >> clear from this thread if returning an error is ok, or if R/O pinning >> of the zero pfn should succeed? > > I'm working on proper COW breaking in MAP_PRIVATE mappings, which will, > for example, unshare the shared zeropage and properly replace it by > exclusive anon pages first in the FOLL_LONGTERM case.