Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6924113rwb; Wed, 10 Aug 2022 03:42:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FbHTEd3nL8FKKzlm2L6LLM3Gpf8emkMoABZFOdpmoiSE33YX3TZymLRgH78LtZk0gyyWY X-Received: by 2002:a17:907:168e:b0:731:4ba0:d5e9 with SMTP id hc14-20020a170907168e00b007314ba0d5e9mr11238912ejc.204.1660128138864; Wed, 10 Aug 2022 03:42:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660128138; cv=none; d=google.com; s=arc-20160816; b=Y2fvCfHlBbttG956AHjYQ+95l9YTP9GBjcc7FmJsVq5mTcQbt2LyWTvvazd9PQLsXj AnvCb4Wbg6dN242blvz/rGKfbLMm89MU8R+5uG397wW20FUP9vchO81YxAq+JErL+3Bs hL1HDQpopQAwGxiv3me2yuqipLZEguYfGYaX6g/2MkUyFnkJLt59JwUa5LWIh2IEbUKd E0UMWcMTAjEdUci/FaMDD6E6ZBgB3/+k+5tER9/94imURdv32Ed7D6hcPZ1J3TkOphh9 okzuFZZbb398Wq/xdPllomXFgEB8SPHW82vp+RAaUgdqhOa+OcEVPLPs3hQ8QKvYU9g9 0Wdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :organization:from:references:cc:to:content-language:user-agent :mime-version:date:message-id:dkim-signature; bh=83RYZm97KNj9NYPWWYz4fzmlCpq267m27613RMfC+Pg=; b=oTWvvRPwWMz6/Fov8p7YRB+zI92s61QZXCwlcdkXtRNxd3IT/pbjds1OGo2pu8BEma zC2j3b70QSfoolBkhI2wHZbyAeZAUGouG4QI4dURwWhebUMMgpVXVZ6mNzhQBp4Avel/ idZ5aUJx+vvI09EmfBjoFaQnPLynpYBHmPWtgq2+vPHWFLFTUzwTo65TVP290uaCQXFb MHFDMdiDvluPuj+n34oMgLlLAxR9oEzmsKJ4cUDvRaybjKOJpUFzpBOdu2Dco5pR1s73 PmtWUbOSBh9rU+n+ZugrCeA/zushTt//ZMdsUolWjQFQg3p/3u7tBxh8TDbLZXw/Kr3Z pMJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IIZEyIQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a056402440300b0043d1a40068csi13603122eda.321.2022.08.10.03.41.52; Wed, 10 Aug 2022 03:42:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IIZEyIQQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231605AbiHJKFx (ORCPT + 99 others); Wed, 10 Aug 2022 06:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbiHJKFv (ORCPT ); Wed, 10 Aug 2022 06:05:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 90B4857203 for ; Wed, 10 Aug 2022 03:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660125949; 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=IIZEyIQQPtGRG9EyYqMlVQDnV+LdzXpGj3UR8IYPuBM57bXue9z0EgAnQyH/Fpz2samhor BTY4ymfwvUKNMjM732aySfeA9Z28UNP5D1KZm0hQySVJV7exrq0KVq0ggsb3NOaODmL8Zp Psc/TxrGwyu9syqNbDougMeiFaJ0PJI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-Ry43TNeoMXSk9HFFPrfuVA-1; Wed, 10 Aug 2022 06:05:46 -0400 X-MC-Unique: Ry43TNeoMXSk9HFFPrfuVA-1 Received: by mail-wm1-f69.google.com with SMTP id v11-20020a1cf70b000000b003a318238826so415651wmh.2 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=JohY13GCJLjWujCVq38P9GGMqBHrv5drsC6b/5Zleno/ASwaP9JEMcTNtgU4BbvUbS j1z42b/enPskAhRPrGst/Lb9vdYY/FYq5YVkFI/tLhQpSNYTbOIp5qGrrKe9UTrLoiVh ANYwePtepCyyuferin9tEUnShrHkIOgJoKJOYTldGPIpMIaypjbjrwOqPxKSCEpbyl8q ZfJR7QliFCEMlCnE2SokWG2jiy1VLf1dcVZxWXmgPIEnFJoNl/Jt42Bh1U6MVdaeqnrg 2UBnC6CXxWBazBDWBZ2o0GRHitZB4K17RVDrknagy5xaqj1mCtJ7BQDdE4KIxcJowS9n Rxdg== X-Gm-Message-State: ACgBeo0OIeWmghMFGJHdxC2rhjtu+07BHwpV2QTst+F8YwZD76eCUpYu X6CfvKYCqzLthbM5S7nMfEYHCsfvr0AD02Sf/9GmPazL09A3wdcUGSGVVHrE3ptyE5HwEWwO6nz 5IJ4i9Ht7r2z5IvLbiLbUpVuR X-Received: by 2002:a5d:64ae:0:b0:220:6c4c:5a60 with SMTP id m14-20020a5d64ae000000b002206c4c5a60mr17058815wrp.636.1660125944502; Wed, 10 Aug 2022 03:05:44 -0700 (PDT) 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 Content-Language: en-US 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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