Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2103204pxb; Fri, 8 Oct 2021 00:26:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2Lx/eOGwR9Mhn20z2QJE1LhsvOKPjxi+vPIp9G6yv2maM3nuqY0Peg8rq5DTF5XjfuysP X-Received: by 2002:aa7:8a41:0:b0:44c:9261:3d89 with SMTP id n1-20020aa78a41000000b0044c92613d89mr8768239pfa.19.1633677997862; Fri, 08 Oct 2021 00:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633677997; cv=none; d=google.com; s=arc-20160816; b=TTIRVmiQ1nddv33Vr1lRZ3ZovJJtoU/a3pDTb4uapuFoJpt95I7UkAZIUcCAVQXDPu jjjYdJodoW/8afn52aBWx7chNEJF2sMU5B2dJ4HTqC/AfB8gHheT37+WvtR65aI5Y1/H hyQaqWowQ1RPn/ff1Lbi8V9q/Ghl4ljhjPlQEPkdQ4GCLbRgvkx5GavV5qRviw9RaVpR 70+J5C5EQyDDmY8SIJ4bVaC6nNonQqoAGoElo5GeQ0EptQ+dB+FPjdMoSGPK2XpdZvyR RpYO6bSh1NVF89i2iRZp2qzMBAmeaYsgZZCLpaePgG3T6/eYE0kaubcPvhrOIIfAlHVb D8SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=EaBStkQbJ/56vDWRGxe1cWvLB2apSJpVfbn9rFFy6VQ=; b=aqyyIdPtqwk/AmIPfnBr/pGERKRRdv28d2eQK2zdxM2APM2tClARRxi5lHDBs4UoMp vDEOVTwwwT6KlXzs3mu1tjfk5henQR+8oOugsv8CPbcI6wFWP9RzW7HXHeUzcwXk0yaB FjuQU3m/4ECr0+s4idmhDCEyWJz/o+sH0lOW4M1A9+pKfangNywNXleSOJQeBXXRUhVr BZRVxyTjhoaX5aB9nLaU2NtdjvbhB6iO3jGAhjWkFQhVlj9dfLPuhJETZSjSAY8cZGSR pVKj25I1YfRR6mt0/sYJlRmaOC5jN7t6MG/3pComMFM3ownKRr7UVfe+OLVMOvS4+GQp 3LFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=PJCmaxvV; 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 d7si2937588plg.250.2021.10.08.00.26.19; Fri, 08 Oct 2021 00:26:37 -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=@rasmusvillemoes.dk header.s=google header.b=PJCmaxvV; 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 S232339AbhJHH1O (ORCPT + 99 others); Fri, 8 Oct 2021 03:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbhJHH1L (ORCPT ); Fri, 8 Oct 2021 03:27:11 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FB2BC061760 for ; Fri, 8 Oct 2021 00:25:15 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id j5so35430766lfg.8 for ; Fri, 08 Oct 2021 00:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=EaBStkQbJ/56vDWRGxe1cWvLB2apSJpVfbn9rFFy6VQ=; b=PJCmaxvVuKBNAN4Njn5KUcl6g383j4Vb5tnx0nJDv7g7SIS1wkwDlY3kI9KLUtYBGH El6Xpm2x6d5DGTbE+erN2bbm2OaVIeIMjX/QNQC9hjV0HRf8ITLHg98hNuiinUeNzZN4 mmP61pgb8No6pnjZtSHAjQdlM19ljPWW9RzTo= 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EaBStkQbJ/56vDWRGxe1cWvLB2apSJpVfbn9rFFy6VQ=; b=Su9ZvarvFiZuhUpfztmMfuLemEPVlzHybc+MYVj2313PLH9+Y14iTchD6t2IIB6DOv nrBCGhDZyGd1jWG/4vB+e2WZZI/St/4RHcXNixrRKcg45EoxDdJBOPONq9n/OR6reXds lm8C9IC4fZG0JyjB1HefsGUB1L9B9lyE89Klt1F8CszvAZMpPTBSAMIdzgr0M+c78L7K zT7VgAPvdreMLWmLp/lrbrtf5n1giyV/Bm7L+YgzcAy1ZERe/JW0vWO8aY9zze+KPDRI fzakH0mvzYM5+jTn7O2fnOZjZccJRVthQH8bYZLAmzPrqVE4O22RITbWhIaFM/e5fMdz iZpA== X-Gm-Message-State: AOAM5324EMqylo9DbWuBCtFNbU3R/EYH7W6VC8bhK309ot6iSsox6cD1 IUigwkceEvsIFXs4vQxdmcQ8pw== X-Received: by 2002:a05:6512:ace:: with SMTP id n14mr8818303lfu.460.1633677913738; Fri, 08 Oct 2021 00:25:13 -0700 (PDT) Received: from [172.16.11.1] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id i12sm168955lfb.234.2021.10.08.00.25.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Oct 2021 00:25:12 -0700 (PDT) Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting To: John Hubbard , Suren Baghdasaryan , Kees Cook Cc: Michal Hocko , Pavel Machek , David Hildenbrand , Andrew Morton , Colin Cross , Sumit Semwal , Dave Hansen , 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 , 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, LKML , linux-fsdevel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm , kernel-team References: <20211006175821.GA1941@duo.ucw.cz> <92cbfe3b-f3d1-a8e1-7eb9-bab735e782f6@rasmusvillemoes.dk> <20211007101527.GA26288@duo.ucw.cz> <202110071111.DF87B4EE3@keescook> From: Rasmus Villemoes Message-ID: Date: Fri, 8 Oct 2021 09:25:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/10/2021 21.02, John Hubbard wrote: > On 10/7/21 11:50, Suren Baghdasaryan wrote: > ... >>>> The desire is for one of these two parties to be a human who can get >>>> the data and use it as is without additional conversions. >>>> /proc/$pid/maps could report FD numbers instead of pathnames, which >>>> could be converted to pathnames in userspace. However we do not do >>>> that because pathnames are more convenient for humans to identify a >>>> specific resource. Same logic applies here IMHO. >>> >>> Yes, please. It really seems like the folks that are interested in this >>> feature want strings. (I certainly do.) For those not interested in the >>> feature, it sounds like a CONFIG to keep it away would be sufficient. >>> Can we just move forward with that? >> >> Would love to if others are ok with this. >> > > If this doesn't get accepted, then another way forward would to continue > the ideas above to their logical conclusion, and create a new file system: > vma-fs. Or: Why can't the library/application that wants a VMA backed by memory to have some associated name not just fd = open("/run/named-vmas/foobar#24", O_CLOEXEC|O_RDWR|O_EXCL|O_CREAT); unlink("/run/named-vmas/foobar#24"); ftruncate(fd, ...); mmap(fd); where /run/named-vmas is a tmpfs (probably with some per-user/per-app subdirs). That requires no changes in the kernel at all. Yes, it lacks the automatic cleanup of using real anon mmap in case there's a crash between open and unlink, but in an environment like Android that should be solvable. Rasmus