Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp140317pxb; Wed, 6 Oct 2021 01:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuerg0A+4lHOx0K1XdLm1mM5Ple3cBiJAd+z6iVWY981yL4c5a7u/+wa/bDdf9yg+sXJ8g X-Received: by 2002:a05:6402:16c9:: with SMTP id r9mr32158610edx.147.1633508994239; Wed, 06 Oct 2021 01:29:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633508994; cv=none; d=google.com; s=arc-20160816; b=W3aHvw4w5AU4VaZSidlPIwkO3SD8P0gRDTmkqcVTPMBN5NCW/eaRS0nMWx7oYsVdxL Df/5g54QJxxLtZIFQmGHJ3rlUu8VpjIdwlnGZ8qIXNoWeAAlzv6sqQ42NOXDUW0koLBx P49v2B+W2bv9PksRVd2xlxtxcay26nrYoKmNZNOG+3NgL9bHrOhcSSmv3blC9+d/eP5D ZUiVZMRM35Dv+dvHEZqEf+xV4Hv88fU0929luM6ysA0Cb1lzAlcy41XZNDagGX94aBaK pIMDnIY0VVQBjVQ36Lx36z42HJRRt6TPWlU3w6kayruHu/TWImci471CbG+M8rNJuwbu zOTQ== 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=E/6HtAb0SdSz7BkiP3vnxEjZN89ZpTwbmcif+6QXT1Q=; b=F4G10Ku7ilDaq8+4+d7p0jX4moSjhBHiQJCslXGphul02ywvpGhyQrl5EHdT+eKgqD 5zhzIvFf9ej873WhspqJUKOwqpdruiP9YeKObhqjYqY+gyTYOY/6xH8T1V95yt6e28rN hnwHeWtG2Fz9PPkczTswgYkiaQm9l+0jwbh0hhqp3UirhF8vFP6NhWJ+eoYCpCHtvGVE X4LVHE4W7LibMjBwEbg83M5UIRRQ72WOcwTIov4dBSLsg/zgK4u89XpYXiUOnkIhGH3U 4hmgqFJQpOUch7Agp4vyj+4ofAlwEwwdeD9K3nfU5MqpehUeEQ1rlchDND6Mr9GKwSfm qh7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=nYikioOx; 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 q11si6932946edd.253.2021.10.06.01.29.29; Wed, 06 Oct 2021 01:29:54 -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=nYikioOx; 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 S237593AbhJFI3x (ORCPT + 99 others); Wed, 6 Oct 2021 04:29:53 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:45894 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbhJFI3u (ORCPT ); Wed, 6 Oct 2021 04:29:50 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 44FB4224C1; Wed, 6 Oct 2021 08:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1633508877; 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=E/6HtAb0SdSz7BkiP3vnxEjZN89ZpTwbmcif+6QXT1Q=; b=nYikioOxXuZDyMI2sYHhQLYKpRyOPJyfYTgw8c4byiW5NZrEE2NXTV2v+Bmy/HAV0eGbWh Xb0WUCm2D+Nwnl/kBGP8MWT+q7SF+YsECSF9OALaQJASEGMuTqOPL8jKW/pXEXlSd+uZ94 bWI8FW7y+23ZFbOJnkXy9RhICCpPsIg= 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 38B8DA3B8A; Wed, 6 Oct 2021 08:27:55 +0000 (UTC) Date: Wed, 6 Oct 2021 10:27:54 +0200 From: Michal Hocko To: John Hubbard Cc: Suren Baghdasaryan , 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> 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 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. > The kernel changes at a different rate than distros and > user space, and keeping number->string mappings updated and correct > is just basically hopeless. I am not sure I follow here. This all looks like a userspace policy. No matter what kind of id you use. It is userspace to set and consume those ids. Why is it different to use strings from numbers. All parties have to agree in a naming/numbering convention anyway. Those might differ on Android or other userspaces. What am I missing? > And you've beaten down the perf problems with kref, so it's fine. > > 2) At the same time, this feature is Just Not Needed! ...usually. > So the config option seems absolutely appropriate. This is not really an answer. Most users are using a distro kernel so this would need to be enabled in those configs just in case. -- Michal Hocko SUSE Labs