mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Jan Kara <jack@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Jens Axboe <jens.axboe@oracle.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	jengelh@medozas.de, stable@kernel.org, gregkh@suse.de
Subject: Re: [PATCH] writeback: Fix broken sync writeback
Date: Wed, 17 Feb 2010 12:57:34 +1100	[thread overview]
Message-ID: <20100217015734.GH28392@discord.disaster> (raw)
In-Reply-To: <20100217013336.GK3153@quack.suse.cz>

On Wed, Feb 17, 2010 at 02:33:37AM +0100, Jan Kara wrote:
> On Tue 16-02-10 15:34:01, Linus Torvalds wrote:
> > On Wed, 17 Feb 2010, Jan Kara wrote:
> > >
> > >   The IO size actually does matter for performance because if you switch
> > > after 4 MB (current value of MAX_WRITEBACK_PAGES) to writing another inode,
> > 
> > No.
> > 
> > Dammit, read the code.
> > 
> > That's my whole _point_. Look at the for-loop.
> > 
> > We DO NOT SWITCH to another inode, because we just continue in the 
> > for-loop.
> > 
> > This is why I think your patch is crap. You clearly haven't even read the 
> > code, the patch makes no sense, and there must be something else going on 
> > than what you _claim_ is going on.
>   I've read the code. Maybe I'm missing something but look:
> writeback_inodes_wb(nr_to_write = 1024)
>   -> queue_io() - queues inodes from wb->b_dirty list to wb->b_io list
>   ...
>   writeback_single_inode()
>     ...writes 1024 pages.
>     if we haven't written everything in the inode (more than 1024 dirty
>     pages) we end up doing either requeue_io() or redirty_tail(). In the
>     first case the inode is put to b_more_io list, in the second case to
>     the tail of b_dirty list. In either case it will not receive further
>     writeout until we go through all other members of current b_io list.
> 
>   So I claim we currently *do* switch to another inode after 4 MB. That
> is a fact.

That is my understanding of how it works, too.

>   I *think* it is by design - mainly to avoid the situation where someone
> continuously writes a huge file and kupdate or pdflush would never get to
> writing other files with dirty data (at least that's impression I've built
> over the years - heck, even 2.6.16 seems to have this redirty_tail logic
> with a comment about the above livelock).

Right, and there is another condition as well - writing lots of
small files could starve large file writeback as the large file only
got 4MB written back every 30s writeback period because it took that
long to write out all the new files.

IIRC it was in 2.6.16 that both these problems were fixed...

>   I do find this design broken as well as you likely do and think that the
> livelock issue described in the above paragraph should be solved differently
> (e.g. by http://lkml.org/lkml/2010/2/11/321) but that's not a quick fix.
> 
>   The question is what to do now for 2.6.33 and 2.6.32-stable. Personally,
> I think that changing the writeback logic so that it does not switch inodes
> after 4 MB is too risky for these two kernels. So with the above
> explanation would you accept some fix along the lines of original Jens'
> fix?

We've had this sync() writeback behaviour for a long time - my
question is why is it only now a problem?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2010-02-17  1:58 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  9:16 Jens Axboe
2010-02-12 15:45 ` Linus Torvalds
2010-02-13 12:58   ` Jan Engelhardt
2010-02-15 14:49     ` Jan Kara
2010-02-15 15:41       ` Jan Engelhardt
2010-02-15 15:58         ` Jan Kara
2010-06-27 16:44         ` Jan Engelhardt
2010-10-24 23:41           ` Sync writeback still broken Jan Engelhardt
2010-10-30  0:57             ` Linus Torvalds
2010-10-30  1:16               ` Linus Torvalds
2010-10-30  1:30                 ` Linus Torvalds
2010-10-30  3:18                 ` Andrew Morton
2010-10-30 13:15                 ` Christoph Hellwig
2010-10-31 12:24             ` Jan Kara
2010-10-31 22:40               ` Jan Kara
2010-11-05 21:33                 ` Jan Kara
2010-11-05 21:34                   ` Jan Kara
2010-11-05 21:41                     ` Linus Torvalds
2010-11-05 22:03                   ` Jan Engelhardt
2010-11-07 12:57                     ` Jan Kara
2011-01-20 22:50                     ` Jan Engelhardt
2011-01-21 15:09                       ` Jan Kara
2010-02-15 14:17   ` [PATCH] writeback: Fix broken sync writeback Jan Kara
2010-02-16  0:05     ` Linus Torvalds
2010-02-16 23:00       ` Jan Kara
2010-02-16 23:34         ` Linus Torvalds
2010-02-17  0:01           ` Linus Torvalds
2010-02-17  1:33           ` Jan Kara
2010-02-17  1:57             ` Dave Chinner [this message]
2010-02-17  3:35             ` Linus Torvalds
2010-02-17  4:30               ` tytso
2010-02-17  5:16                 ` Linus Torvalds
2010-02-22 17:29                   ` Jan Kara
2010-02-22 21:01                     ` tytso
2010-02-22 22:26                       ` Jan Kara
2010-02-23  2:53                       ` Dave Chinner
2010-02-23  3:23                         ` tytso
2010-02-23  5:53                           ` Dave Chinner
2010-02-24 14:56                             ` Jan Kara

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=20100217015734.GH28392@discord.disaster \
    --to=david@fromorbit.com \
    --cc=gregkh@suse.de \
    --cc=jack@suse.cz \
    --cc=jengelh@medozas.de \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.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®