Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9806236rwl; Wed, 11 Jan 2023 10:11:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXuusNKPrdtOASfAOO/kqEbH2XP3qNRZJYuqfwfI/vytRrooAOZBubqeAxTOxCGjOOFyrW3b X-Received: by 2002:a17:906:4892:b0:84d:489b:f1b1 with SMTP id v18-20020a170906489200b0084d489bf1b1mr10569488ejq.75.1673460664928; Wed, 11 Jan 2023 10:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673460664; cv=none; d=google.com; s=arc-20160816; b=hUCueVox2rtlx3us7u6QheM06Q06INvFwbxZkU50X786S4i0mIF7+okOTgMsJnkSUd j5tuInuMXwwgCfcwgYjMAY4/nphjsI1us4Yk18hd1MfepqZa5z4wvDLZxpy8IdWoyBeh g3dGo/fVVsw1Hj2l+sUpbhGddyr+C1vV8ppbyXCLnn99vIJ0DHhxVDZHgU751exAr95K lGdH/i3ePidxMTkM82euzBMGDnOoFdSLVg0d2u9rhqdhCnif3UX4375BmN+leXaPQBi3 N9Ga9RRgCFZiBBdMV11Ih/61TmfLbNA7nETt+5yQwg1KEH1nFgDezv5MnDgPfqrwnDVi cWcg== 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=bbHjv8f4G8yVHoUHU7VHjKcNPXbqT19MIbDP7lW2Ypw=; b=YBGePfsuqAITKzOncoAq7nh1bqaJgu9ZTDdcdLom6R1Kq+Mqv9KXgNonc3dpi8HdVE tgaXQYFOvlcIlmTN1wJHu21FkF4awTrRwTeJQn2HO1VX4L28L1ZF7LJjJBf7JDVxmudJ /IkO3YS4CZRIe/lNeIG0gRPrn1ZYJz1h6VYNOiTl3SMADO2l/aZYdSsXcjmXPDLI9igi U9enezqs3ZqbKChI/xJz1U1EWHRTpML5dTwhjy5oQN18yUXBhM7koIfYV1nwftDBt1Iu 748lqNLNM9Og7assJbupadQqgxHaSuNut9flGznygSnvq+8EJ9IFKat3NYG9FplsBlSf B0CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=AH95UKrz; 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 y13-20020a50eb0d000000b0047338d1bfcfsi15015098edp.166.2023.01.11.10.10.52; Wed, 11 Jan 2023 10:11:04 -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=AH95UKrz; 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 S234484AbjAKSDU (ORCPT + 51 others); Wed, 11 Jan 2023 13:03:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234376AbjAKSDQ (ORCPT ); Wed, 11 Jan 2023 13:03:16 -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 976B015FC6 for ; Wed, 11 Jan 2023 10:03:14 -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 C4EC033A99; Wed, 11 Jan 2023 18:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1673460180; 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=bbHjv8f4G8yVHoUHU7VHjKcNPXbqT19MIbDP7lW2Ypw=; b=AH95UKrzJ1Zliz+zgEejEfNeedAWYpcTW4dL6WRZ4YuKSDpRhdJmRAgphp/BNidqkNZSdS n3efqyXjohG1QoWVwbLTiaMNcMXlfZ2q2fSgmImd3a+aspnHBzE78VhzTqh/A/s5Dz0f4s gTF0p1am8yTAw6I0wEVbjPDtyvfku3M= 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 98C9C1358A; Wed, 11 Jan 2023 18:03:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /ULTJNT5vmMBBgAAMHmgww (envelope-from ); Wed, 11 Jan 2023 18:03:00 +0000 Date: Wed, 11 Jan 2023 19:02:59 +0100 From: Michal Hocko To: Suren Baghdasaryan Cc: David Laight , Ingo Molnar , "michel@lespinasse.org" , "joelaf@google.com" , "songliubraving@fb.com" , "leewalsh@google.com" , "david@redhat.com" , "peterz@infradead.org" , "bigeasy@linutronix.de" , "peterx@redhat.com" , "dhowells@redhat.com" , "linux-mm@kvack.org" , "edumazet@google.com" , "jglisse@google.com" , "punit.agrawal@bytedance.com" , "arjunroy@google.com" , "minchan@google.com" , "x86@kernel.org" , "hughd@google.com" , "willy@infradead.org" , "gurua@google.com" , "laurent.dufour@fr.ibm.com" , "linux-arm-kernel@lists.infradead.org" , "rientjes@google.com" , "axelrasmussen@google.com" , "kernel-team@android.com" , "soheil@google.com" , "paulmck@kernel.org" , "jannh@google.com" , "liam.howlett@oracle.com" , "shakeelb@google.com" , "luto@kernel.org" , "gthelen@google.com" , "ldufour@linux.ibm.com" , "vbabka@suse.cz" , "posk@google.com" , "lstoakes@gmail.com" , "peterjung1337@gmail.com" , "linuxppc-dev@lists.ozlabs.org" , "kent.overstreet@linux.dev" , "hughlynch@google.com" , "linux-kernel@vger.kernel.org" , "hannes@cmpxchg.org" , "akpm@linux-foundation.org" , "tatashin@google.com" Subject: Re: [PATCH 08/41] mm: introduce CONFIG_PER_VMA_LOCK Message-ID: References: <20230111001331.cxdeh52vvta6ok2p@offworld> <6be809f5554a4faaa22c287ba4224bd0@AcuMS.aculab.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 Wed 11-01-23 09:49:08, Suren Baghdasaryan wrote: > On Wed, Jan 11, 2023 at 9:37 AM Michal Hocko wrote: > > > > On Wed 11-01-23 09:04:41, Suren Baghdasaryan wrote: > > > On Wed, Jan 11, 2023 at 8:44 AM Michal Hocko wrote: > > > > > > > > On Wed 11-01-23 08:28:49, Suren Baghdasaryan wrote: > > > > [...] > > > > > Anyhow. Sounds like the overhead of the current design is small enough > > > > > to remove CONFIG_PER_VMA_LOCK and let it depend only on architecture > > > > > support? > > > > > > > > Yes. Further optimizations can be done on top. Let's not over optimize > > > > at this stage. > > > > > > Sure, I won't optimize any further. > > > Just to expand on your question. Original design would be problematic > > > for embedded systems like Android. It notoriously has a high number of > > > VMAs due to anonymous VMAs being named, which prevents them from > > > merging. > > > > What is the usual number of VMAs in that environment? > > I've seen some games which had over 4000 VMAs but that's on the upper > side. In my calculations I used 40000 VMAs as a ballpark number and > rough calculations before size optimization would increase memory > consumption by ~2M (depending on the lock placement in vm_area_struct > it would vary a bit). In Android, the performance team flags any > change that exceeds 500KB, so it would raise questions. Thanks, that is a useful information! This is just slightly off-topic but I ak wondering how much memory those vma names consume. Are there that many unique names or they just happen to be alternating so that neighboring ones tend to be different. -- Michal Hocko SUSE Labs