Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp584696pxb; Wed, 6 Oct 2021 11:00:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5+VBy+ZyGjsn13reCK7YUP59kUQa/+hCjsq1ybmM78HG9XJWu5Drs63em74Gzs44myQAx X-Received: by 2002:a17:906:6c8:: with SMTP id v8mr24530846ejb.428.1633543212455; Wed, 06 Oct 2021 11:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633543212; cv=none; d=google.com; s=arc-20160816; b=mMIDMOSM1ns8gNQkhjvb8depV8sBFGpG9VveODSHVpnzj64BONBSGYZvozzNTPLgrE ksj7iTrilajuVwDVyJeAovDCYeaW7PaCoijYoR2INXgtM5lPkKSqyg1e6sV+fQB0Xb5G GDOJpEexWGRYHawj9KSiaNeFolPjwKrFMefAKggb/bARXdOM5/jAh14Vmq1apB7KML54 vEH2LED5sc758nxXDd+zbf15Iqu5Frk4JmCGgD2p3ffqC+4wrmD6/K7eyN3MwQFcIys9 oFkxGzhv4pq0tEG9iL+E2KvTYY8rYamFM/UZvKyD/jKUvUg7obyddx6EI2nj8/iM//sc NzPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=datnLKq/i3lbuL2fK1jAV7eL2gW6I34pXLPyLFlwYD4=; b=DfZ5XH6qfpw05oT0mp+e6PIxUTw1kLyUyZLKbesLVitBkjkuhVYzA2z+uMHPUGyLza fCM4F6nU4FnKN9NXBusv42odf7S1zY0gqCjkqGwfxVX4UA8qIjr2CSwftoK8fzPvL9qw 9bYT0D31MI6FV+dYhznVVJRH8l4SWLPsMMsJxvTHF+Z3PwSP4WRN5dDoKk8EfARoTJss 8qbVVgsjyvhTMP0yMtZ8FPiMIqfalMSQz+XWEZ/c9pNSOVZpHdH+JOgGFBYofj/yzzEi IEH8++yJ4E8GVMZrWxm1Ba+JnB3gw129aRyZef/VdNwehHeS9oGcWtF3bfsE98Ag3mE9 /y+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si272629edi.385.2021.10.06.10.59.48; Wed, 06 Oct 2021 11:00:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbhJFSAQ (ORCPT + 99 others); Wed, 6 Oct 2021 14:00:16 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:51146 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbhJFSAQ (ORCPT ); Wed, 6 Oct 2021 14:00:16 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 213951C0B87; Wed, 6 Oct 2021 19:58:22 +0200 (CEST) Date: Wed, 6 Oct 2021 19:58:21 +0200 From: Pavel Machek To: Suren Baghdasaryan Cc: David Hildenbrand , Michal Hocko , John Hubbard , 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: <20211006175821.GA1941@duo.ucw.cz> 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: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45Z9DzgjV8m4Oswq" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > 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. >=20 > 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. I'd be careful; if you allow special characters like that, you will confuse some kind of parser. > 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). That "central facility" option can be as simple as "mkdir /somewhere/sanitized_id", using inode numbers for example. You don't really need IPC. Plus, I don't really believe the IPC cost would be prohibitive. Or you could simply hash the string and use the hash as id... Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYV3jvQAKCRAw5/Bqldv6 8lyUAKCwEv6bdJTV+wggIi1c2UYNr58JwwCfey84lnBPdV/qEtwDzRe+bL2Ytrw= =5AmT -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--