From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D1D4C433F5 for ; Wed, 6 Oct 2021 15:02:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA97F60FDC for ; Wed, 6 Oct 2021 15:02:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BA97F60FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 54506900002; Wed, 6 Oct 2021 11:02:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CD7F6B0071; Wed, 6 Oct 2021 11:02:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34761900002; Wed, 6 Oct 2021 11:02:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id 1E52F6B006C for ; Wed, 6 Oct 2021 11:02:09 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CE14F8249980 for ; Wed, 6 Oct 2021 15:02:08 +0000 (UTC) X-FDA: 78666327936.33.51E1A43 Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by imf03.hostedemail.com (Postfix) with ESMTP id 7DCD43000B53 for ; Wed, 6 Oct 2021 15:02:08 +0000 (UTC) Received: by mail-yb1-f182.google.com with SMTP id g6so6146717ybb.3 for ; Wed, 06 Oct 2021 08:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MzEyLfp/eaHfYFCvoWfOxrcj4KYXSDgQLbhw8YX+9RQ=; b=ta783nvpkwKOOuucrK44IRRZ9hsio5xXDjvuB9yPa0HD0qE19p3Q4KAilwYpao2Q1n /nNINPBvLQE6n0Mjih3w+sAS+eNMP0JqJynoUtkoX3L8FnPZ6D909MtUhWc0x1lqIwKr I75rTIamcY3eF7Zn2h7FYdOKahWN6t0lE2WxcbNT3KPeSXoG9FnXjf4zkYEVH8bdehPD AES4Z8OtqtuO0iGM7ej/L8A3TQn3beFpQ+dLiQlBnMalAJDGX0ac669Mqpjv94Xxb8oX ldmGzRMon9eDT7CoGa6HBE1/ZEcLnn8xoWaZW6Jx3Ln4YtFCGcJ4lJfPw8yndXkoqCt5 UGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MzEyLfp/eaHfYFCvoWfOxrcj4KYXSDgQLbhw8YX+9RQ=; b=uw5QDcviedAXoXPkGFKL/MOGIMmvUZYh4R9TK7VZnQHSjRvW8Yw90r4FVfQ9yhSVk0 CXt1UAYgUBUPOvvfr5CifUDWzGmVNPUFGcW5Wro1KSQbSJ/YkwhzPoN9btx1iLi8SkE3 MRaBUP0JBIjsXPWcJZQ0PjQSgOgNxn3Cp+hPWUODAlp6/vwqwWIihCqYao/3cziFHkKG S0ZqgiA+Pa8KyV1n0XkS8xh7PtkjKsnFD0jkitG6G2Lei5m4ieAGszPN+u8rf//3zQLB 7tB4B9UHPce2RXSDuebEH2wKtFCfjoB8IUWOFqkOzGBpN7hgjIxs1o0udwgDH8idQuiL fiDQ== X-Gm-Message-State: AOAM532IbX/GogHO6b1Us5ERMiEy52WnffxOzyTZgu11VOBJX7u6fYD2 EzVrECzve1Rzq8mSdx7m4c2S1uMAuTEffcQ6u/8l5g== X-Google-Smtp-Source: ABdhPJzHHjr+U17m6GiWu/VvrpzHwzmwnyEEuH0irvtCoZwtYfAaRRTS4+nFij482usItX590WL/sqUymh0V1yrnZeU= X-Received: by 2002:a25:3:: with SMTP id 3mr29737607yba.418.1633532527401; Wed, 06 Oct 2021 08:02:07 -0700 (PDT) MIME-Version: 1.0 References: <20211001205657.815551-1-surenb@google.com> <20211001205657.815551-3-surenb@google.com> <20211005184211.GA19804@duo.ucw.cz> <20211005200411.GB19804@duo.ucw.cz> <6b15c682-72eb-724d-bc43-36ae6b79b91a@redhat.com> In-Reply-To: <6b15c682-72eb-724d-bc43-36ae6b79b91a@redhat.com> From: Suren Baghdasaryan Date: Wed, 6 Oct 2021 08:01:56 -0700 Message-ID: Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting To: David Hildenbrand Cc: Michal Hocko , John Hubbard , Pavel Machek , Andrew Morton , Colin Cross , Sumit Semwal , Dave Hansen , Kees Cook , Matthew Wilcox , "Kirill A . Shutemov" , Vlastimil Babka , Johannes Weiner , Jonathan Corbet , Al Viro , Randy Dunlap , Kalesh Singh , Peter Xu , rppt@kernel.org, Peter Zijlstra , Catalin Marinas , vincenzo.frascino@arm.com, =?UTF-8?B?Q2hpbndlbiBDaGFuZyAo5by16Yym5paHKQ==?= , Axel Rasmussen , Andrea Arcangeli , Jann Horn , apopple@nvidia.com, Yu Zhao , Will Deacon , fenghua.yu@intel.com, thunder.leizhen@huawei.com, Hugh Dickins , feng.tang@intel.com, Jason Gunthorpe , Roman Gushchin , Thomas Gleixner , krisman@collabora.com, chris.hyser@oracle.com, Peter Collingbourne , "Eric W. Biederman" , Jens Axboe , legion@kernel.org, Rolf Eike Beer , Cyrill Gorcunov , Muchun Song , Viresh Kumar , Thomas Cedeno , sashal@kernel.org, cxfcosmos@gmail.com, Rasmus Villemoes , LKML , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm , kernel-team Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7DCD43000B53 X-Stat-Signature: q3gmcpyjgzq97cow798eb5p6fgmn8tm5 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ta783nvp; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf03.hostedemail.com: domain of surenb@google.com designates 209.85.219.182 as permitted sender) smtp.mailfrom=surenb@google.com X-HE-Tag: 1633532528-877400 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 6, 2021 at 2:27 AM David Hildenbrand wrote: > > On 06.10.21 10:27, Michal Hocko wrote: > > On Tue 05-10-21 23:57:36, John Hubbard wrote: > > [...] > >> 1) Yes, just leave the strings in the kernel, that's simple and > >> it works, and the alternatives don't really help your case nearly > >> enough. > > > > I do not have a strong opinion. Strings are easier to use but they > > are more involved and the necessity of kref approach just underlines > > that. There are going to be new allocations and that always can lead > > to surprising side effects. These are small (80B at maximum) so the > > overall footpring shouldn't all that large by default but it can grow > > quite large with a very high max_map_count. There are workloads which > > really require the default to be set high (e.g. heavy mremap users). So > > if anything all those should be __GFP_ACCOUNT and memcg accounted. > > > > I do agree that numbers are just much more simpler from accounting, > > performance and implementation POV. > > +1 > > I can understand that having a string can be quite beneficial e.g., when > dumping mmaps. If only user space knows the id <-> string mapping, that > can be quite tricky. > > However, I also do wonder if there would be a way to standardize/reserve > ids, such that a given id always corresponds to a specific user. If we > use an uint64_t for an id, there would be plenty room to reserve ids ... > > I'd really prefer if we can avoid using strings and instead using ids. I wish it was that simple and for some names like [anon:.bss] or [anon:dalvik-zygote space] reserving a unique id would work, however some names like [anon:dalvik-/system/framework/boot-core-icu4j.art] are generated dynamically at runtime and include package name. Packages are constantly evolving, new ones are developed, names can change, etc. So assigning a unique id for these names is not really feasible. That leaves us with the central facility option, which as I described in my previous email would be prohibitive from performance POV (IPC every time we have a new name or want to convert id to name). I'm all for simplicity but the simple approach of using ids instead of names unfortunately would not work for our usecases. > > -- > Thanks, > > David / dhildenb >