Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp434716pxb; Wed, 6 Oct 2021 08:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjTf8KWW1ESzAFNvfTV7y7SwN928bFNT8EfmW9tonN//W1FeXBI3RAEMlz/s/SgXF9P9JB X-Received: by 2002:a50:d948:: with SMTP id u8mr35006535edj.306.1633532675272; Wed, 06 Oct 2021 08:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633532675; cv=none; d=google.com; s=arc-20160816; b=D0ajUXC1A8P3rXt85G35uOAP9Z5/xe1TSLc/1dbM6yJxhfEurJSZiCwCyogUK/TNad u9P13kl6iV41PUIgJJU6eKZjZnKje4f/zfJ1xtp1NpW5VIMv2FEMBw0YlvYp+k3RJ8gc W8N4/e9r0Dg2sNpgPhM95EtgPwqZ/PhaAj4Og1OruZqZBdiyWGPgVzKvG/oNBmKq6h/W z0i3nQXl+b0qftWNCd8dR+LbLpjw6YDE1FQVyT6r90iCp/tUPy+32J9i1A7qFSWg42u7 7QZRTyQdh33R8O7+a4EUQknyhIgCefh9R0TJbZ2+dYZAnlHqJgmNq8gifWjMDHuisYr9 saEQ== 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=MzEyLfp/eaHfYFCvoWfOxrcj4KYXSDgQLbhw8YX+9RQ=; b=EdO4Oij/0kM/at3vqy9JeooOoCIYfCt911we8sk/Bdo14XSl6BkY8oFHjlZ127Qcnu Ci1Mcns0lJTT1oSmv9KyiXse12bwvgPr0d+5ThteO0C2es6kGDvWYmKIhClDHap5FG4t Pqw3xn0h5whMOfWbpoZQmLORQ3MhxqlWPJmQ1hQo9fEIxkoo+CPqQI9BT2nkVkzOJ4k5 XWai0fo3FyXbD0T8/Pbpf3zM7pKMzeSy257pVIcuYOBS49zHzRMx1OGDlmLDPnzUZvE4 s3kv5a7j0Bg4VhNEwNVRFH42DfR1Jh+WPiFbBN8zvhQZzWwhrPUN9Hf/8EJQ6HnSqigN HIpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ta783nvp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c4si24695199ejc.709.2021.10.06.08.04.02; Wed, 06 Oct 2021 08:04:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ta783nvp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238436AbhJFPEC (ORCPT + 99 others); Wed, 6 Oct 2021 11:04:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239000AbhJFPEA (ORCPT ); Wed, 6 Oct 2021 11:04:00 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77848C061746 for ; Wed, 6 Oct 2021 08:02:08 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id s4so6068757ybs.8 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=10Ftqq1KI3TPzxS4bkj1SM8ZClI6jPQmDP27MuHDKtq796enKqD/UlrYvrCWTIxmra X/qyFWDSwrZfkRNuLWdAjpGSbiyWoP3ugThpPTP6CpREYEll9WxoNrt3lrNxnwJ/+YMf ZlBrpVl3PU5YPNdL9fC5z2gsu52QL530dpAKlZiitDZIEIonuLFAvBLdk1V8DQHeVavy S4MbyQ2FiXv4NE03LzSQfbJxO9OTSAWzg+NHuklgFzE7uB9Ma7/ZF4EZFXa8mELpHBxF Gm3iTnD+bQWg0NjOp4PPt0M2eW+OPnSacPrYLR+qBMf80nBffs5zycOgXHWDPXzAekbM KtWA== X-Gm-Message-State: AOAM530SqJumH0AwE6I8XtPDzDDyZFIZewBwWoDxHqeY3xL1EooSKBp9 A+GvXdP9bl+BerVajItb6RMOgf3tDXqmmBbfiB8THw== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >