From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54CBDC04A94 for ; Fri, 4 Aug 2023 06:39:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE9A62802CF; Fri, 4 Aug 2023 02:39:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D99652802BC; Fri, 4 Aug 2023 02:39:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BECF72802CF; Fri, 4 Aug 2023 02:39:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B0BFF2802BC for ; Fri, 4 Aug 2023 02:39:32 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7EA1B1607C5 for ; Fri, 4 Aug 2023 06:39:32 +0000 (UTC) X-FDA: 81085470984.19.A9B85AA Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by imf08.hostedemail.com (Postfix) with ESMTP id 0C1E8160011 for ; Fri, 4 Aug 2023 06:39:27 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=J8BUYtmG; spf=pass (imf08.hostedemail.com: domain of vivek.kasireddy@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=vivek.kasireddy@intel.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691131169; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NdRG47coMOMMBPf2FCrbPUrNIdjiSvG5d8gO8tU9fjk=; b=sJJU2Uc0BCscjIr/QPt2G6JogpjbVWmR5PgAXj2s22yJiSCzy3iogTK8ymZ6CoJqjq8mWg XRYL+N8rtyjOSWe5QmC/USCygsBFX5xCWH6e6V/rzmv1hfj+v/ww0zfjIjp1pACKx1o+w1 a4jZVEgB0cIWCn5ChhGDs86AGL+5BVY= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=J8BUYtmG; spf=pass (imf08.hostedemail.com: domain of vivek.kasireddy@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=vivek.kasireddy@intel.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1691131169; a=rsa-sha256; cv=pass; b=3ayd2pUpVf/MbiLMOL+93RIbx2aeB+R+lkcIhsSAq+mMtpgdWK6fM/jsI446IHcjkKAAFo n6LegnXO7wFRigH9M2QUuGTNwjAdnTbRro9AHRv/1LVERY9HMrQI0E99S7z51krGaC5kYZ Wjx8H+P4xKXjSHTI4jzY7VYLVkyBJmc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691131168; x=1722667168; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=3Yq6LgrZRFhoHd084+EU7dOu5CdnUpJl/dp08YeOM2E=; b=J8BUYtmGwDo5KADi2KunRiMZEyhCIVzQ4walIkfeAkQ6kbi5/scw4fco EDlzn4usv9yaONE+nLRsLpcLH3zdDmcftPuC23WfBpvSN76p9bySOR+AP ICo6F/zWsuxHhEKkxLuiqxIgPN8wmjbozjLd4eq/4RL93rgd3TB7TdEXx gO8NryV0IV7mY4xzzDQ4BIedRH8oDux3S+r9y8ZCxIJnp+tpHV/a84ReY kvvN8GwkXjC8Gli/KjE9dVFxpCIlbNvCYHKFa91ztFzeClADafwADqign oEtoRKekJ33X62lSFRSoqa6slozvSXKGl5Enw1OLQ4KLDiGgSY2Lg30oK w==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="373729007" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="373729007" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 23:39:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="679792869" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="679792869" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 03 Aug 2023 23:39:26 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 23:39:25 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 3 Aug 2023 23:39:25 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Thu, 3 Aug 2023 23:39:25 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.47) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Thu, 3 Aug 2023 23:39:25 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TE7fQGCtpiglyA95mZCjdhNX9WGPzUc6iIbHbzQPAfg1ok0W7yoE0chNk7gOgsq/sA3a1Fb/ZD37f6QH/qgvj7FS8YvgPMQQQMoMibiFHlYv7K2OPEWN8TA7LSTB8KB6JJJymNwlundnOXk8FeOJU0q/mWdTAfZ7iQULMU6GlJ5apXYl4P9JwSxjXN31hwPf3G6HiX9+/eSlk4eTVGMMQpumsNbIF+ViNrZaArvx+eLQ80hzjleM+O+gzQmmd/z6pyzTjY0Wa0wThQ6bPDBaPznTOHD6c9IAKUCLuH+2b6LMFrwvKpNlzF5+Jo+wVnjtbDSItlOXElvcyS2xXW+6jQ== 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=NdRG47coMOMMBPf2FCrbPUrNIdjiSvG5d8gO8tU9fjk=; b=SgwKipoMj0Abuc9RUJL/ZLDkbxAUESMoofpDGFZylWAJJsTKaOtMDAsLfT4oO0Ow6S1/XdcAxNom6rY1gENa0av1U33MDZ5kNskZtL+pU8k/l5wuEKVays8w9LnGf/qkq0MTRjwPT1BdsmGk4Kkfd2P02GjQ3ES1r0BNNeiq5NOamgc+9HhdFNYOoP+VGbEpgwZPwu1JpINeVIJQ5KO3S019bUsMdQ2hrnR4OYZNivLyPj2+HvEYps3KSRKEIdzSoHHFLTZI2uuS2QRIeKZNv9RaPj7W5MxjmLf4x6ZbGkZrJrae8GRiCfPkRsxDeNcUGFbQ9IrWKSYhlOAU4xZdBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from IA0PR11MB7185.namprd11.prod.outlook.com (2603:10b6:208:432::20) by CY5PR11MB6389.namprd11.prod.outlook.com (2603:10b6:930:3a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.21; Fri, 4 Aug 2023 06:39:22 +0000 Received: from IA0PR11MB7185.namprd11.prod.outlook.com ([fe80::b78c:107e:e7ad:4e2b]) by IA0PR11MB7185.namprd11.prod.outlook.com ([fe80::b78c:107e:e7ad:4e2b%3]) with mapi id 15.20.6631.046; Fri, 4 Aug 2023 06:39:22 +0000 From: "Kasireddy, Vivek" To: Alistair Popple , David Hildenbrand CC: Jason Gunthorpe , "Kim, Dongwon" , "Chang, Junxiao" , "dri-devel@lists.freedesktop.org" , Hugh Dickins , Peter Xu , "linux-mm@kvack.org" , Gerd Hoffmann , Mike Kravetz Subject: RE: [RFC v1 1/3] mm/mmu_notifier: Add a new notifier for mapping updates (new pages) Thread-Topic: [RFC v1 1/3] mm/mmu_notifier: Add a new notifier for mapping updates (new pages) Thread-Index: AQHZuVToVshy99YkkE2dGyNcPWpnjq/AWUSAgAGkBBCAAGFsAIAF9M/ggAChIwCAADi24IABSWKAgABl6ECAAEZHgIABcLAQgAD86oCAAQfUEIAEas2AgAGbU1CAANOWAIAAAN4AgAAASgCAAADJgIAAACaAgAAAiQCAAFefQIAACl6AgAICCrCAALzcgIAABQIAgADEKYCAAD264A== Date: Fri, 4 Aug 2023 06:39:22 +0000 Message-ID: References: <48f22686-2c1b-fd9d-91ba-da6105d410db@redhat.com> <3427735b-2a73-2df7-ebd9-0d1066a55771@redhat.com> <2aee6681-f756-9ace-74d8-2f1e1e7b3ae6@redhat.com> <87cz0364kx.fsf@nvdebian.thelocal> In-Reply-To: <87cz0364kx.fsf@nvdebian.thelocal> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA0PR11MB7185:EE_|CY5PR11MB6389:EE_ x-ms-office365-filtering-correlation-id: d3a670e0-3ea6-4542-10c7-08db94b589cd x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A9NIJLEyrioglCkdj5YgxeaugOMJMCBfz41vpthTTHemev0flZVPjjLHJj4F9fS9gQPSHRByWvEPh/gGlEmrGKLxRdv30wnaWnI8MxvSt6QkXc5wt5zIyrjAPF4Q6+f0w5EKbpTOgWWDpiXuh6FYQiJv/y5Nor1ZUKL3yenJCCty+PawpXBs/w3yGT91xQJ0ifd+aZmS3BcOPf/C7SExUkY+KiiO5xLGVb/8ydxHKVy8Gp/JqTtM6bKbvZNPxnkgpN5piKRtwbjWmqyZXVzCEztJGJEQ7jXJqD2POxvr0hyO+U2kUxUz2mB7MA8POWmJHYyXRSFWInqapLEHRPjInWxL+++eW+EZN5Fsx/yzmJimahOeGjDkyxOgZG9qk9vaerfRWDiUx/bgsCqinwlDla4lR6v3MHT1KwOn6DoE+3bosRlQUP4+WUowqtlcVD+mas4nnmDadeT7PWyxX6OwNly3p6wbD4yaj0Es3NN4p5LoV9jRDj/zvRyI/cGNewncyKSbrxfUeCMsa1qCvbaNzOiMsnLYAYIXGF+tewvazZpYas9KiDWFqPJQBxwmWSd7bzAuKBKtJ5xmgvEO5bEaqZTp78XfSl9Y8YYrfvC86zQ= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA0PR11MB7185.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(136003)(376002)(346002)(366004)(396003)(186006)(451199021)(1800799003)(7696005)(38070700005)(9686003)(966005)(86362001)(71200400001)(55016003)(6506007)(26005)(83380400001)(38100700002)(122000001)(82960400001)(33656002)(66556008)(66476007)(66446008)(64756008)(66946007)(4326008)(76116006)(2906002)(316002)(5660300002)(52536014)(15650500001)(41300700001)(8936002)(8676002)(478600001)(54906003)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?v494EVXa4bDpSrE0PQVEbLOhSob5aTiHgblCy0d+bbnsMMo6q+Z2DJdr3kB3?= =?us-ascii?Q?YpPMEKR0HAwPEn8hNUOC2+7FHK0qMSRXEON9PJVcapQxgP0HlbyxCUdUebpo?= =?us-ascii?Q?629b21mejVJXLgfXBrETtW0y+O3Si3vXi4+6wSVYy8xsNrllwFRdN1HqO/9x?= =?us-ascii?Q?0ADfmOgRRHDT4kZcoVUeygPr/esmRm0937bg348Fd5uk08JQpHSq3CiygYku?= =?us-ascii?Q?zHLKqC6HkqwWrKycPLAfbSuYSj6/DCArJY97PtAjkI8bM90jnyw1DB06ZO+l?= =?us-ascii?Q?S2LEYWJROQUr89Mj+CjKO1gS0+1gNe0j4Cwbfsrn8S7K2IuErhWpzFHB8F3i?= =?us-ascii?Q?q+tS7kpD8tsISslEqf1uR83UWykmYgR6S15POeiDxE+hkdxinH/rWGHgA4Xu?= =?us-ascii?Q?YR6JzrQOAA/u6SIcIhPoB4to9XIiJbS5LuJoh+ZqVS6St+1vC9MSymRP+qiI?= =?us-ascii?Q?ZlnbcBx/vRc6OqpMX1XGxDjMnBup9gSpJ5ugDUHCqpMX/PjEDXmT4huq8SVS?= =?us-ascii?Q?RQjhi+h7+eLG19mp0OtZdDSY5haydDACHUn+fMcwiSZli3g7zmpv8qzgVpPD?= =?us-ascii?Q?iZC1X1fBR6lqiKH6TMa7KArYDa40AAVj5FEpp2xGNNvQAbON5OeICe32FVQb?= =?us-ascii?Q?KQ0K53JELuwA0BE0Nt2AVBkcvoUnQMn6oSAbASOBo0d0yeBzXjRceXzWL3g6?= =?us-ascii?Q?0iZTLxHGLXJ22p2U8FVZ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text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA0PR11MB7185.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3a670e0-3ea6-4542-10c7-08db94b589cd X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2023 06:39:22.4429 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: iWQsbwH/rw25k6v8BVCMzyn83Se+wowX7tA76ro0F4xXzGzpWMVYePgM1EiuY+9wJEBx2jMPY3BNuU6+y2HKmAlRZP0Fh1/3sMX5WWeUZ3o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR11MB6389 X-OriginatorOrg: intel.com X-Rspamd-Queue-Id: 0C1E8160011 X-Rspam-User: X-Stat-Signature: jqi8n6nuiymt514fjbcm9ss6173sunui X-Rspamd-Server: rspam01 X-HE-Tag: 1691131167-773801 X-HE-Meta: U2FsdGVkX18yd4UVYtM4AxDaOoYGU5Ohahj+7XBsJHWch0IBa8DvKsJdjndsLEZFQW2HDsnFeeWE5Ym0V5iq5V2j3XYVgs//v0EHORbnX0rRDBO/O6jIoIEcLTI6fIDudbjuVqM0JWbRfR2jeB7LAVy/GJHNTsd/iXWGEEhAdETY3xNZ47j7NDhfeSc065HrNoiMsQ4jJaBgLYJIzAZevtcEX6YO257x6bezBXpO0hjsnW2vzQ6FNs6Ixv7lc008MFYZfF3+L66CeFNk/6Eh46l1v0GPee21Bt2FZaOUopWBU7zSnEw5rARmTu8JXPpN+4D2UOR2W0ZcW14IvQAHWh8QcEqC2Y+6GdE+avbnE0E/NI7vs6/UFTPhVu3I0rXCjqkd5/h5c6ClirimnSoOzIQRmeunXhReYBLGfuQZMlB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Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Alistair, David, Jason, > >>>>>> Right, the "the zero pages are changed into writable pages" in you= r > >>>>>> above comment just might not apply, because there won't be any > page > >>>>>> replacement (hopefully :) ). > >>>> > >>>>> If the page replacement does not happen when there are new writes > to the > >>>>> area where the hole previously existed, then would we still get an > >>>> invalidate > >>>>> when this happens? Is there any other way to get notified when the > zeroed > >>>>> page is written to if the invalidate does not get triggered? > >>>> > >>>> What David is saying is that memfd does not use the zero page > >>>> optimization for hole punches. Any access to the memory, including > >>>> read-only access through hmm_range_fault() will allocate unique > >>>> pages. Since there is no zero page and no zero-page replacement ther= e > >>>> is no issue with invalidations. > >> > >>> It looks like even with hmm_range_fault(), the invalidate does not ge= t > >>> triggered when the hole is refilled with new pages because of writes. > >>> This is probably because hmm_range_fault() does not fault in any page= s > >>> that get invalidated later when writes occur. > >> hmm_range_fault() returns the current content of the VMAs, or it > >> faults. If it returns pages then it came from one of these two places. > >> If your VMA is incoherent with what you are doing then you have > >> bigger > >> problems, or maybe you found a bug. >=20 > Note it will only fault in pages if HMM_PFN_REQ_FAULT is specified. You > are setting that however you aren't setting HMM_PFN_REQ_WRITE which is > what would trigger a fault to bring in the new pages. Does setting that > fix the issue you are seeing? No, adding HMM_PFN_REQ_WRITE still doesn't help in fixing the issue. Although, I do not have THP enabled (or built-in), shmem does not evict the pages after hole punch as noted in the comment in shmem_fallocate(): if ((u64)unmap_end > (u64)unmap_start) unmap_mapping_range(mapping, unmap_start, 1 + unmap_end - unmap_start, 0)= ; shmem_truncate_range(inode, offset, offset + len - 1); /* No need to unmap again: hole-punching leaves COWed pages= */ As a result, the pfn is still valid and the pte is pte_present() and pte_wr= ite(). This is the reason why adding in HMM_PFN_REQ_WRITE does not help; because, it fails the below condition in hmm_pte_need_fault(): if ((pfn_req_flags & HMM_PFN_REQ_WRITE) && !(cpu_flags & HMM_PFN_WRITE)) return HMM_NEED_FAULT | HMM_NEED_WRITE_FAULT; If I force it to read-fault or write-fault (by hacking hmm_pte_need_fault()= ), it gets indefinitely stuck in the do while loop in hmm_range_fault(). AFAIU, unless there is a way to fault-in zero pages (or any scratch pages) after hole punch that get invalidated because of writes, I do not see how using hmm_range_fault() can help with my use-case.=20 Thanks, Vivek >=20 > >>> The above log messages are seen immediately after the hole is punched= . > As > >>> you can see, hmm_range_fault() returns the pfns of old pages and not > zero > >>> pages. And, I see the below messages (with patch #2 in this series > applied) > >>> as the hole is refilled after writes: > >> I don't know what you are doing, but it is something wrong or you've > >> found a bug in the memfds. > > > > > > Maybe THP is involved? I recently had to dig that out for an internal > > discussion: > > > > "Currently when truncating shmem file, if the range is partial of THP > > (start or end is in the middle of THP), the pages actually will just ge= t > > cleared rather than being freed unless the range cover the whole THP. > > Even though all the subpages are truncated (randomly or sequentially), > > the THP may still be kept in page cache. This might be fine for some > > usecases which prefer preserving THP." > > > > My recollection is that this behavior was never changed. > > > > https://lore.kernel.org/all/1575420174-19171-1-git-send-email- > yang.shi@linux.alibaba.com/