Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5367093rwb; Tue, 17 Jan 2023 12:45:25 -0800 (PST) X-Google-Smtp-Source: AMrXdXuuqFqmMJO3MG2lUWRqKDUtEec8ROjtjbt6vGw1PelG8XtbsDZ6FfGboFlll1+NpB2blUpU X-Received: by 2002:a17:906:eb8e:b0:871:6b9d:dbc with SMTP id mh14-20020a170906eb8e00b008716b9d0dbcmr4378865ejb.21.1673988325631; Tue, 17 Jan 2023 12:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673988325; cv=none; d=google.com; s=arc-20160816; b=0w6H4llrojv0YRtP7JPBbfaPerFYQ/FAeDxY2cZbw94UH2KVXom4SucftOk1oHaNNC Ch+6iMwLRchD30YTWWThyv0qmMdGUlQpRwl0Co94P9xOt+hN1qUHN25AD5KLuOoJJCZu yzXrh1DxZIZ06mWbwiIZy/a/AVmJijf2QcCsmv+kUDZBpQk/dfGOCauMhGxZQ1eLXj8w m9ZD41dC0ed4fWZNO69zXg5pgSxmA3W96k1eJgcJwUy9G6cG4s+fr2NgowISYeGCHHAU Pg4nbvKETTBhuOLWSLHNe+Cys1+7LKJjm9q/pWlrh5bCAjoOY9CvBFcU43R6nUn8byRl huPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nO2TVNnVOIEJ9cBerRh0wJxo05XQ3/3OZ+JFJTzT4f4=; b=htkOoqJjSBReFX4h0uY+Ntu5AWZhalDneCrySg4CAg+Lml+4sRIFhLYTiRZUNQHWu+ teWOLosPxIABSGuM2QDXOREefaTIFC6ZfDJMOXr/SZF5WpEn9Kw3xxQiCowu97nSeJ8g pIWBbSzOONpcbDOSr8s59DsIidkrFtxVxst+p5Upy5mhd93+97es9k9NhO1Onan6Bv0O sM3FnmGKdsXZ5prKoZZeby+hU4J7h91I9yxlGJaAETxG/z6Fd+MR5nuMk/kHo8vVR2N7 r5BJQdCLTHaJA8fpU0d+8OK1illtfQozD8VN70/AXvzRdXNBSKryZDZjEPQRJaY8LuMt xrJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Tw6Xp7D6; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp26-20020a1709073e1a00b0086b9409d5e8si15458708ejc.360.2023.01.17.12.45.13; Tue, 17 Jan 2023 12:45:25 -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=@gmail.com header.s=20210112 header.b=Tw6Xp7D6; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbjAQUJH (ORCPT + 47 others); Tue, 17 Jan 2023 15:09:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233191AbjAQUG2 (ORCPT ); Tue, 17 Jan 2023 15:06:28 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B53C0442EC for ; Tue, 17 Jan 2023 10:57:59 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id b17so26989565pld.7 for ; Tue, 17 Jan 2023 10:57:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nO2TVNnVOIEJ9cBerRh0wJxo05XQ3/3OZ+JFJTzT4f4=; b=Tw6Xp7D6tk8hzI32VYz9Sh4oZnfuZnHqsPMkI862wFRDvLRDkgYIRiWG2SUrB03U5R kSRXWoIa6OM7sBGA2XPn0IpcvSAtl79c0VbYh4UiPJcEZbb9YDLc+fE4O25L4H6ucx3b l1MnrlA++X2c1GCtCN4KiQ4phthqiXm5RJ3vviCtHTSHZNYjBdNxPUaUEZMZGwTGOALj 2x4+O5smSfd0PmewOUe80sYtMLFAbU46lkGlCA6NjckPm7q1V9IZTocrP8Ai4OKgEVTC bcV5uqogLcSpcr+ZFXX6PO2oaF7HZUvHZtMw2AhcaP6H0+A0BAtmhnlMbv8scDWieuUe H/OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nO2TVNnVOIEJ9cBerRh0wJxo05XQ3/3OZ+JFJTzT4f4=; b=wBIAcAetnwFdcBSPaJJvwNnNxb4H7DOsOgvPk1bzbroTiseyf+Np9ZAsVDd5dxmNnt EbuuAfake9udn7RW7JBkJbZ8B7Ui8K1uwoorLahFLAvHFjq3l8lot/ZhOSXFzwK6/Nme ytwvPN4rXYViiab+itMkUQd1Zzh9BomW0CMmGqbUnZ+vemPxzWG7WlJEOg2g/QkkSlVU b6NLzbyQQpWnAdX9hc/pZhwHS3pyOGFnfkmvtk50+YcB8y70MKRwv5EIkn3dbxR5L4Kx un6AZBzL9ZJDPzLcPnmSH7bHdM3ga+7YHngzAEBiQMO8d4nNh0LjtQ8Bjn+5khPD+282 gK4A== X-Gm-Message-State: AFqh2koM9cMQUPdJucfkbx3SktXZuuB8R4NYaipAo8CGwVziVyF58BIn twffNbI6DL5VmqO8JFepQ03nSoOsZZlBJanh5eE= X-Received: by 2002:a17:90a:2807:b0:219:f1a2:b641 with SMTP id e7-20020a17090a280700b00219f1a2b641mr364645pjd.97.1673981878643; Tue, 17 Jan 2023 10:57:58 -0800 (PST) MIME-Version: 1.0 References: <20230111133351.807024-1-jannh@google.com> <20230112085649.gvriasb2t5xwmxkm@box.shutemov.name> <20230115190654.mehtlyz2rxtg34sl@box.shutemov.name> In-Reply-To: <20230115190654.mehtlyz2rxtg34sl@box.shutemov.name> From: Yang Shi Date: Tue, 17 Jan 2023 10:57:47 -0800 Message-ID: Subject: Re: [PATCH] mm/khugepaged: Fix ->anon_vma race To: "Kirill A. Shutemov" Cc: Jann Horn , Andrew Morton , linux-mm@kvack.org, "Kirill A. Shutemov" , "Zach O'Keefe" , linux-kernel@vger.kernel.org, David Hildenbrand Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Sun, Jan 15, 2023 at 11:07 AM Kirill A. Shutemov wrote: > > On Fri, Jan 13, 2023 at 08:28:59PM +0100, Jann Horn wrote: > > No, that lockdep assert has to be there. Page table traversal is > > allowed under any one of the mmap lock, the anon_vma lock (if the VMA > > is associated with an anon_vma), and the mapping lock (if the VMA is > > associated with a mapping); and so to be able to remove page tables, > > we must hold all three of them. > > Okay, that's fair. I agree with the patch now. Maybe adjust the commit > message a bit? Yeah, the explanation makes sense to me too. Reviewed-by: Yang Shi > > Anyway: > > Acked-by: Kirill A. Shutemov > > BTW, I've noticied that you recently added tlb_remove_table_sync_one(). > I'm not sure why it is needed. Why IPI in pmdp_collapse_flush() in not > good enough to serialize against GUP fast? > > -- > Kiryl Shutsemau / Kirill A. Shutemov