Re: [RFC PATCH v2 1/3] fs/drop_caches: skip filesystems without page cache

From: Christoph Hellwig

Date: Tue Sep 22 2026 - 01:43:59 EST


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

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.