Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2563268rwb; Thu, 29 Sep 2022 11:51:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM679v75oXOFegpiQ63KToumk87Vya1r6Yd4VraALLQKH+T0OsT+8XNXQeoHXoE+uyIxmmse X-Received: by 2002:a05:6402:2793:b0:451:fd7d:fc0b with SMTP id b19-20020a056402279300b00451fd7dfc0bmr4614166ede.13.1664477491881; Thu, 29 Sep 2022 11:51:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664477491; cv=pass; d=google.com; s=arc-20160816; b=OduYFrH5X6ZdwLQbQ81S6IhDrHIIkQdqKpRhdSrang4M8SQ/raOHRSMTQ7lYA//J8s 9QK9d9Nnnn/fVvs8AQjYE35lNRsCdX3K/Xn25xB4EuyuaIucJtamf62SJhuf/+L+PiFo Mkh5wd5FnFEE3uXZCHFU3xL1PVAZW9pp9H7xiel5LBo9xvYViXagwFqsw0dcvealq7fB /DfXoTd+fjO8UYsr2HUhbVS7s2i/rsUFPcWavhgxqHmCp8Oojay6fCt34zvo9VBT83vO JpJ6Kd7qZzzpFZ+DxjBKVGREa39SMCVtvKuVNzRADdNp7ypAvdOp0VdHJ7fC9hvwK6wY t/OA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=lD8oE+u64k78vjM/TOju7+2Rdwyk5rFW1bPyqA2iduY=; b=umpsKMHZy6W9YqoNULqRylxkEaAfjHut84IKF344EP65p0mv0KKDW1b86QLnmsxCzc v06rpFqbA8mEU+o2pvisXjsKlCvHLqFiJoTCmIA/yY75s0Q4kiKwWVJCCg7Vl+/YZunE zAT1LMIsHH0RvOYKiju4+JYpjb2+fDIw7cm3fIz7izlLhMhWsM4iMBNFVsQeEo8nt31d s+alCtOWKzY90VWxzo/GnsqNqUXOG+ceaZa8u7D02HkSsya/0WSSsajTZMZ+5aAu+xAt ro21qbAglOVgGYEis5EBvEsxMfbwCE5p6KKxwfB/69eTiLriMCv17e4kN8mVgIhotZc1 ObbA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=sbhgHeFs; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.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=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a05640250cd00b00457dbbf8336si205472edb.456.2022.09.29.11.51.05; Thu, 29 Sep 2022 11:51:31 -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=@vmware.com header.s=selector2 header.b=sbhgHeFs; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.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=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235697AbiI2Sko (ORCPT + 99 others); Thu, 29 Sep 2022 14:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235089AbiI2Skl (ORCPT ); Thu, 29 Sep 2022 14:40:41 -0400 Received: from na01-obe.outbound.protection.outlook.com (mail-centralusazon11013003.outbound.protection.outlook.com [52.101.64.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B645FB30B for ; Thu, 29 Sep 2022 11:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iK7uu1aQ/FIJpbhuv2Nl/dtOoA/vf1fpi2n9TmRQQ5R/HgQ1AYZGfqqHgvJyhxz1Hmn00H6V1slpxksq8bofa39mGP+L66MB++QHmromqxxvLzva861354mxmwTubS7xMKaftQOWpYGlMQe8pYhamRvUNtujyymNFOyTRXIwASi1t7KUzBH/6WW9bZn+vWXusKTMESFJEBiGxMrYhWCVz6OluGVpwV9YTRLZamDXCUXD9tjNcahsofXgGBnorDkPV/ILp5cD/V6pfK68lcKch5RpczZUN0IFiZOVUUMoO8X//saAIICFxGR9noLt32oCDqewMvP5qVekIqm1OQ9LLQ== 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=lD8oE+u64k78vjM/TOju7+2Rdwyk5rFW1bPyqA2iduY=; b=nqBOS53LIGA4DRuhTwSGgixIrx6Y3/HOrdWLgORnd8UK5j7LcFqaP3PcB2SLKgNgxJCor8lxRG8rBJQapQNaSd9ujDcL2QJbVnfbTVWz56MqI0TpW8lDLPPPt1MhwJAMOdQhiJAGrhShcQkTwydWJPlhmI60BD0FMxjYz1XNLf95CG5Y95MFpY9uHMfl7YJJBF+f4CgxpRy8zjI1h+TWZvAhTSpY023QpJvl2zEDfGiBlL5x+dKVBq34yxQNiogFy2soDWB5o3Bng3wSMkN2iM07P2vdxwtCyZ01mH9pjk61/DsOGesfK/q8cEdIz4PG/tz8b7Y/GU45UYMMcsmcAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lD8oE+u64k78vjM/TOju7+2Rdwyk5rFW1bPyqA2iduY=; b=sbhgHeFsUrO7Dle2ebQ4FHiVdwKPq1Bq8K6kxlNWSAlrY61pWFx3EmtSYFtwaDlkZAIViDcmqPoO9IQ0Zr0QvfxNa96FjMOxgje1f+6m2MkSrtqVuimM+PKhYmG8aGjASGC/2RD8lIUVBnhD/e0xFoSI5yEnAUc+2r5MKrjsSB0= Received: from BY3PR05MB8531.namprd05.prod.outlook.com (2603:10b6:a03:3ce::6) by BYAPR05MB4582.namprd05.prod.outlook.com (2603:10b6:a02:f2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.13; Thu, 29 Sep 2022 18:40:36 +0000 Received: from BY3PR05MB8531.namprd05.prod.outlook.com ([fe80::942c:7d1b:6b3d:85b6]) by BY3PR05MB8531.namprd05.prod.outlook.com ([fe80::942c:7d1b:6b3d:85b6%5]) with mapi id 15.20.5676.020; Thu, 29 Sep 2022 18:40:36 +0000 From: Nadav Amit To: Chih-En Lin CC: David Hildenbrand , Andrew Morton , Qi Zheng , Matthew Wilcox , Christophe Leroy , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Luis Chamberlain , Kees Cook , Iurii Zaikin , Vlastimil Babka , William Kucharski , "Kirill A . Shutemov" , Peter Xu , Suren Baghdasaryan , Arnd Bergmann , Tong Tiangen , Pasha Tatashin , Li kunyu , Anshuman Khandual , Minchan Kim , Yang Shi , Song Liu , Miaohe Lin , Thomas Gleixner , Sebastian Andrzej Siewior , Andy Lutomirski , Fenghua Yu , Dinglan Peng , Pedro Fonseca , Jim Huang , Huichun Feng Subject: Re: [RFC PATCH v2 9/9] mm: Introduce Copy-On-Write PTE table Thread-Topic: [RFC PATCH v2 9/9] mm: Introduce Copy-On-Write PTE table Thread-Index: AQHY0o4wEIMbrk5BdEK3BIHQI3SfK63zm3IAgAAVHoCAATBzgIABi4GAgAA/C4CAABIqAIAAAxgA Date: Thu, 29 Sep 2022 18:40:36 +0000 Message-ID: References: <20220927162957.270460-1-shiyn.lin@gmail.com> <20220927162957.270460-10-shiyn.lin@gmail.com> <3D21021E-490F-4FE0-9C75-BB3A46A66A26@vmware.com> <39c5ef18-1138-c879-2c6d-c013c79fa335@redhat.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3696.120.41.1.1) authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY3PR05MB8531:EE_|BYAPR05MB4582:EE_ x-ms-office365-filtering-correlation-id: 0c1337da-af4d-4de8-b01f-08daa24a19a5 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l8CXET6bQ/OJOmoNyYhTDQn1iT6knPt26JEEvbSK3S/d6yWrlPLkg/5N4EVRcGzq4f+G03obmS8RW4iSmv/1l9Zf/bhbQtZVoubyT1cTtrzkX5pVsK+TEB1wJplpVnovNw1IMvHoAbIMxAd2Y6AcJVARLtori5vXR0L6WB9Kt+mX2NdN1Xkbf1uSkibY8hh4RnvxFeWo6njbRZsN9EhLDKiM3MOX9ebn10ENtNnHDFoJVjh+gDwzyHV6kyOBcH/LTGkbz+PjIknag8Q6oJHKw8kiQSPU/2Q1RtUjj0ecn7VD1694+ytwX00zGQ4LEofv3iSEQkQr+mV44SGCS23UZhAtNyIZCU4G2RPP8iw/ZcTeyOv2kEQCNtrA0RbqCiM2sPv/++RSa8al/85S9D269Afg+pFGBjw0ceRl7Mi/mc6Ijuzt/W/T9U7ELaGpM2j9Q742O8M5vNaI86pdaBoJYF9qYamJs8133zLwj6bO6Sa+wP0UJB0G5EsjW9B1BRDEpdFH5XTmm58TpXxi8qVO3uINUPlBX+ZE9nycKiW1B/Fp7A2vCewaF2pGqAORmEyEiDRydDHmyth7a3fcuulc79/pMZwFmh/0lne+/dGJgluXDH2YswZO6+8oXi9YcXsSDSeSJgQsU7iU83eCLUt1k2rRM6/lnV+rHnrHfxtrT9Juq35v5sLw9G8F6/THbRe3yVv/jOG+PXeIZjsHjA78kpvWvUKdgXnfJRaSV3uxGGDrNU/LTEtZCkpLcKC0F1LGy1vTGgr66VhW8UR4uSFieKrriLgiteqsb62z5FZ+s0+zeV9t9kRJRJVNtUL5AMXoUuCfAVagBBhd5PXmCrVBiw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY3PR05MB8531.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(346002)(376002)(136003)(396003)(39860400002)(451199015)(66446008)(4326008)(8676002)(41300700001)(76116006)(66556008)(5660300002)(66946007)(54906003)(66476007)(316002)(8936002)(36756003)(86362001)(4744005)(7416002)(33656002)(7406005)(2906002)(6916009)(38070700005)(64756008)(6486002)(122000001)(26005)(38100700002)(6506007)(6512007)(53546011)(2616005)(71200400001)(186003)(478600001)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BZalbVp2gGY2zmFe6+/PNUIuFzuPbrIZ8tF8DuPRsbhVoLhx52xJDjxB3HDH?= =?us-ascii?Q?pu5Hn9bmYNYvuBQirQ5OlH/h6Uh+oIhoYY8V6xqDVCCMJAm2epiTavurBc1Z?= =?us-ascii?Q?T+ZZluUQSChvbYwGtaZuWkCopN8tTGTHnK0ejkiVkTYnOClLFxDUEJAbphnM?= =?us-ascii?Q?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AlCrvL5sa?= =?us-ascii?Q?9PEgvxlTyMHeaBkrDmWFlq7pQKj6dWBxRTt2dkKD327O3a9cn/XOFdbc40+Z?= =?us-ascii?Q?0kbK+QP+aqR2g4ToBof/cJyaAfUDy8gB1HQewafQB4oMsLOBcZofQ/6oxDab?= =?us-ascii?Q?v15KqiJA31IdumM9wrU+DxyxuC7l9ZIPz3cLJhtK60dRPP0lZIdiUSxURS+3?= =?us-ascii?Q?2InzYZPFmA4Q5GQhPPY5CMq4L242VeQVTsGdfrFUMlAlCQrXFaf29EdN8+D+?= =?us-ascii?Q?JsyAirjNCpzucpY/Sb7Ol74BH2KomWQggEAzAu5KcwFiJAkXe3zSu2p97zAs?= =?us-ascii?Q?cm96VCIwfTH/f8JXKgaMs1nQfrTIb/a+ZeX4+1KNlEmRTxRTkJvFiwpcXokW?= =?us-ascii?Q?B0eUKixeAnwPUeHKTBoqQcTaO0L99/lVJ536nrhYJD/9yZ5IxosDesjxavK+?= =?us-ascii?Q?WGmQs5LiZ6wN0eBMzgruqwJ4NTRkNuqUzPoAgAgx83Tzimu1/Z8H/kgyYnms?= =?us-ascii?Q?0HJea2wP8jMmv/sF7rJZF88mMtWzQKVhoRlhJGRw?= Content-Type: text/plain; charset="us-ascii" Content-ID: <3FABDF726EC98D4A8686934A91D5C61A@namprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY3PR05MB8531.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c1337da-af4d-4de8-b01f-08daa24a19a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2022 18:40:36.7446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6BU956YFgRa1QlnQ7xT3Lxxplvf9sNfwGizsr9zM9P0RUli9a9xa/Fv8rkyfY7l2IdCxBFG4SnGlWu2534czWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4582 X-Spam-Status: No, score=-1.2 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,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 On Sep 29, 2022, at 11:29 AM, Chih-En Lin wrote: > That case could be caught in copy_pte_range(): in case we'd have to alloc= ate >> a page via page_copy_prealloc(), we'd have to fall back to the ordinary >> "separate page table for the child" way of doing things. >>=20 >> But that looks doable to me. >=20 > Sounds good. :) Chih-En, I admit I did not fully read the entire correspondence and got dee= p into all the details. I would note, however, that there are several additional components that I did not see (and perhaps missed) in your patches. Basically, there are many page-table manipulations that are done not through the page-fault handler o= r reclamation mechanisms. I did not see any of them being addressed. So if/when you send a new version, please have a look at mprotect(), madvise(), soft-dirty, userfaultfd and THP. In these cases, I presume, you would have to COW-break (aka COW-unshare) the page-tables.