Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp278805rwb; Wed, 10 Aug 2022 08:09:02 -0700 (PDT) X-Google-Smtp-Source: AA6agR54m3yIYsamTXLwUUh80gQ9GLPObpri2VFwwUpgSKyXJ2Ld4SWnswIL+J7mUIYsb5Xz/S4m X-Received: by 2002:a05:6a00:174b:b0:52f:c4d1:d130 with SMTP id j11-20020a056a00174b00b0052fc4d1d130mr6391318pfc.23.1660144142417; Wed, 10 Aug 2022 08:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660144142; cv=none; d=google.com; s=arc-20160816; b=nMeOM7QMYoMwTVWHN+1ViBGDClvhEENn7VPmOyh3uMywySu6OyP2R1LN38Ow6x4pBr JP46cjPqBKVdWe+iEB+wGVto0Cjtvr3tNCkeduknC/s8lOpo4JZtxhyJjK4p6jQk2sVB x7dxVy99zvMNws3vapGV8k8XV+TdbALoJigayk8ajdhl/q/gEcJMP+qpFt1N9SXLsHrM YilYJUkUBmYAJNbcdNOwrsCYjGRFjCCMvPRimerNiOA2naA19kp3znHHIv7yjtYsNotf dh7MjeLmszOhwdegY+sOwG1e4uPEn9awOchL68d6vG3/dvZB1VYgfN3u0MQdSJGj9iBk ccUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ypn04yBcDr+ITRCaJvIIISj7ZAHB/5ZItGV+XVBLIJA=; b=aS3z9W/LGYlPUMs+kSnqes/b7DDPk28S312iIA9shvqEQzOPYuyQ7k9Gj+YzjFJ41+ bSDfquUSQsVoXf/IWBDYQh4U8RVdN8XHtnY+37r429ac1lLkmDUMCrKWM0mmmWGKKaSA PnQq7mISd/uHs07ZXnTzPAuRGsSvPzm0ymEe5Teo8rNNcBIfVCN3AZw5AQuTSCh+pRxn twhy8YVn5jCRTeKq1+8e3zAdogLLnGso8Sex7bQCsk5fnxF6IixFro5VkdkeJc7VL21k 8Np9U/AOhzOYPpaXWB5D6Etl+3Eu+u4AVecy20yUuT3d0AzbmT6r5/gL11kC+7L6x1dE 3Q+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Ib7E12JP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a62e918000000b0052e3d468e9esi2576159pfh.369.2022.08.10.08.08.45; Wed, 10 Aug 2022 08:09:02 -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=@google.com header.s=20210112 header.b=Ib7E12JP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232554AbiHJOi7 (ORCPT + 99 others); Wed, 10 Aug 2022 10:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232276AbiHJOit (ORCPT ); Wed, 10 Aug 2022 10:38:49 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4147A491EE for ; Wed, 10 Aug 2022 07:38:48 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so2304644pjf.5 for ; Wed, 10 Aug 2022 07:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=Ypn04yBcDr+ITRCaJvIIISj7ZAHB/5ZItGV+XVBLIJA=; b=Ib7E12JPGES3Yh+/p5apucZMNbtgTR05tdzqgOSPvuWuFN40kpN7Y2iwzMoGGvkAZp 2k6pDQ5Dx3ZoMZNesLC3dNSPLtDlj6mFmyXD/hvHO01hHIZDaQ/OR4FrBHZGfdNO21hw c0Xp2gA8KqMlXerNeIQmKwkXlI8cJezWd5Q2pb36QkpOhC2IVatzB9PBUsADaiqPqXP2 sLaur3TZOTh5i5zvWHRfjklZ2CiHLPAi2y2CsipxjSxRi1GYU+xZki37dsLL1ac5Lqxt CFqKYU6lzhVRJu4rIj89PYEW8X9BB+MXX2MHW1+4lVn1QpHvQgzsA9lEsg8UN0bQzIeg NyJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=Ypn04yBcDr+ITRCaJvIIISj7ZAHB/5ZItGV+XVBLIJA=; b=w3wSBjT3LQVs5OvHIqCPU9gZAqoZdZrE3ZlQeD90CdIOMzlAv+LwHcydW2hXu4f2lw rpC3b2OwGvCRRFw43SXa4p2ew2J7mi1dCYDEttxiWbNqai63gF0H/hxxqpAmce5/HE2b UHxRTzels/PbqpIiaFM9xOBFBf9f5Wb6DvZwJblMz8a69zZtx2xTXNp/KvEAIby8pksC xZbgSPg65Zjya0ZBLtNEKgEqx/tnOy7sxj4iVxklgRmgoSuSJoEtwy7Mb1eBa1/I4MuR vYGCr7OzG2s3fQUHjX84wX586tfK73gYtLbmc8oWpJMU7bWto5Ii1Yh5Lo9AoIBYrtMv zb0w== X-Gm-Message-State: ACgBeo3+iJk15thVbidqax1iZWNRH4+0RoTa6jVPzhAe5wbpSeZzFOPo yF6PffQJvpbJRMKMpgF6vVP8Aw== X-Received: by 2002:a17:90b:4c0f:b0:1f5:179a:28df with SMTP id na15-20020a17090b4c0f00b001f5179a28dfmr4088508pjb.42.1660142327422; Wed, 10 Aug 2022 07:38:47 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id z125-20020a623383000000b0052c92329115sm2033721pfz.218.2022.08.10.07.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Aug 2022 07:38:47 -0700 (PDT) Date: Wed, 10 Aug 2022 14:38:43 +0000 From: Sean Christopherson To: David Hildenbrand Cc: Chao Peng , 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 , 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 , Will Deacon Subject: Re: [PATCH v7 03/14] mm: Introduce memfile_notifier Message-ID: 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> <00f1aa03-bc82-ffce-569b-e2d5c459992c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00f1aa03-bc82-ffce-569b-e2d5c459992c@redhat.com> X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no 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 +Will On Wed, Aug 10, 2022, David Hildenbrand wrote: > 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?! :) FWIW, I don't really like the memfile name either. > 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. ARM's pKVM implementation is potentially (hopefully) going to switch to this API (as a consumer) sooner than later. If they anticipate being able to use memfd, then there's unlikely to be a second backing type any time soon. Quentin, Will? > 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? I don't think you're missing anything. I'd still prefer a name that doesn't couple KVM to memfd, but it's not a sticking point, and I've never been able to come up with a better name... With a little bit of cleverness I think we can keep the coupling in KVM to a minimum, which is what I really care about.