[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aYzf-hS4pUY9ulss@x1.local>
Date: Wed, 11 Feb 2026 15:00:58 -0500
From: Peter Xu <peterx@...hat.com>
To: Mike Rapoport <rppt@...nel.org>
Cc: linux-mm@...ck.org, Andrea Arcangeli <aarcange@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
David Hildenbrand <david@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
James Houghton <jthoughton@...gle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Michal Hocko <mhocko@...e.com>, Muchun Song <muchun.song@...ux.dev>,
Nikita Kalyazin <kalyazin@...zon.com>,
Oscar Salvador <osalvador@...e.de>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Shuah Khan <shuah@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Vlastimil Babka <vbabka@...e.cz>, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, linux-kselftest@...r.kernel.org
Subject: Re: [PATCH RFC 10/17] shmem, userfaultfd: implement shmem uffd
operations using vm_uffd_ops
On Sun, Feb 08, 2026 at 12:35:43PM +0200, Mike Rapoport wrote:
> > > +static void shmem_mfill_filemap_remove(struct folio *folio,
> > > + struct vm_area_struct *vma)
> > > +{
> > > + struct inode *inode = file_inode(vma->vm_file);
> > > +
> > > + filemap_remove_folio(folio);
> > > + shmem_recalc_inode(inode, 0, 0);
> > > folio_unlock(folio);
> > > - folio_put(folio);
> > > -out_unacct_blocks:
> > > - shmem_inode_unacct_blocks(inode, 1);
> >
> > This looks wrong, or maybe I miss somewhere we did the unacct_blocks()?
>
> This is handled by shmem_recalc_inode(inode, 0, 0).
IIUC shmem_recalc_inode() only does the fixup of shmem_inode_info over
possiblly changing inode->i_mapping->nrpages. It's not for reverting the
accounting in the failure paths here.
OTOH, we still need to maintain accounting for the rest things with
correctly invoke shmem_inode_unacct_blocks(). One thing we can try is
testing this series against either shmem quota support (since 2023, IIUC
it's relevant to "quota" mount option), or max_blocks accountings (IIUC,
"size" mount option), etc. Any of those should reflect a difference if my
understanding is correct.
So IIUC we still need the unacct_blocks(), please kindly help double check.
Thanks,
--
Peter Xu
Powered by blists - more mailing lists