Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp90741rwb; Thu, 12 Jan 2023 16:28:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXvyWxaKNQYEU+r++iFkkn7GBCC0d7Cc4hWRzmtewTGsDEC8KOxYuQw2NlHZlgOEQTsOy//G X-Received: by 2002:aa7:d596:0:b0:49b:b274:b815 with SMTP id r22-20020aa7d596000000b0049bb274b815mr2330051edq.39.1673569709368; Thu, 12 Jan 2023 16:28:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673569709; cv=none; d=google.com; s=arc-20160816; b=cm/go54UULKE2T4oej4NY2is6hxvxFuPxuRBIm5sxqNIbuygVD9evf8x8kfYmTwMw7 G+Axu8v3ltbmO7mxEdKvBP6dqedjJPCWPl4n562EupCkeHfn6WWT7yo7M2kc+MyBu319 iYPMft+oKI6EiyIuJX3qr9xIKRxT5QaqCUXkjer+DlimyoOxjU7rdBVNrutp3OPeaNf+ BvYqhx8fyIlxDQHPbz8B9lE4+Xg0RTSugxeWP3S3a/VEgPo8xhB1y3D4MOA+4yLM/u+H gwDK8i1raKsFxM0SvBPOFTQo7q6QcjQtWzI7JSKpc3P5ab3qTWM+TMz518DaRdooSAZz 7pUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=fn0w1gSR5DhOV6wrzetzvqJJjGA7awX0sZ7gHK1BH/Q=; b=bZ50xIuYPV3WIZvkXhTCq2mExeKQ2MDbeMCFVQomVIEGXrYSgX7OE2w7bKgqUvOVIA bC6zZ4/v8p4s8ABVrOPDmAdUVUtIXFH5hbWKPHe4ycMxMgimwNr0/bq2iMnuOlPUW7mu 65JxXRoqS9D8/Lf74OqSiIxI76GJq+nQzr549jjKMqZq3D8t1jYQkNXB/RUHtdUkpbzh hHD5jSdyv3xJFwFPIjde1Cr+5w0ZvsWX4U7R4SPOksItmENR5/5zMHWvIc/qC8j9SY9j PrOZYP2OXzVWqraATmhCXgvhwQUMU+cb+pI7KwFRk/800IPUHVCnVzKdbD3E2GpQB/Xf 7WWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b=BOQJnOfN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NxQbSwT5; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a50fb87000000b0048c68e201desi18018887edq.555.2023.01.12.16.27.49; Thu, 12 Jan 2023 16:28:29 -0800 (PST) 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=@shutemov.name header.s=fm1 header.b=BOQJnOfN; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=NxQbSwT5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232215AbjAMAKu (ORCPT + 50 others); Thu, 12 Jan 2023 19:10:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234031AbjAMAKn (ORCPT ); Thu, 12 Jan 2023 19:10:43 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9568940861 for ; Thu, 12 Jan 2023 16:10:42 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 70A385C00B3; Thu, 12 Jan 2023 19:10:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 12 Jan 2023 19:10:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1673568641; x=1673655041; bh=fn 0w1gSR5DhOV6wrzetzvqJJjGA7awX0sZ7gHK1BH/Q=; b=BOQJnOfNbZsiA95+o3 xdZp6MCLdZMTzaocrB/0UyDRkcLXi2xkFD+lY3uxivC2pJHdwZnpZbMHopjBUctM va9SelUa/2dVs5ZaC9r0/7WOB/xEO8q7UWYWM9Sts5uZf2METrizVXRk1UmX0OKq KMfqBKfcwtu07lSxbWZmkTFLRcR6//ie5VHE0j3AajqFbBoGAGS1av0y0zY6pi4X HqdD5kfK49pqlQZNPhP3EEgu902A/YHmfIGnyrK7SiZsa/w2o3Sa/Skz6IMiohXq dC6ynx8kGIxbu9JFKniXYEagxl4Z4jgquvJAxWkCXKoutKk3Lou9v1nrSFoiT8D/ n5dQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1673568641; x=1673655041; bh=fn0w1gSR5DhOV6wrzetzvqJJjGA7 awX0sZ7gHK1BH/Q=; b=NxQbSwT50YVM8JGTH5Qf66/uZGD2RRXtclEucb+pKHpl fm56sVIj2nBPUx+COUD9Z9dmUB+0eEqJE7rtgeoJn28o9KB3IuBG78bUeny7qR1s WWQoAKuLA34GRXrg2mB9taMeyF5OwuaG516xD8QmzzbL1z+btfskDyvrU43vjJdU FxsRIASkAuQ7VuWUQsbncf2B2G10UexkJ28wbIhJbrt6VLJVgbaAhxUeKBOUALAd NalTKsxHEoEr39NcKu27rzeAfjWNUt3vVPCMrPtz8IYb4VlICIcHe9zrss6E/6Jv n6xG6pXg9G70yoxZj5JbIJ+ZYcKNr3LUIPJwcQzsUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleejgddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttddttddttddvnecuhfhrohhmpedfmfhirhhi lhhlucetrdcuufhhuhhtvghmohhvfdcuoehkihhrihhllhesshhhuhhtvghmohhvrdhnrg hmvgeqnecuggftrfgrthhtvghrnhephfeigefhtdefhedtfedthefghedutddvueehtedt tdehjeeukeejgeeuiedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepkhhirhhilhhlsehshhhuthgvmhhovhdrnhgrmhgv X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 19:10:40 -0500 (EST) Received: by box.shutemov.name (Postfix, from userid 1000) id A6A84109AF0; Fri, 13 Jan 2023 03:10:37 +0300 (+03) Date: Fri, 13 Jan 2023 03:10:37 +0300 From: "Kirill A. Shutemov" To: Yang Shi Cc: Jann Horn , Andrew Morton , linux-mm@kvack.org, "Kirill A. Shutemov" , Zach O'Keefe , linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH] mm/khugepaged: Fix ->anon_vma race Message-ID: <20230113001037.adqha6lxj7lh75at@box.shutemov.name> References: <20230111133351.807024-1-jannh@google.com> <20230112085649.gvriasb2t5xwmxkm@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Thu, Jan 12, 2023 at 10:12:53AM -0800, Yang Shi wrote: > > This is totally wrong direction. Or I don't understand the race. > > > > At this point we already paid nearly all price of of pagetable retraction. > > I don't see any correctness reason to stop here, except for the assert. > > Isn't it possible that collapse_and_free_pmd() clear the pmd which may > point to a PTE which maps the COW'ed anon page if this race happens? No. At this point we have huge page in the place in the page cache and it is locked. COW fault would serialize on the page lock. -- Kiryl Shutsemau / Kirill A. Shutemov