mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Mike Galbraith <efault@gmx.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [ext3][kernels >= 2.6.20.7 at least] KDE going comatose when FS is under heavy write load (massive starvation)
Date: Fri, 27 Apr 2007 08:18:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.98.0704270806230.9964@woody.linux-foundation.org> (raw)
In-Reply-To: <1177660767.6567.41.camel@Homer.simpson.net>



On Fri, 27 Apr 2007, Mike Galbraith wrote:
> 
> As subject states, my GUI is going away for extended periods of time
> when my very full and likely highly fragmented (how to find out)
> filesystem is under heavy write load.  While write is under way, if
> amarok (mp3 player) is running, no song change will occur until write is
> finished, and the GUI can go _entirely_ comatose for very long periods.
> Usually, it will come back to life after write is finished, but
> occasionally, a complete GUI restart is necessary.

One thing to try out (and dammit, I should make it the default now in 
2.6.21) is to just make the dirty limits much lower. We've been talking 
about this for ages, I think this might be the right time to do it.

Especially with lots of memory, allowing 40% of that memory to be dirty is 
just insane (even if we limit it to "just" 40% of the normal memory zone. 
That can be gigabytes. And no amount of IO scheduling will make it 
pleasant to try to handle the situation where that much memory is dirty.

So I do believe that we could probably do something about the IO 
scheduling _too_:

 - break up large write requests (yeah, it will make for worse IO 
   throughput, but if make it configurable, and especially with 
   controllers that don't have insane overheads per command, the 
   difference between 128kB requests and 16MB requests is probably not 
   really even noticeable - SCSI things with large per-command overheads 
   are just stupid)

   Generating huge requests will automatically mean that they are 
   "unbreakable" from an IO scheduler perspective, so it's bad for latency 
   for other reqeusts once they've started.

 - maybe be more aggressive about prioritizing reads over writes.

but in the meantime, what happens if you apply this patch?

Actually, you don't need to apply the patch - just do

	echo 5 > /proc/sys/vm/dirty_background_ratio
	echo 10 > /proc/sys/vm/dirty_ratio

and say if it seems to improve things. I think those are much saner 
defaults especially for a desktop system (and probably for most servers 
too, for that matter).

Even 10% of memory dirty can be a whole lot of RAM, but it should 
hopefully be _better_ than the insane default we have now.

Historical note: allowing about half of memory to contain dirty pages made 
more sense back in the days when people had 16-64MB of memory, and a 
single untar of even fairly small projects would otherwise hit the disk. 
But memory sizes have grown *much* more quickly than disk speeds (and 
latency requirements have gone down, not up), so a default that may 
actually have been perfectly fine at some point seems crazy these days..

		Linus

---
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index f469e3c..a794945 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -67,12 +67,12 @@ static inline long sync_writeback_pages(void)
 /*
  * Start background writeback (via pdflush) at this percentage
  */
-int dirty_background_ratio = 10;
+int dirty_background_ratio = 5;
 
 /*
  * The generator of dirty data starts writeback at this percentage
  */
-int vm_dirty_ratio = 40;
+int vm_dirty_ratio = 10;
 
 /*
  * The interval between `kupdate'-style writebacks, in jiffies

  parent reply	other threads:[~2007-04-27 15:19 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27  7:59 Mike Galbraith
2007-04-27  8:33 ` Andrew Morton
2007-04-27  9:23   ` Mike Galbraith
2007-04-27 10:17   ` Mike Galbraith
2007-04-27 11:59   ` Marat Buharov
2007-04-27 12:30     ` Peter Zijlstra
2007-04-27 13:50       ` Mark Lord
2007-04-27 12:39     ` Manoj Joseph
2007-04-27 15:30     ` Linus Torvalds
2007-04-27 19:31       ` Andreas Dilger
2007-04-27 19:44         ` Mike Galbraith
2007-04-27 19:50         ` Linus Torvalds
2007-04-27 20:05           ` Hua Zhong
2007-04-27 20:12           ` Miquel van Smoorenburg
2007-04-27 20:12           ` Bill Huey
2007-04-28  5:37             ` Mikulas Patocka
2007-04-28  5:45               ` Mikulas Patocka
2007-04-28 21:57               ` Bill Huey
2007-04-28 22:38                 ` Mikulas Patocka
2007-04-27 20:29           ` Gabriel C
2007-04-27 20:45           ` Stephen Clark
2007-04-27 20:54           ` Manoj Joseph
2007-04-28  8:45           ` Matthias Andree
2007-04-27 22:18         ` Andrew Morton
2007-05-03 17:38           ` Alex Tomas
2007-05-03 23:54             ` Andrew Morton
2007-05-04  6:18               ` Alex Tomas
2007-05-04  6:38                 ` Andrew Morton
2007-05-04  6:57                   ` Alex Tomas
2007-05-04  7:18                     ` Andrew Morton
2007-05-04  7:39                       ` Alex Tomas
2007-05-04  8:02                         ` Andrew Morton
2007-04-28  8:44       ` Matthias Andree
2007-04-28 20:46   ` Mikulas Patocka
2007-04-28 21:12     ` Lee Revell
2007-04-29 20:49       ` Mark Lord
2007-04-29 21:17       ` Mikulas Patocka
2007-04-27 15:18 ` Linus Torvalds [this message]
2007-04-27 15:41   ` John Anthony Kazos Jr.
2007-04-27 15:54     ` Linus Torvalds
2007-04-27 16:24       ` Chuck Ebbert
2007-04-27 19:43       ` Marko Macek
2007-04-27 18:31   ` Andrew Morton
2007-04-27 19:09     ` Zan Lynx
2007-04-27 22:07       ` Andrew Morton
2007-04-27 19:27     ` Mike Galbraith
2007-04-28  8:51     ` Matthias Andree
2007-04-28  8:59       ` Andrew Morton
2007-04-28 16:30       ` Linus Torvalds
2007-04-28 16:56         ` Paolo Ornati
2007-04-27 19:28   ` Mike Galbraith
2007-04-27 20:06   ` Jan Engelhardt
2007-04-27 21:22     ` Linus Torvalds
2007-04-28  4:25   ` Mike Galbraith
2007-04-28  6:32     ` Mike Galbraith
2007-04-28  7:01       ` Andrew Morton
2007-04-28  7:12         ` Mike Galbraith
2007-04-28  6:32   ` Mikulas Patocka
2007-04-28 16:05     ` Linus Torvalds
2007-04-28 16:37       ` Ingo Molnar
2007-04-28 17:11         ` Mikulas Patocka
2007-04-30  6:57           ` Jens Axboe
2007-04-28 17:55       ` Mikulas Patocka
2007-04-30  6:56       ` Jens Axboe
2007-05-02  6:53   ` Jens Axboe
2007-05-02  7:36     ` Mike Galbraith

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=alpine.LFD.0.98.0704270806230.9964@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=efault@gmx.de \
    --cc=jens.axboe@oracle.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®