Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9881006rwl; Wed, 11 Jan 2023 11:15:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvL0AqHYkjvGGVXPVg4vPRjCfHKuwoUKawJHLvcDHQvwUy4/6oJl5zwEjM/XGz3k2O0h0Z X-Received: by 2002:a17:907:d602:b0:7c1:286a:d87c with SMTP id wd2-20020a170907d60200b007c1286ad87cmr63095369ejc.65.1673464540215; Wed, 11 Jan 2023 11:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673464540; cv=none; d=google.com; s=arc-20160816; b=uxeVlnyqQPak3LC2yEPn3/polrUWduICA3BS6cvumTHMPiGLfJFwVmyKxZ1eLupO39 jRM8DHzDTo0L0ovYnnL5tL/EFkxIFVFLN2lZ/uro4gA06SkK10/0Ad6F1jg7D+W0OwJA hLzH3/saQThPAUwqCELlCOP3z+lUYjCrChS7m3MxeHS2sj47usUZNX1ZyfHdgGXkOeWw gcHb/bR75fej6A4SirMeqcOhysaaViSUqAl+X881rBKtSf9uzNu8LIOhUeTyLCKE0jMa +yzrAOXUwZsICb7lOVTAd08reHzApXvth7EBlXd0gPrTU08E1Ql99hQbzmF3iScVUGCC u4og== 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=iomA/DdOkukhTJhxYBQfTOfPoKyivfir9Hw2gJoSeQE=; b=DwTpRwM2GcTCfePJ3ajxXePaXuKu1HcNnyZCuqiArzlwvm2bMWiKZv62rsobZDw7IZ 85hq9VtCgc73Co1JBRT8IH5NrSkyZRtvKYoBZIxaakENx77ZQiffI6f/Y/MlK/Q/J8Nq UV8dQwTtxsi/KdDbE/9Z0akb9ER583DtQMhIxIqQi8GFZitPSrJCKo1v5RbtkXsojkCv 5T8cvdpMpSlJCrhvIc/vs3Kz0XenzZ/uwmt+ZN1k6hYhQ9NeevJ1AMDRxVaiCU+Lf1Xx 1E9u2HwQnXAyOUgrQ5FhqupgoKpyu3108odSup24CSuXTzQqdTy7LoWu2nyyIvxjAcTW 1tJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ehL+TKq2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q36-20020a05640224a400b004608c0b9a8asi15221223eda.201.2023.01.11.11.15.27; Wed, 11 Jan 2023 11:15:40 -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=@google.com header.s=20210112 header.b=ehL+TKq2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235186AbjAKSJ7 (ORCPT + 51 others); Wed, 11 Jan 2023 13:09:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235237AbjAKSJp (ORCPT ); Wed, 11 Jan 2023 13:09:45 -0500 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5352A1C903 for ; Wed, 11 Jan 2023 10:09:30 -0800 (PST) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-4c24993965eso199604307b3.12 for ; Wed, 11 Jan 2023 10:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.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=iomA/DdOkukhTJhxYBQfTOfPoKyivfir9Hw2gJoSeQE=; b=ehL+TKq2EC+02HvyYu6sEKiG9SD6ek6ucjPX//rURNDpZ5idjUh8CPW14AGwdkNBY8 8uzkY4yeR21NTIObuKmC4ZQ12pTIsa+ucKG7daPW2N86Wm3+n3WQWc6WkyuiCl59Pn/m K12G5nt8vxcQqw5MTCMEW+oF4OsYz/Q7BWq1vCBWyyKMGFzP8CRV8iHgXNxo3anny93k Lu2L+/T04fv5UnsMStOc8aHZBXjXyei/GuuGUbeFRxLgVcoKezz8uROOa/7N1O3ssR8j rz8Uz+J8bTAdB5re3+nV12ZTRZGZXy6GBlIEZAWbU0iWX6TM+PpYIYdEyapMy1tx2B+P pxbQ== 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=iomA/DdOkukhTJhxYBQfTOfPoKyivfir9Hw2gJoSeQE=; b=EgTRPo3pPisDJugtzs62zFyxPzZQleR0DuZwbIyAwTwor4Cj1vwZMcYwS6AFQ41Eou 8BddyUqbfcQ8K68dEONkrNRFwd+2WwQaO3ZlRq5DH8BcFbtmpNjHx/3fYsxJYu7nyaUo zS32VPGc8HcqwGbTz5qGT5orupZITHeWdmXWTg/sqhWSaAsC8JKuVi1sNcgyFjJu/nrn soYoRuQZck4hgDJHTJ+OVFeIqD8pqpsZ9/DnvX20AvF3k7FPcAIunrJUz4SQIok4JjHJ 8TGO618+J613O8TfiEGRBlXzgOVhCibn3shex6AgZ5N+kE/6sNdH0mQVjUIGbCVItry2 uZsQ== X-Gm-Message-State: AFqh2kouVRBei5v8CqEZ7tVl/0TyTveiUpcbWvk0TDDTY6ZQTFYzQOdD VD10zvkXbqkyFBaoTpCuN04zyFqvJSNdrM7fi7r8cQ== X-Received: by 2002:a0d:c2c5:0:b0:433:f1c0:3f1c with SMTP id e188-20020a0dc2c5000000b00433f1c03f1cmr1989276ywd.438.1673460569225; Wed, 11 Jan 2023 10:09:29 -0800 (PST) MIME-Version: 1.0 References: <20230111001331.cxdeh52vvta6ok2p@offworld> <6be809f5554a4faaa22c287ba4224bd0@AcuMS.aculab.com> In-Reply-To: From: Suren Baghdasaryan Date: Wed, 11 Jan 2023 10:09:18 -0800 Message-ID: Subject: Re: [PATCH 08/41] mm: introduce CONFIG_PER_VMA_LOCK To: Michal Hocko 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" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Jan 11, 2023 at 10:03 AM Michal Hocko wrote: > > 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. Good question. I don't have the ready answer to that but will try to collect some stats. I know that many names are standardized but haven't looked at how they are distributed in the address space. Will followup once I collect the data. Thanks, Suren. > -- > Michal Hocko > SUSE Labs