Re: [RFC PATCH v2 1/3] fs/drop_caches: skip filesystems without page cache
From: Huang Shijie
Date: Wed Sep 23 2026 - 01:54:48 EST
On Mon, Sep 21, 2026 at 10:41:26PM -0700, Christoph Hellwig wrote:
> On Sun, Sep 20, 2026 at 03:28:09PM +0800, Huang Shijie wrote:
> > Add a new flag SB_I_NO_PAGECACHE for superblock.
> >
> > Skip scanning the inode lists of filesystems that have no page cache
> > in drop_pagecache_sb(), as indicated by the SB_I_NO_PAGECACHE flag.
>
> I don't think we need a new flag. This can check for
>
> sb->s_bdi == &noop_backing_dev_info
>
Okay. I can use this method.
> which is actually the more relevant concept - not if a file system
> uses the page cache, but if it supports page cache writeback.
> E.g. for ramfs there is page cache, but it is the only data store.
> For shmemfs, there is writeback, but it is driven in a different
> way (through the anonymous memory code and not fs writeback).
>
> And most importantly it just work, no need to mark file systems,
> as you're currently missing a lot of those that can have a fair
> number of inodes, e.g., sysfs, kernfs, cgroupfs or configfs.
>
I ever added support for these file systems, but I deleted the code before
I sent out this patch.
To Jan Kara,
thanks for the information about the issue.
I will check the inode iteration issue firstly.
Thanks
Huang Shijie