On Wed, Aug 21, 2024 at 11:26 AM Bernd Schubert <bernd.schubert@xxxxxxxxxxx> wrote: > > > > On 8/21/24 17:56, Miklos Szeredi wrote: > > On Mon, 19 Aug 2024 at 20:25, Joanne Koong <joannelkoong@xxxxxxxxx> wrote: > >> > >> In the case where the aux writeback list is dropped (eg the pages > >> have been truncated or the connection is broken), the stats for > >> its pages and backing device info need to be updated as well. > > > > Patch looks good. Thanks. > > > > Do you have a reproducer or was this found by code review only? Hi Miklos! I unfortunately don't have a repro, this was found by code review. I started looking at the writeback code after reading through this thread https://lore.kernel.org/all/495d2400-1d96-4924-99d3-8b2952e05fc3@xxxxxxxxxxxxxxxxx/#t For v2 of this patchset, I am planning to add a few more refactoring patches like abstracting out the shared logic between fuse_writepages_fill() and fuse_writepage_locked(). My plan is to submit v2 this week. > > That's indeed a nice catch from Joanne!. > > I would have expected that writing to a file and in parallel truncating > it would leak WritebackTmp in /proc/meminfo. But I see it going up and > always to 0 again. I think we only hit this leaked case when we're writing back to a page that is already in writeback (which then leads it to being placed on the auxiliary list). I think in your example, the page isn't already in writeback? > > > Thanks, > Bernd Thanks, Joanne