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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C57FAC00140 for ; Wed, 10 Aug 2022 10:05:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E00E8E0002; Wed, 10 Aug 2022 06:05:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 068FB8E0001; Wed, 10 Aug 2022 06:05:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E238C8E0002; Wed, 10 Aug 2022 06:05:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D017C8E0001 for ; Wed, 10 Aug 2022 06:05:49 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9F89CA05CE for ; Wed, 10 Aug 2022 10:05:49 +0000 (UTC) X-FDA: 79783251618.04.CB0C06A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf19.hostedemail.com (Postfix) with ESMTP id D82DF1A014D for ; Wed, 10 Aug 2022 10:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660125948; 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=83RYZm97KNj9NYPWWYz4fzmlCpq267m27613RMfC+Pg=; b=LlRwtIO5hEf/lhLDTY3im+gy5alxiK3P+LTcsrT1Zj44x1wZ7EJmCZ6TbQfNlg0s6QsjE/ DxWPyk87Of4qemhyO8V5kxsUyuRfy07k5C0VTWjDRvEDU2tXgk/S77tJ/yFXNeILLc2Bkq t7b8p/AZXVya4eQtRfWggIgFJJUSxRI= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-ygcvF_N1MkW2-iSwHO1TNg-1; Wed, 10 Aug 2022 06:05:45 -0400 X-MC-Unique: ygcvF_N1MkW2-iSwHO1TNg-1 Received: by mail-wm1-f71.google.com with SMTP id x17-20020a05600c21d100b003a32dda6577so413658wmj.7 for ; Wed, 10 Aug 2022 03:05:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=83RYZm97KNj9NYPWWYz4fzmlCpq267m27613RMfC+Pg=; b=tVEp3yvSfe35tz8H+mxqErX7JItCQ+A9PFCrMckSmi31pADyl3cpOpKQ/e1KowRY1f LAc4QHj1+rByxwb0uQx8fWZlhRlX7583Yh8OJIaHqQBmO0GRQFKoda97rnMJTXzKyMKa b2vSduVKAVbrU+fLFZ7TR1lVkOHVjsqKeLFA/THQ5xY2A7388XYdU0jOgnRQUAESd6WA JdYOGMCn7fPx6GJo8ikZ7oYpwoFCXrM9tTOMQhWF5NzK7w3EC93oEfCB/cUlJZVTVQ4t ObA9J7gQE5BHIMSOipA9D8foJZdkiASV8l+YrG17cxhgJnqgTbQUbp0ZVDZgkvESTgKp 5SCg== X-Gm-Message-State: ACgBeo1R7vNNxAlmKXbN8IOn3II4gJbwmkKXIlgR0/Fd697j1EHuBuFe 4shNvdwoW8IwecLC8qYZ1UQH71p1PSuAZuoHrCdgS1XDGbRtF5cxlaVtEQF8VzBwOiMYKDBWALl cGjYTb+kdiCo= X-Received: by 2002:a5d:64ae:0:b0:220:6c4c:5a60 with SMTP id m14-20020a5d64ae000000b002206c4c5a60mr17058827wrp.636.1660125944511; Wed, 10 Aug 2022 03:05:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR5i72uisBNMVtDIvVDVfSxV1hzWrZROoCbvcTeBej4J7CIdnSDFuFoSBTJk3opG5+sXP+xgow== X-Received: by 2002:a5d:64ae:0:b0:220:6c4c:5a60 with SMTP id m14-20020a5d64ae000000b002206c4c5a60mr17058769wrp.636.1660125944245; Wed, 10 Aug 2022 03:05:44 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:1600:a3ce:b459:ef57:7b93? (p200300cbc7071600a3ceb459ef577b93.dip0.t-ipconnect.de. [2003:cb:c707:1600:a3ce:b459:ef57:7b93]) by smtp.gmail.com with ESMTPSA id t188-20020a1c46c5000000b003a327f19bf9sm1793951wma.14.2022.08.10.03.05.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Aug 2022 03:05:43 -0700 (PDT) Message-ID: <00f1aa03-bc82-ffce-569b-e2d5c459992c@redhat.com> Date: Wed, 10 Aug 2022 12:05:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Chao Peng Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220706082016.2603916-4-chao.p.peng@linux.intel.com> <13394075-fca0-6f2b-92a2-f1291fcec9a3@redhat.com> <20220810092232.GC862421@chaop.bj.intel.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v7 03/14] mm: Introduce memfile_notifier In-Reply-To: <20220810092232.GC862421@chaop.bj.intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660125949; h=from:from:sender: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:dkim-signature; bh=83RYZm97KNj9NYPWWYz4fzmlCpq267m27613RMfC+Pg=; b=glTq4lp1VqAF29sau+Y2audovRj/pk5m37VV01KWwLpDmlxyqDN5qVZE3EBZtKmjrEAuPL YZefk7GQd3Ba5Tvmb/sMCeL8WWYKMik/WBMUXrS6s7pR89iq4RC2zAlUJbLDm6d1V+Riwf 9NjNILkX6fAaWN9PMR0OpVn6ewrulAw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LlRwtIO5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660125949; a=rsa-sha256; cv=none; b=irU4Ch9G9Vfiw3FDostgb6pcQG5vOW1RGXSOEkAoBmWpEX0YIWaGopAMOntOuSHu7vjBMC O6ljDLfRhvCwon9T1uxZoGnDXpZIuQnrp6ELMygLmQzwr/s31aw9dBNOLlnw0yJQBnZYmO FKC89ANdNMrNfCsXQ9otorKbDuWThgM= X-Rspamd-Queue-Id: D82DF1A014D Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=LlRwtIO5; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 1f773dzjq8kkg4rm5qr8mhwtbcog6jyo X-HE-Tag: 1660125948-361915 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: On 10.08.22 11:22, Chao Peng wrote: > On Fri, Aug 05, 2022 at 03:22:58PM +0200, David Hildenbrand wrote: >> On 06.07.22 10:20, Chao Peng wrote: >>> This patch introduces memfile_notifier facility so existing memory file >>> subsystems (e.g. tmpfs/hugetlbfs) can provide memory pages to allow a >>> third kernel component to make use of memory bookmarked in the memory >>> file and gets notified when the pages in the memory file become >>> invalidated. >> >> Stupid question, but why is this called "memfile_notifier" and not >> "memfd_notifier". We're only dealing with memfd's after all ... which >> are anonymous files essentially. Or what am I missing? Are there any >> other plans for fs than plain memfd support that I am not aware of? > > There were some discussions on this in v3. > https://lkml.org/lkml/2021/12/28/484 > Sean commented it's OK to abstract it from memfd but he also wants the > kAPI (name) should not bind to memfd to make room for future non-memfd > usages. Sorry, but how is "memfile" any better? memfd abstracted to memfile?! :) I understand Sean's suggestion about abstracting, but if the new name makes it harder to grasp and there isn't really an alternative to memfd in sight, I'm not so sure I enjoy the tried abstraction here. Otherwise we'd have to get creative now and discuss something like "file_population_notifer" or "mapping_population_notifer" and I am not sure that our time is well spent doing so right now. ... as this is kernel-internal, we can always adjust the name as we please later, once we *actually* now what the abstraction should be. Until then I'd suggest to KIS and soft-glue this to memfd. Or am I missing something important? -- Thanks, David / dhildenb