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 021F0C433F5 for ; Tue, 12 Oct 2021 07:44:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B050760F23 for ; Tue, 12 Oct 2021 07:44:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B050760F23 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 34125900002; Tue, 12 Oct 2021 03:44:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F1396B0071; Tue, 12 Oct 2021 03:44:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B913900002; Tue, 12 Oct 2021 03:44:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0218.hostedemail.com [216.40.44.218]) by kanga.kvack.org (Postfix) with ESMTP id 0BDA46B006C for ; Tue, 12 Oct 2021 03:44:40 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B4B0618206D37 for ; Tue, 12 Oct 2021 07:44:39 +0000 (UTC) X-FDA: 78686998278.07.19365B7 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 3D72130AF242 for ; Tue, 12 Oct 2021 07:44:39 +0000 (UTC) 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-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-19-cBU94U-FPlO0_WYQ50wgHw-1; Tue, 12 Oct 2021 03:44:37 -0400 X-MC-Unique: cBU94U-FPlO0_WYQ50wgHw-1 Received: by mail-wr1-f72.google.com with SMTP id r25-20020adfab59000000b001609ddd5579so15057808wrc.21 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=IljGzZtXv39iWccHwXdHmo/916KPWuUolWKQPz3JHAULNTB2KCRPC/qaU5mrovhweq x5sE/3RVTCOzzotJByFrJiJdHMSZb63oH5PqveHcEDQglneco9ty6RMDjKPvzm6khNOG 0LZQVq8/Efy0XTZfic6Q7coXrIEZN/zZ1gOUEJJuagr8CGccXeMRDWj7mPkNKSwHtKsg VYTctlxrJcpXX811TaCWJpppwjH/HLNozO5lNL10lhyOzmgG2/qbKxG1E2e5md4X9qPM 5ocaH6sNIvj4v5wV+YwNVED+R7dZO9tAQ7ZipTFh353UlahXJRniHecOyZEW5qcfoloQ kIjg== X-Gm-Message-State: AOAM532yLjc42eNgmc0it0S8E8h1FOLEkDY2GDPNtHh+y7AxgHuvLXCP AXvQpTR3Dx+pF0FF15vJSfR9ONY8WB0Fkn9o2Rjcjs6XAqt2x2wcvSjIIxIQlNaSlJrJhsmYsNA /O90oeUcoGiw= X-Received: by 2002:adf:ee8a:: with SMTP id b10mr21815822wro.335.1634024676380; 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: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=PURW0SUz; spf=none (imf09.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3D72130AF242 X-Stat-Signature: twaw1mf8fgtc5accpkgz8myck4z8nbiq X-HE-Tag: 1634024679-511223 Content-Transfer-Encoding: quoted-printable 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: > 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=20 I think it just has to be fixed. It doesn't make any sense to allocate a=20 page for the pagecache ("populate the file") when accessing via a=20 private mapping that's supposed to leave the file untouched] My gut feeling is if you really need a string as identifier, then try=20 going with memfds. Yes, we might hit some road blocks to be sorted out,=20 but it just logically makes sense to me: Files have names. These names=20 exist before mapping and after mapping. They "name" the content. Maybe it's just me, but the whole interface, setting the name via a=20 prctl after the mapping was already instantiated doesn't really spark=20 joy at my end. That's not a strong pushback, but if we can avoid it=20 using something that's already there, that would be very much preferred. --=20 Thanks, David / dhildenb