All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <huangsj@hygon.cn>
To: Jan Kara <jack@suse.cz>
Cc: <axboe@kernel.dk>, <viro@zeniv.linux.org.uk>,
	<brauner@kernel.org>, <zhongyuan@hygon.cn>,
	<fangbaoshun@hygon.cn>, <yingzhiwei@hygon.cn>,
	<agruenba@redhat.com>, <mic@digikod.net>, <gnoack@google.com>,
	<paul@paul-moore.com>, <jmorris@namei.org>, <serge@hallyn.com>,
	<aleksa@amutable.com>, <legion@kernel.org>, <david@kernel.org>,
	<sandeen@redhat.com>, <ebiggers@kernel.org>,
	<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-fsdevel@vger.kernel.org>, <gfs2@lists.linux.dev>,
	<linux-security-module@vger.kernel.org>,
	<sunjunchao@bytedance.com>
Subject: Re: [PATCH 3/3] vfs: convert sb->s_inodes iteration to super_iter_inodes()
Date: Tue, 10 Nov 2026 14:29:26 +0800	[thread overview]
Message-ID: <avK5xg_TYW66t2PE@hsj-2U-Workstation> (raw)
In-Reply-To: <wrknznlm52ffratfpdoe3otqhkgyd45vgmvtjkixrvurwpplyu@sfpz3yiwhidy>

在 Mon, Nov 09, 2026 at 11:31:41AM +0100,Jan Kara 写道:
> > +static int sync_bdev_fn(struct inode *inode, void *data)
> >  {
> > -	struct inode *inode, *old_inode = NULL;
> > +	struct block_device *bdev;
> > +	bool wait = *(bool *)data;
> >  
> > -	spin_lock(&blockdev_superblock->s_inode_list_lock);
> > -	list_for_each_entry(inode, &blockdev_superblock->s_inodes, i_sb_list) {
> > -		struct address_space *mapping = inode->i_mapping;
> > -		struct block_device *bdev;
> > +	if (inode->i_mapping->nrpages == 0)
> 
> Seeing these various checks iterators are doing before actually paying the
> cost of grabbing (and dropping) the inode reference, I'd add a
> ->elegible(inode) function to the iterator which will get called under
> i_lock after other checks pass and can decide inode is not worth bothering
> with and put the checks there. If it is NULL, the behavior would be as
> currently.
Okay.
I will add the ->eligible() function to the iterator in next version.

Thanks
Huang Shijie


  reply	other threads:[~2026-11-10  6:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  9:38 [PATCH 0/3] vfs: add inode iteration method super_iter_inodes Huang Shijie
2026-10-15  9:38 ` [PATCH 1/3] " Huang Shijie
2026-10-15 15:23   ` Stephen Smalley
2026-10-16  2:45     ` Huang Shijie
2026-11-09  9:58   ` Jan Kara
2026-11-10  2:32     ` Huang Shijie
2026-11-09 10:43   ` Jan Kara
2026-11-10  2:38     ` Huang Shijie
2026-10-15  9:38 ` [PATCH 2/3] vfs: convert inode iterators to the unsafe super_iter_inodes() Huang Shijie
2026-11-09 10:08   ` Jan Kara
2026-11-10  4:01     ` Huang Shijie
2026-10-15  9:38 ` [PATCH 3/3] vfs: convert sb->s_inodes iteration to super_iter_inodes() Huang Shijie
2026-11-09 10:31   ` Jan Kara
2026-11-10  6:29     ` Huang Shijie [this message]
2026-10-21 10:58 ` [PATCH 0/3] vfs: add inode iteration method super_iter_inodes Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avK5xg_TYW66t2PE@hsj-2U-Workstation \
    --to=huangsj@hygon.cn \
    --cc=agruenba@redhat.com \
    --cc=aleksa@amutable.com \
    --cc=axboe@kernel.dk \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=fangbaoshun@hygon.cn \
    --cc=gfs2@lists.linux.dev \
    --cc=gnoack@google.com \
    --cc=jack@suse.cz \
    --cc=jmorris@namei.org \
    --cc=legion@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=paul@paul-moore.com \
    --cc=sandeen@redhat.com \
    --cc=serge@hallyn.com \
    --cc=sunjunchao@bytedance.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yingzhiwei@hygon.cn \
    --cc=zhongyuan@hygon.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.