[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <diqz34zxg7tk.fsf@ackerleytng-ctop.c.googlers.com>
Date: Fri, 01 Sep 2023 16:46:31 +0000
From: Ackerley Tng <ackerleytng@...gle.com>
To: Binbin Wu <binbin.wu@...ux.intel.com>
Cc: kvm@...r.kernel.org, david@...hat.com, yu.c.zhang@...ux.intel.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
chao.p.peng@...ux.intel.com, linux-riscv@...ts.infradead.org,
isaku.yamahata@...il.com, maz@...nel.org, paul@...l-moore.com,
anup@...infault.org, chenhuacai@...nel.org, jmorris@...ei.org,
willy@...radead.org, wei.w.wang@...el.com, tabba@...gle.com,
jarkko@...nel.org, serge@...lyn.com, mail@...iej.szmigiero.name,
aou@...s.berkeley.edu, vbabka@...e.cz, michael.roth@....com,
paul.walmsley@...ive.com, kvmarm@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, qperret@...gle.com,
seanjc@...gle.com, liam.merwick@...cle.com,
linux-mips@...r.kernel.org, oliver.upton@...ux.dev,
linux-security-module@...r.kernel.org, palmer@...belt.com,
kvm-riscv@...ts.infradead.org, linux-fsdevel@...r.kernel.org,
pbonzini@...hat.com, akpm@...ux-foundation.org,
vannapurve@...gle.com, linuxppc-dev@...ts.ozlabs.org,
kirill.shutemov@...ux.intel.com
Subject: Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for
guest-specific backing memory
Binbin Wu <binbin.wu@...ux.intel.com> writes:
> <snip>
>
>>
>> I'm not sure whose refcount the folio_put() in kvm_gmem_allocate() is
>> dropping though:
>>
>> + The refcount for the filemap depends on whether this is a hugepage or
>> not, but folio_put() strictly drops a refcount of 1.
>> + The refcount for the lru list is just 1, but doesn't the page still
>> remain in the lru list?
>
> I guess the refcount drop here is the one get on the fresh allocation.
> Now the filemap has grabbed the folio, so the lifecycle of the folio now
> is decided by the filemap/inode?
>
This makes sense! So folio_put() here is saying, I'm not using this
folio anymore, but the filemap and the lru list are stil using the
folio.
> <snip>
Powered by blists - more mailing lists