[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <b3d59f69-3239-4c28-874a-4151e96cd0bf@amd.com>
Date: Mon, 11 Aug 2025 13:32:22 +0530
From: "Garg, Shivank" <shivankg@....com>
To: Ackerley Tng <ackerleytng@...gle.com>,
David Hildenbrand <david@...hat.com>, seanjc@...gle.com, vbabka@...e.cz,
willy@...radead.org, akpm@...ux-foundation.org, shuah@...nel.org,
pbonzini@...hat.com, brauner@...nel.org, viro@...iv.linux.org.uk
Cc: paul@...l-moore.com, jmorris@...ei.org, serge@...lyn.com, pvorel@...e.cz,
bfoster@...hat.com, tabba@...gle.com, vannapurve@...gle.com,
chao.gao@...el.com, bharata@....com, nikunj@....com, michael.day@....com,
shdhiman@....com, yan.y.zhao@...el.com, Neeraj.Upadhyay@....com,
thomas.lendacky@....com, michael.roth@....com, aik@....com, jgg@...dia.com,
kalyazin@...zon.com, peterx@...hat.com, jack@...e.cz, rppt@...nel.org,
hch@...radead.org, cgzones@...glemail.com, ira.weiny@...el.com,
rientjes@...gle.com, roypat@...zon.co.uk, ziy@...dia.com,
matthew.brost@...el.com, joshua.hahnjy@...il.com, rakie.kim@...com,
byungchul@...com, gourry@...rry.net, kent.overstreet@...ux.dev,
ying.huang@...ux.alibaba.com, apopple@...dia.com, chao.p.peng@...el.com,
amit@...radead.org, ddutile@...hat.com, dan.j.williams@...el.com,
ashish.kalra@....com, gshan@...hat.com, jgowans@...zon.com,
pankaj.gupta@....com, papaluri@....com, yuzhao@...gle.com,
suzuki.poulose@....com, quic_eberman@...cinc.com,
aneeshkumar.kizhakeveetil@....com, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
linux-security-module@...r.kernel.org, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-coco@...ts.linux.dev
Subject: Re: [PATCH V9 1/7] KVM: guest_memfd: Use guest mem inodes instead of
anonymous inodes
On 8/8/2025 3:04 AM, Ackerley Tng wrote:
> David Hildenbrand <david@...hat.com> writes:
>
>> On 13.07.25 19:43, Shivank Garg wrote:
>>> From: Ackerley Tng <ackerleytng@...gle.com>
>>>
>>> + ctx->ops = &kvm_gmem_super_operations;
>>
>> Curious, why is that required? (secretmem doesn't have it, so I wonder)
>>
>
> Good point! pseudo_fs_fill_super() fills in a struct super_operations
> which already does simple_statfs, so guest_memfd doesn't need this.
>
Right, simple_statfs isn't strictly needed in this patch, but the
super_operations is required for the subsequent patches in
the series which add custom alloc_inode, destroy_inode, and free_inode
callback.
>>> + if (!try_module_get(kvm_gmem_fops.owner))
>>> + goto err;
>>
>> Curious, shouldn't there be a module_put() somewhere after this function
>> returned a file?
>>
>
> This was interesting indeed, but IIUC this is correct.
>
> I think this flow was basically copied from __anon_inode_getfile(),
> which does this try_module_get().
>
> The corresponding module_put() is in __fput(), which calls fops_put()
> and calls module_put() on the owner.
>
>>> +
>>>
>>
>> Nothing else jumped at me.
>>
>
> Thanks for the review!
>
> Since we're going to submit this patch through Shivank's mempolicy
> support series, I'll follow up soon by sending a replacement patch in
> reply to this series so Shivank could build on top of that?
>
yes, I'll post the V10 soon.
Thanks,
Shivank
Powered by blists - more mailing lists