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 339C3C433EF for ; Wed, 6 Oct 2021 09:27:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CDCE461260 for ; Wed, 6 Oct 2021 09:27:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org CDCE461260 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5D5CE6B006C; Wed, 6 Oct 2021 05:27:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58614900002; Wed, 6 Oct 2021 05:27:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 426186B0073; Wed, 6 Oct 2021 05:27:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id 3514C6B006C for ; Wed, 6 Oct 2021 05:27:54 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EC9558249980 for ; Wed, 6 Oct 2021 09:27:53 +0000 (UTC) X-FDA: 78665485626.32.76288AB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf01.hostedemail.com (Postfix) with ESMTP id 7968B5074261 for ; Wed, 6 Oct 2021 09:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633512473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ngYQ8UnRk1ZQG1QBxVMt0vUipJ0oB+rpBaTB/8WXgg=; b=YV4Qm+sQBIl2iHTTLNLUka0jAZnCX/tE5u6nA0ps+QH/DSNKixZ5Vx6CB7EVlPbR89scPn BgKFqRsrfeNGudFXl/xi1IMiIveMF+r+AxJbOOaGd2pzbqmwSCcYTFLImn0T7/LC7tn5Iw 45PjbTcHbfUm1dWkg8/jovwYPpi0IOE= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418-IudGHC8nMfiw14143ZrhhA-1; Wed, 06 Oct 2021 05:27:50 -0400 X-MC-Unique: IudGHC8nMfiw14143ZrhhA-1 Received: by mail-wr1-f69.google.com with SMTP id s18-20020adfbc12000000b00160b2d4d5ebso1527994wrg.7 for ; Wed, 06 Oct 2021 02:27:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=7ngYQ8UnRk1ZQG1QBxVMt0vUipJ0oB+rpBaTB/8WXgg=; b=fwSi5QVJApUWNiEbUFUpqEdGe7IV+X/IgvSVbZ9A+qLqETveHM7amwtZRNkMmY3gNM MFwG3t561CzsWlwfs7YHJDEwbe4rMTfRJStiGGUfvTqTs/mzaQ50WFmJ8B2OgEml8eyn TUTnFkyU3McEKF+Cn5VFDmk2v32hpbK65Lb6j6ke3uo9nydROYhROtYWBm6wE7Xxunai vBuyqgI+x2EqrIXj4YaBJj5j1bigTf0fWiyZddNP/ZWzet3g9qdNDQzInEwgD0XRYTgG aRuW2vCioLcLmRZjfOTOJzDqJieADFPzMrqUMx/28RbbVzUfiOVG2Dd9solsTnG/bhMn MIaQ== X-Gm-Message-State: AOAM53228dAAoKLJYa9CIOglQYwnCLRRxynsQeJn1wsBmbGAUF8fRf+3 kURTLJkLPaHw9awsjKIRH81+y3jrD/rD41umICnFm8De8cExSbtYZAhmVkwapCG8mMkk0Kf81FD vttWFikJ6y3Q= X-Received: by 2002:a05:600c:2504:: with SMTP id d4mr8654606wma.53.1633512468997; Wed, 06 Oct 2021 02:27:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGUhy0gAKWUOqrJ1UNTMcU+0gj6b2WgmTy8wezEYe1OO1y1Ud7N7Qy2A2zoM8LgbCxYHGIwg== X-Received: by 2002:a05:600c:2504:: with SMTP id d4mr8654537wma.53.1633512468677; Wed, 06 Oct 2021 02:27:48 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6529.dip0.t-ipconnect.de. [91.12.101.41]) by smtp.gmail.com with ESMTPSA id o26sm4707828wmc.17.2021.10.06.02.27.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Oct 2021 02:27:48 -0700 (PDT) Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting To: Michal Hocko , 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, =?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 References: <20211001205657.815551-1-surenb@google.com> <20211001205657.815551-3-surenb@google.com> <20211005184211.GA19804@duo.ucw.cz> <20211005200411.GB19804@duo.ucw.cz> From: David Hildenbrand Organization: Red Hat Message-ID: <6b15c682-72eb-724d-bc43-36ae6b79b91a@redhat.com> Date: Wed, 6 Oct 2021 11:27:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 7968B5074261 X-Stat-Signature: 8oedt73annry4patf9icoutytrs5g6ed Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YV4Qm+sQ; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf01.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com X-HE-Tag: 1633512473-768325 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 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. -- Thanks, David / dhildenb