Re: [RFC PATCH 1/3] fs/drop_caches: do not scan procfs in drop_pagecache_sb()

From: Huang Shijie

Date: Mon Sep 14 2026 - 08:25:00 EST


On Mon, Sep 14, 2026 at 07:59:09PM +0800, Huang Shijie wrote:
> On Mon, Sep 14, 2026 at 12:19:03PM +0300, Alexey Dobriyan wrote:
> > On Mon, Sep 14, 2026 at 02:14:47PM +0800, Huang Shijie wrote:
> > > There is no page cache for the procfs, so do not scan the
> > > inodes in procfs.
> >
> > > @@ -20,6 +21,9 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
> > > {
> > > struct inode *inode, *toput_inode = NULL;
> > >
> > > + if (sb->s_magic == PROC_SUPER_MAGIC)
> > > + return;
> >
> > This should be some flag somewhere in superblock.
> > Other fake filesystems don't support pagecache too.
> yes.
>
> It seems it is better to check like this:
> if (sb->s_bdi == &noop_backing_dev_inf)
> return;
>
I find check noop_backing_dev_info is not right, the tmpfs may also use it.

It seems there is no flag in superblock for us.
If we have no choice, I can add a new flag for it.