Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2182641pxb; Tue, 12 Oct 2021 00:46:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8W8RzJNLdNuycrlxA3mlHi5RNAlFuRjuQQoZWLhLBJozDHrVYd3sXFS4PG27tF5OTuGgw X-Received: by 2002:a05:6a00:17a9:b0:44c:b95f:50a4 with SMTP id s41-20020a056a0017a900b0044cb95f50a4mr30806273pfg.6.1634024770009; Tue, 12 Oct 2021 00:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634024770; cv=none; d=google.com; s=arc-20160816; b=g2+sFgRJnNfctZyINPDRb33Wm43zSBYXP7kmO8Hj7PttDpIoZcv+L03qy8neXpAqUP 38T2CgZvYH51p60MseR3BkTlMx6mp4V2cHkLnCl7M+b5TYAkTVvQMt+F/Q5AdQRoXrgw WO1YyPoT16wBXkOVmt/KK+46X+XUhh1/BQtFc07ptCJnzagcFVzyyQoaOSquViEJ3n1B v6m/xBsmQjFrY6376DuWMv6pTm48IPVy77iFEK0oZkfLseV45GJejhB+IfTkAIzyTrka 7Wwzc5Ka2NGnIDWKAcLDCjpuRA2MgCE1bnDl+KBpS0owisFdTV2HFJzrbk6yoCoNUayA Of5A== 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:subject :organization:from:references:cc:to:dkim-signature; bh=5qXnnlO7kmq8KXinp8tIkwKgaF8XM9siD+0byK0/zq8=; b=M8/mz+eyAlyfMgz8Dghdy0FDKnlqLnjDfqt/nM2I3GX38wrVekFWE0Fr0LXt1LW3LQ Np/PbIZaDfCFOpsW3l+hDxy4LTQpbeIezhApiAXG5rbI8LirGbjJWPNo807TYbkQvpLJ Xu7xHrfVxnHnzpdPPAN/WA8zwPmNjOfpNgxep8a0lWSqXIS0IRQy90EibX/wsAowrgo7 Fc0hAtp0Nb4EctGeEktvknQuXfy56bacIFMmrOsTwnmpErDxpQrLiKHlRkQtTpnz6s2O 6ODfl68mvPyD0WZxF8sJBzuXYWWwDZUpgTkvNPODZkRMQAvbWnxunRhBB2qKkq6Vu8Il xD5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PURW0SUz; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si8136062pgk.506.2021.10.12.00.45.56; Tue, 12 Oct 2021 00:46:09 -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=@redhat.com header.s=mimecast20190719 header.b=PURW0SUz; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234326AbhJLHqo (ORCPT + 99 others); Tue, 12 Oct 2021 03:46:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24172 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234082AbhJLHqk (ORCPT ); Tue, 12 Oct 2021 03:46:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634024678; 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=5qXnnlO7kmq8KXinp8tIkwKgaF8XM9siD+0byK0/zq8=; b=PURW0SUzTEZnsShmhYPR70zfxi31XpUysg6nrNzdnSFY8OZn4+onzw5ZMWAFN167nFb0Og 0fNLH/f+NJeEFucNcURfmfOTFTspAlmAL9ScrAYQ2SjCrV/fiuAE9f3fN5Q+mcTo3x7hhq lRvYc9YBiJVbuQC47YTz7eOxsWj9+ik= 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-568-cMSfTfroPXyUzmUYnQOPuQ-1; Tue, 12 Oct 2021 03:44:37 -0400 X-MC-Unique: cMSfTfroPXyUzmUYnQOPuQ-1 Received: by mail-wr1-f69.google.com with SMTP id a15-20020a056000188f00b00161068d8461so4726403wri.11 for ; Tue, 12 Oct 2021 00:44:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=5qXnnlO7kmq8KXinp8tIkwKgaF8XM9siD+0byK0/zq8=; b=DIJPtSm5NGEubkbURqCezczX98mQtOu0XFvXcy5uLzpqND3QK/4K0w1QQsxULc6900 iwp0j03gl4JpYxkD8e/L+9UjdEcjRcNesPyNGQM2IgzjXJ/GmtvTPqGkognW0Rl0Tq2a wWJl+wrn5FNyStp2/6oS8SPFVjMOm3G/mnW4hR4UZNKAcL78feSwCf9J4XHMeOkFeT9J fqouDHPD0UkxF6Gw4josoa99d7ZM3qQRcvAXuua5tYvU+Z8AsWShKcORKSuusAz+Yqzp yLuM4j81BZEB59QwCLM4wHpmxTWVNgU5CpE/CLL2hDqxpainiIi/ZlVK8L1VfIjM0jNV zN4Q== X-Gm-Message-State: AOAM533BvW5qM57gNdKadRsNyb2wSuFF+qcq9127xATfpNSx0h+ep/VU ZMcqaMvOW1ZsySlrAoW70ZUjJ6J6QVcxkcXrOBro0b+TREkJxZPLl9UCCGHOM1bNi/tjAqxA+EH ojaK0L3fMSGdTJAvW3RuXwidA X-Received: by 2002:adf:ee8a:: with SMTP id b10mr21815776wro.335.1634024676371; Tue, 12 Oct 2021 00:44:36 -0700 (PDT) X-Received: by 2002:adf:ee8a:: with SMTP id b10mr21815766wro.335.1634024676163; Tue, 12 Oct 2021 00:44:36 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6a12.dip0.t-ipconnect.de. [91.12.106.18]) by smtp.gmail.com with ESMTPSA id s13sm1740601wmc.47.2021.10.12.00.43.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Oct 2021 00:44:35 -0700 (PDT) To: Suren Baghdasaryan , Michal Hocko Cc: 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 References: <92cbfe3b-f3d1-a8e1-7eb9-bab735e782f6@rasmusvillemoes.dk> <20211007101527.GA26288@duo.ucw.cz> <202110071111.DF87B4EE3@keescook> <202110081344.FE6A7A82@keescook> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v10 3/3] mm: add anonymous vma name refcounting Message-ID: <26f9db1e-69e9-1a54-6d49-45c0c180067c@redhat.com> Date: Tue, 12 Oct 2021 09:43:56 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. 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. -- Thanks, David / dhildenb