mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: busterbcook@yahoo.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: pdflush eating a lot of CPU on heavy NFS I/O
Date: Wed, 28 Apr 2004 21:47:41 -0700	[thread overview]
Message-ID: <20040428214741.7d5b3ae1.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0404282330390.13783@ozma.hauschen>

Brent Cook <busterbcook@yahoo.com> wrote:
>
> On Wed, 28 Apr 2004, Andrew Morton wrote:
> 
>  > Brent Cook <busterbcook@yahoo.com> wrote:
>  > >
>  > > sync_sb_inodes: write inode c55d25bc
>  > >  __sync_single_inode: writepages in nr_pages:25 nr_to_write:949
>  > >  pages_skipped:0 en:0
>  > >  __sync_single_inode: writepages in nr_pages:25 nr_to_write:949
>  > >  pages_skipped:0 en:0
>  >
>  > uh-huh.
>  >
>  > Does this fix it?
> 
>  I'm going to run a compile/load test overnight, but the test that
>  triggered it every time previously failed to do so with this patch.

OK, thanks.  A better patch would be:


diff -puN fs/fs-writeback.c~writeback-livelock-fix-2 fs/fs-writeback.c
--- 25/fs/fs-writeback.c~writeback-livelock-fix-2	2004-04-28 21:19:32.779061976 -0700
+++ 25-akpm/fs/fs-writeback.c	2004-04-28 21:20:11.080239312 -0700
@@ -176,11 +176,12 @@ __sync_single_inode(struct inode *inode,
 			if (wbc->for_kupdate) {
 				/*
 				 * For the kupdate function we leave the inode
-				 * where it is on sb_dirty so it will get more
+				 * at the head of sb_dirty so it will get more
 				 * writeout as soon as the queue becomes
 				 * uncongested.
 				 */
 				inode->i_state |= I_DIRTY_PAGES;
+				list_move_tail(&inode->i_list, &sb->s_dirty);
 			} else {
 				/*
 				 * Otherwise fully redirty the inode so that

_

>  pdflush is behaving so far, and I'll say you've figured it out for now,
>  with the final verdict in about 8 hours.
> 
>  Does this mean that, if there were too many dirty pages and not enough
>  time to write them all back, that the dirty page list just stopped being
>  traversed, stuck on a single page?

No..  There's all sorts of livelock avoidance code in there and I keep on
forgetting that sometimes writepage won't write the dang page at all -
instead it just redirties the page (and hence the inode).

Now, that redirtying of the inode _should_ have moved the inode off the
s_io list and onto the s_dirty list.  But for some reason it looks like it
didn't, so we get stuck in a loop.  I need to think about it a bit more.

  reply	other threads:[~2004-04-29  4:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-28  5:18 Brent Cook
2004-04-28  6:02 ` Andrew Morton
2004-04-28  7:29   ` Phy Prabab
2004-04-28 10:18   ` Sven Geggus
2004-04-28 13:50   ` Brent Cook
2004-04-28 19:48     ` Andrew Morton
2004-04-28 20:12       ` Brent Cook
2004-04-28 20:39       ` Brent Cook
2004-04-28 21:19         ` Trond Myklebust
2004-04-29  3:55           ` Brent Cook
2004-04-29  4:21             ` Trond Myklebust
2004-04-29  4:42               ` Andrew Morton
2004-04-29  1:24         ` Andrew Morton
2004-04-29  3:53           ` Brent Cook
2004-04-29  4:02             ` Andrew Morton
2004-04-29  4:03               ` Andrew Morton
2004-04-29  4:37               ` Brent Cook
2004-04-29  4:47                 ` Andrew Morton [this message]
2004-04-29  5:29                   ` Andrew Morton
2004-04-29 13:19                   ` Brent Cook
2004-04-29  3:54         ` Andrew Morton
2004-04-28  6:06 ` Brett E.

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=20040428214741.7d5b3ae1.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=busterbcook@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®