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 765F3C433F5 for ; Tue, 12 Oct 2021 07:44:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CF4C60D43 for ; Tue, 12 Oct 2021 07:44:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234363AbhJLHqp (ORCPT ); Tue, 12 Oct 2021 03:46:45 -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-Google-Smtp-Source: ABdhPJxHGKdxQCouYshY4aHJhSF1VyN+YjnwylycEyRo5FvejOGeaHtR7VXF5SvMyOExKtPUdEbvdA== 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