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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC604C00140 for ; Wed, 10 Aug 2022 10:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231614AbiHJKFx (ORCPT ); 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-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 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 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