Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2624272pxb; Tue, 12 Oct 2021 10:07:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIrV93AiB07rj/uZ3p8gJyKrtstBL0hwdQWcawyGCvaRjN5jEn1L0By5wEEQ8vKdteOx3a X-Received: by 2002:a05:600c:4ba9:: with SMTP id e41mr7094292wmp.70.1634058469080; Tue, 12 Oct 2021 10:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634058469; cv=none; d=google.com; s=arc-20160816; b=s6XbbXTMKSbfjJzr9UonEZBEtdQQp/upYX38lih+tY8n3ZlDrNUaQ6NR4alSvqYUfv 2Ws+ObjMlUcQn6HJc5ahSkmg9JI0H2n++X0WSaFEuo5EJvS2wramX4txpG4XpsAGzRDT cX50Za++e0xBpG139tzxOdlMZ5x3YLZ26W0NFTRqfrwyjf3l3M2nmyKWEYujCjDqCEFv LxEVHFbuhw76PYJjNYWoTUeKAKKdzU3e6sc/Uv/VIFMhn+3MKD6Hqp4Q6i2UbrsyUvez SfaWBXi7Pjd1XqFN17+VcIXKEwFx6+awN8NOSsd5bHrwX6N5JaNb6P693u+nEfpvEhKG aANA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8Tzhl0MVFy9A0j1rnPsvy8YVR9B6G5UsH8EyCGPBclE=; b=TBYfVeeciIydOrVcuF1bmtyRS03dNIOFzqt8QBenE6r/AHjCta1szOEdOuL6Jq6hTq nBvZqb3s8vVlHFzDWaPP8bMk85pgXYoVTqdSedZsLfct9GVJUVnduXeG85sF3z3LVTTR mBb1vFXvOy+5FKSP/3EqqcSZAittZt5jvS1AnF1fAytvZ6ZifW6dGzdUXvEVLnlEd80u bhIbevXuDwSg9BXbtfc4m6//hT65LuZuiD23hnCjloQdhmWEunrOFlTZxYAqkwUPpQCn ZOWB7K/amOe7/Hy+jVKuxdRfpjofBNoKeG7QPoWwKGxobNoii0egG2bIqWw/f/Sn+DX+ ZBzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZcOenQ6f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di3si5103173ejc.490.2021.10.12.10.07.15; Tue, 12 Oct 2021 10:07:49 -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=@google.com header.s=20210112 header.b=ZcOenQ6f; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232037AbhJLRDU (ORCPT + 99 others); Tue, 12 Oct 2021 13:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbhJLRDT (ORCPT ); Tue, 12 Oct 2021 13:03:19 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51A02C061570 for ; Tue, 12 Oct 2021 10:01:17 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id u32so48099678ybd.9 for ; Tue, 12 Oct 2021 10:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Tzhl0MVFy9A0j1rnPsvy8YVR9B6G5UsH8EyCGPBclE=; b=ZcOenQ6fVRLLsv/XeQFPg7fnM5YEM500n89LF22NH+zpMwjIeByGZnUmUhodoBeu4+ uwRWuao0Tu++R3OlxtP+LKtt7vSGIzR7JzZAOoRYt2nrsggm63sKqt5bHG4YydOI6rbz EWfFpyddnUNjAcDMQdF8LgCWLuUDazezQTw7gQy9qtJAntsZUsYobnzegylDiaOMGwOI MDxq8+Dre7QZRyI4jvrs5HJwdVG78mh5+2eIvdkY04GLC9IKL1K9rD+9U39CrRpRZfZ+ 85bzsQZhzLNXmWkU4iZojVd4u4SE2SIV3Kygv4OxuhiD5x9Uo9VVm0sv7jo2p7b5oW5u 1ctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Tzhl0MVFy9A0j1rnPsvy8YVR9B6G5UsH8EyCGPBclE=; b=L3XwPOqqp57UaS9xDWXTjrky4wUdrj8x0fwOKZeoZwEnSjitLtchdbI4aCfzCjWtg6 Z1tRJKVpmHhRmK2khIPNR9IN0P5E0KpbR8C2PDIQKdkV2/8iAE9WQzFIeH0kOoac1So5 SyOBAghAlzNdChsz0/wEbX3svRQmsfBk4m5p3jN1pLEHkI6g0gvZsEOZjML5RrPbD/VK 3sqgHg+4LNH64pCjrkvUjy5WwGpOReesOYb92PA/mY0ocXRDn4h0PgXl3YVPx6B8mGHc oM+aumA5UL55DF2s9CDlSKC9FTD+mLwsMgA7NElHjqQsVeAXec8r70tvx0o6zb0IlJb0 1UaQ== X-Gm-Message-State: AOAM531vbh4NTOjkhQkgn/pjFTD2wWZGrkHeZBCaFCrBIbxYXmGe5PqY z8kLBIke63ywGDeg6GNHuAYCGHtwlSAdjhCcnEgOdg== X-Received: by 2002:a25:552:: with SMTP id 79mr28537708ybf.202.1634058076286; Tue, 12 Oct 2021 10:01:16 -0700 (PDT) MIME-Version: 1.0 References: <92cbfe3b-f3d1-a8e1-7eb9-bab735e782f6@rasmusvillemoes.dk> <20211007101527.GA26288@duo.ucw.cz> <202110071111.DF87B4EE3@keescook> <202110081344.FE6A7A82@keescook> <26f9db1e-69e9-1a54-6d49-45c0c180067c@redhat.com> In-Reply-To: <26f9db1e-69e9-1a54-6d49-45c0c180067c@redhat.com> From: Suren Baghdasaryan Date: Tue, 12 Oct 2021 10:01:05 -0700 Message-ID: Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting To: David Hildenbrand Cc: Michal Hocko , Kees Cook , Pavel Machek , Rasmus Villemoes , John Hubbard , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 12, 2021 at 12:44 AM David Hildenbrand wrote: > > > I'm still evaluating the proposal to use memfds but I'm not sure if > > the issue that David Hildenbrand mentioned about additional memory > > consumed in pagecache (which has to be addressed) is the only one we > > will encounter with this approach. If anyone knows of any potential > > issues with using memfds as named anonymous memory, I would really > > appreciate your feedback before I go too far in that direction. > > [MAP_PRIVATE memfd only behave that way with 4k, not with huge pages, so > I think it just has to be fixed. It doesn't make any sense to allocate a > page for the pagecache ("populate the file") when accessing via a > private mapping that's supposed to leave the file untouched] > > My gut feeling is if you really need a string as identifier, then try > going with memfds. Yes, we might hit some road blocks to be sorted out, > but it just logically makes sense to me: Files have names. These names > exist before mapping and after mapping. They "name" the content. I'm investigating this direction. I don't have much background with memfds, so I'll need to digest the code first. > > Maybe it's just me, but the whole interface, setting the name via a > prctl after the mapping was already instantiated doesn't really spark > joy at my end. That's not a strong pushback, but if we can avoid it > using something that's already there, that would be very much preferred. Actually that's one of my worries about using memfds. There might be cases when we need to name a vma after it was mapped. memfd_create() would not allow us to do that AFAIKT. But I need to check all usages to say if that's really an issue. Thanks! > > -- > Thanks, > > David / dhildenb > > -- > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com. >