From: Jan Kara <jack@suse.cz>
To: 郭纯海 <guochunhai@vivo.com>
Cc: Jan Kara <jack@suse.cz>, "chao@kernel.org" <chao@kernel.org>,
"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
"brauner@kernel.org" <brauner@kernel.org>,
"viro@zeniv.linux.org.uk" <viro@zeniv.linux.org.uk>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: 答复: [PATCH] fs-writeback: writeback_sb_inodes: Do not increase 'total_wrote' when nothing is written
Date: Thu, 14 Sep 2023 08:58:53 +0200 [thread overview]
Message-ID: <20230914065853.qmvkymchyamx43k5@quack3> (raw)
In-Reply-To: <TY2PR06MB3342ED6EB614563BCC4FD23FBEF7A@TY2PR06MB3342.apcprd06.prod.outlook.com>
On Thu 14-09-23 04:12:31, 郭纯海 wrote:
> > On Wed 13-09-23 07:15:01, Chunhai Guo wrote:
> > > From the dump info, there are only two pages as shown below. One is
> > > updated and another is under writeback. Maybe f2fs counts the
> > > writeback page as a dirty one, so get_dirty_pages() got one. As you
> > > said, maybe this is unreasonable.
> > >
> > > Jaegeuk & Chao, what do you think of this?
> > >
> > >
> > > crash_32> files -p 0xE5A44678
> > > INODE NRPAGES
> > > e5a44678 2
> > >
> > > PAGE PHYSICAL MAPPING INDEX CNT FLAGS
> > > e8d0e338 641de000 e5a44810 0 5 a095
> > locked,waiters,uptodate,lru,private,writeback
> > > e8ad59a0 54528000 e5a44810 1 2 2036
> > referenced,uptodate,lru,active,private
> >
> > Indeed, incrementing pages_skipped when there's no dirty page is a bit odd.
> > That being said we could also harden requeue_inode() - in particular we could do
> > there:
> >
> > if (wbc->pages_skipped) {
> > /*
> > * Writeback is not making progress due to locked buffers.
> > * Skip this inode for now. Although having skipped pages
> > * is odd for clean inodes, it can happen for some
> > * filesystems so handle that gracefully.
> > */
> > if (inode->i_state & I_DIRTY_ALL)
> > redirty_tail_locked(inode, wb);
> > else
> > inode_cgwb_move_to_attached(inode, wb);
> > }
> >
> > Does this fix your problem as well?
> >
> > Honza
>
> Thank you for your reply. Did you forget the 'return' statement? Since I encountered this issue on the 4.19 kernel and there is not inode_cgwb_move_to_attached() yet, I replaced it with inode_io_list_del_locked(). So, below is the test patch I am applying. Please have a check. By the way, the test will take some time. I will provide feedback when it is finished. Thanks.
Yeah, I forgot about the return.
> if (wbc->pages_skipped) {
> /*
> * writeback is not making progress due to locked
> * buffers. Skip this inode for now.
> */
> - redirty_tail_locked(inode, wb);
> + if (inode->i_state & I_DIRTY_ALL)
> + redirty_tail_locked(inode, wb);
> + else
> + inode_io_list_del_locked(inode, wb);
> return;
> }
Looks good. Thanks for testing!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-09-14 6:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-13 13:15 [PATCH] fs-writeback: writeback_sb_inodes: Do not increase 'total_wrote' when nothing is written Chunhai Guo
2023-09-13 15:16 ` Jan Kara
2023-09-14 4:09 ` 答复: " 郭纯海
2023-09-14 4:12 ` 郭纯海
2023-09-14 6:58 ` Jan Kara [this message]
2023-09-15 9:57 ` Chunhai Guo
2023-09-16 6:01 ` 答复: " Chunhai Guo
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=20230914065853.qmvkymchyamx43k5@quack3 \
--to=jack@suse.cz \
--cc=brauner@kernel.org \
--cc=chao@kernel.org \
--cc=guochunhai@vivo.com \
--cc=jaegeuk@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).