Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1148950pxb; Thu, 7 Oct 2021 01:40:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiLCduwYd3UeFmxRU00Dr59dJXr0iVdx/+FCpAAxcL03iBj1vPpVijXm5IvHJygfuyiAzF X-Received: by 2002:a63:9d4c:: with SMTP id i73mr2335546pgd.216.1633596003433; Thu, 07 Oct 2021 01:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633596003; cv=none; d=google.com; s=arc-20160816; b=A9p/0cp5TaeVn9V85xKvYqJ0R3/pHQHT2Q1vSR5dVyS9vZMyojdv5Cy5QSDzRxrpFE rrPPhPW3GiqjTyj6D7eDoZL0Bgajsws85NfMOcoochTEIyKPHPPPMoQeEVJ81NWYJoJJ Sjce3d5QS/Qc6Yh4uR/cSp5cxXF5wrfA2ebFl1Mqj8+ZXHlV0qk+rs1e+1td7QHuEIeU daiLyG/cIdso9R12uAUE8ZJhhKsIY/FgKdgH4Wnbwrpn8mHes+mIXmlfTb32cnJVi2oq MSQo64E8oSVdvZzEK9AY2nvAfzEdaprGyvbg1Yzffkje0ji0kjtXf9eotJylhty8AAJg 8SCw== 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=k1SjRykK8qSsuEpLbR/1BLHsqb/6nAB8R8Bq+VJeYNY=; b=hEcCStbIsRYxgD12vy1nYzhp4DZJC6PSoAQdJi75g+kwpUvM2amQrVssdhiPU7YXlO Q+q1Cnz62YGVJy6tj5ufkf6t0GSmFEm+oQVK1pKI/w8mjodMjUDVmn/YJDDadv4ucGbV EWme0qbnNEZ7kgzsPnMMNomGu3e5zpg4bdNZMP5djPccnZJm72nb54nFts47n9c1syd5 zg3ZXkox9KwBB3ormATk24ciPD9n8kaP01gGUWZtCEQGtWeL41BhXih0bPlrYCt0wcbr OhJRLy5thWGArWFxZtwh0T1Qae0vEb/2B9sHptEIg7bMyOoaIBFgFET9Oe+oYT+c3+2y FQGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=d4VB9wDR; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mt18si7958262pjb.127.2021.10.07.01.39.49; Thu, 07 Oct 2021 01:40:03 -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=@suse.com header.s=susede1 header.b=d4VB9wDR; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240361AbhJGIBU (ORCPT + 99 others); Thu, 7 Oct 2021 04:01:20 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:32778 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232502AbhJGIBT (ORCPT ); Thu, 7 Oct 2021 04:01:19 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7535221C77; Thu, 7 Oct 2021 07:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1633593565; 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=k1SjRykK8qSsuEpLbR/1BLHsqb/6nAB8R8Bq+VJeYNY=; b=d4VB9wDRP5RBYTz/tZZccmKEouWEMpxlGyzJ3cDxLEAWtJJfSvPKPXl7IfxWWsBOhVqzmB kiY4t9Hm32ScRgKORVWbDR3aTJg7VB01in/XMs8Jkfi5/94IuVtY1V1e0s8lcbRUVnOQZo PL7pwO6wfwPyOFHfUFdtbrpVBm89uu8= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 95C36A3B95; Thu, 7 Oct 2021 07:59:24 +0000 (UTC) Date: Thu, 7 Oct 2021 09:59:24 +0200 From: Michal Hocko To: Suren Baghdasaryan Cc: David Hildenbrand , 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, Chinwen Chang =?utf-8?B?KOW8temMpuaWhyk=?= , 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 Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 06-10-21 08:01:56, Suren Baghdasaryan wrote: > 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. I still do not follow. If you need a globaly consistent naming then you need clear rules for that, no matter whether that is number or a file. How do you handle this with strings currently? -- Michal Hocko SUSE Labs