Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6209044rwb; Wed, 18 Jan 2023 02:31:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXvcVVeLQw8eJab5qULURF7MX2kh1SAqtEPHy7r59Rce6gXnvS20fp28fSm85dWu3DSBNkku X-Received: by 2002:a05:6a20:9b99:b0:b7:4f67:c2de with SMTP id mr25-20020a056a209b9900b000b74f67c2demr6287174pzb.40.1674037868269; Wed, 18 Jan 2023 02:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674037868; cv=none; d=google.com; s=arc-20160816; b=oH76qzMOjd6hkQ6Rh6bYO6ztTBSsNfioDURE4FWACtZ0TYfHxZ2ukDgL4/FokFT1iR G0uuQ6lWOAH4+Xalwsvy6WV9m/VTDTJ5dMULf2yHRG0wjehP+3gmnhK7ov9q4D0FnCte ZemTpByQSaKYoJb4wOa9k7j6xD+XiGNiq0LUXaCwyo5pcD1xypdaKJmX/w4TIrO6Ecn5 WypS9RN9mxAiaEyt1/vzo8fGlX2EEKuqPekrtklzLU++Utxva1RAfPKa4Q6jGV4m59xN qVBnhX6K5HSmRzNBO4IEAnFxAmiIjoTCOC4dCh2+EZk6uRMx3XkRkeZeu5oC7HEftgWC K8hw== 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:dkim-signature; bh=c4jFt5CSjdtnMDLvsXCu/fyC50qdW3CP98LJCVII0A8=; b=tpw0JoLd5qtFU8UaTnDXq2qa5CtQX5a8t0U8rpUx28FNqjPOWlJ5SJM1I5U4UIAxkK 68WtugqABl0kuGGktz9jLMg5CW+f52roYyNk11EGFQa17a+AYha651j58U8qVgehhZyU tmMc4v1WlV5CHvMTQ2OM/D+lhjM4t5Na4UAyHv1dHII6jkq5CrAq2w9hNWdOzLhLLPWM u0ikXHLx4q/l47PT7cZPDMrP3FuSqJ3szuIdL6S4bsRCUrWiHhQqnJMyrLZjK/tyvMnH qkXhpPmZaARCTm/Rb7tfGvoWramdku6es5WGQVWCEdtC9TbcQlDfuQAeAMCkxN7XjPpl BsFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=d5MjKKHw; 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=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a635202000000b004978594b6desi34832460pgb.609.2023.01.18.02.31.02; Wed, 18 Jan 2023 02:31:08 -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=@suse.com header.s=susede1 header.b=d5MjKKHw; 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=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjARKRl (ORCPT + 45 others); Wed, 18 Jan 2023 05:17:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjARKQ3 (ORCPT ); Wed, 18 Jan 2023 05:16:29 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7306C474CC for ; Wed, 18 Jan 2023 01:23:42 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C12D237A41; Wed, 18 Jan 2023 09:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1674033820; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=c4jFt5CSjdtnMDLvsXCu/fyC50qdW3CP98LJCVII0A8=; b=d5MjKKHwyjWRuUoQdFCQiQaKS/JlY/J94I3M2WBvbAmveiTWcDYJRvgsQn3QP1DbIS8h86 2MLS3tC4LCpGJZ/GhBlu/WwSnutZqfichRjG6EWfHMez2Ot67t008SDi5qbZV1Wnj5Iuop QqMNgkJvwaIxblG6TubYXrpPvSmURnY= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 7B41A139D2; Wed, 18 Jan 2023 09:23:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EA6cHZq6x2NjNQAAMHmgww (envelope-from ); Wed, 18 Jan 2023 09:23:38 +0000 Date: Wed, 18 Jan 2023 10:23:34 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: akpm@linux-foundation.org, michel@lespinasse.org, jglisse@google.com, vbabka@suse.cz, hannes@cmpxchg.org, mgorman@techsingularity.net, dave@stgolabs.net, willy@infradead.org, liam.howlett@oracle.com, peterz@infradead.org, ldufour@linux.ibm.com, laurent.dufour@fr.ibm.com, paulmck@kernel.org, luto@kernel.org, songliubraving@fb.com, peterx@redhat.com, david@redhat.com, dhowells@redhat.com, hughd@google.com, bigeasy@linutronix.de, kent.overstreet@linux.dev, punit.agrawal@bytedance.com, lstoakes@gmail.com, peterjung1337@gmail.com, rientjes@google.com, axelrasmussen@google.com, joelaf@google.com, minchan@google.com, jannh@google.com, shakeelb@google.com, tatashin@google.com, edumazet@google.com, gthelen@google.com, gurua@google.com, arjunroy@google.com, soheil@google.com, hughlynch@google.com, leewalsh@google.com, posk@google.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-kernel@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 17/41] mm/mmap: move VMA locking before anon_vma_lock_write call Message-ID: References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-18-surenb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Tue 17-01-23 18:01:01, Suren Baghdasaryan wrote: > On Tue, Jan 17, 2023 at 7:16 AM Michal Hocko wrote: > > > > On Mon 09-01-23 12:53:12, Suren Baghdasaryan wrote: > > > Move VMA flag modification (which now implies VMA locking) before > > > anon_vma_lock_write to match the locking order of page fault handler. > > > > Does this changelog assumes per vma locking in the #PF? > > Hmm, you are right. Page fault handlers do not use per-vma locks yet > but the changelog already talks about that. Maybe I should change it > to simply: > ``` > Move VMA flag modification (which now implies VMA locking) before > vma_adjust_trans_huge() to ensure the modifications are done after VMA > has been locked. Because .... Withtout that additional reasonaning it is not really clear why that is needed and seems arbitrary. -- Michal Hocko SUSE Labs