Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9797396rwl; Wed, 11 Jan 2023 10:04:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXvAGF2l/878zDEyN5k6XobkSeJgYuQnfH/qo9YEmVqR0kNid2bhP4EydIrPOnCue2K+a54J X-Received: by 2002:a05:6a21:998a:b0:b0:1aa9:25bb with SMTP id ve10-20020a056a21998a00b000b01aa925bbmr112003122pzb.60.1673460271004; Wed, 11 Jan 2023 10:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673460270; cv=none; d=google.com; s=arc-20160816; b=n/oBFSn38W1GMCXNOOeSNp8soWhPkXt6xS8QtOt1G5m8F+GJ619UL2JDkb/nD2Botz qA4lto60kkSew1Rm+kaIjFkjGjTNf48XTSm1LRCgTk5x6KZPLLc1KSPU51rbeNKLowNA tCam6PbDK3Exl/Au8+1zfqufcAHDZKoINvdvIR5JOEDvJ/zrRsxaZ5WTHF+kXSLtSwU8 INstCvABhtmJyTWcBEkbKiiR8LGojHKON/6ZiAaMtdcYfs5SSNW2uzNcbmGTzPp766Kc P353z2eFoF74MoitRF/xxn8cPQWhQ7Fc7YVGSYeUbxpOh4ndGVJpJGOQEEpeyU2+HkH/ 4dxQ== 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=ePKFgxTY+N2/lJawjZfA8T7NwNNbVvAEDKDS+DodhcA=; b=jsLalyC10d6hBxZZn2hWjKO4SyYjiURoPTeT/Y88Fojk3029oFunaqdFy8tzWKKodo FbSrlLYUhzwUEqdulbLrWjlQ0V3Yu86PF1QZmqbq4oFmNiw9LThPc1a/zJI6ldCqr8bo Q7uF5qY3xUxaW8GL5ssLbyR2MOx9oAuQud0Pwm5M/WNh8+W2OD6LlFZGwYGbUcEK0w76 WngBkG8scTG6x+WWcS97gK43ikeQRh5NRxKkD/zOZZx/Vyq3IoQRti/7+GXvutpdzmjC F5hFBN7BJKatQ6w10SeNEzWTcPwSlD3L93tvoceS1Tlihx8FM76mAkwpEtKDL3tUaQpG ogPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oGppCfJz; 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 i190-20020a6387c7000000b004782c6e304bsi4849287pge.256.2023.01.11.10.04.24; Wed, 11 Jan 2023 10:04:30 -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=oGppCfJz; 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 S231511AbjAKRtb (ORCPT + 51 others); Wed, 11 Jan 2023 12:49:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232376AbjAKRtV (ORCPT ); Wed, 11 Jan 2023 12:49:21 -0500 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3231262D4 for ; Wed, 11 Jan 2023 09:49:21 -0800 (PST) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-4b718cab0e4so205128107b3.9 for ; Wed, 11 Jan 2023 09:49:21 -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=ePKFgxTY+N2/lJawjZfA8T7NwNNbVvAEDKDS+DodhcA=; b=oGppCfJz0FFp5Y7cMmyBjVC+6IJyztjkXrGbuY9sKKHCI8eMmhM/7O2McEjp6gADmb +V0NeF2kWF2Nwx3q9gWsm+nYAZhClko9G/+1YL3Na6XbuL8eK6Mt2K1h5TrUYNL0gjZj EdKTPpbii1X0xYEnTvCQabouks/frlB8HMIKJNjssTNM0vareCnqE5qN+nZhpNCV2op3 vHTLk1IVN7BpUvGL+T4ErN0fFl3kMEblGRpIp40HU1gf3C0N2si3drvDv1CfDZFLItf8 1vJX689W9VLjkDAY6yF+wPxZNPjwU2oyoT1WYSGmqbPzVRb6IwqfBJ9W1QC0Fo04OXv2 /HDA== 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=ePKFgxTY+N2/lJawjZfA8T7NwNNbVvAEDKDS+DodhcA=; b=25K39Y+NPtPZnfyyHyePm1Y31ZCQOekllwQAUTjCbc8EAJAehYO+9d1cwLmfL/GoKP SrZnSdSPJklN09ggUdVAQc7Fj6s0yHYTy95FSCi0UbdIDZ8RfwuYQ362gLDOqlzp2BlZ TQ0C/Yt3O7PfggROcEXjp6R+8ZZaYhwVh9rPyXnChgQpsOoq/UfWMZHmm0kuPDq6gnJQ C3e1FDOjma7gdYLpebj7R6HDsJVwCW3Q6aFcC3QPhql3yU15NZoYPIevCMOO4k7CCQqJ xoISyUAt9sZzCaEHLvYJFT98wFKdzSLkQTHNeEy9aop2a7jiNM9SKcfGI98yfCtVJmfz XVhg== X-Gm-Message-State: AFqh2krP1GJyozUD0CBd+O25cmG9QhKmTyFdwMRghfs2EJPUG3AVS5pq 9yONZ8jMjHx2VgFBhnFLfCS/qMDyzNSaQgCM4Yx9WQ== X-Received: by 2002:a0d:c2c5:0:b0:433:f1c0:3f1c with SMTP id e188-20020a0dc2c5000000b00433f1c03f1cmr1980213ywd.438.1673459360046; Wed, 11 Jan 2023 09:49:20 -0800 (PST) MIME-Version: 1.0 References: <20230109205336.3665937-1-surenb@google.com> <20230109205336.3665937-9-surenb@google.com> <20230111001331.cxdeh52vvta6ok2p@offworld> <6be809f5554a4faaa22c287ba4224bd0@AcuMS.aculab.com> In-Reply-To: From: Suren Baghdasaryan Date: Wed, 11 Jan 2023 09:49:08 -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 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. > > -- > Michal Hocko > SUSE Labs