public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Alex Bligh <alex@alex.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Local DoS through write heavy I/O on CFQ & Deadline
Date: Mon, 15 Oct 2012 10:17:15 +0200	[thread overview]
Message-ID: <20121015081715.GC29069@dhcp22.suse.cz> (raw)
In-Reply-To: <3D1C85A52BB960B79E37AC30@nimrod.local>

On Fri 12-10-12 17:29:50, Alex Bligh wrote:
> Michael,
> 
> --On 12 October 2012 16:58:39 +0200 Michal Hocko <mhocko@suse.cz> wrote:
> 
> >Once dirty_ratio (resp. dirty_bytes) limit is hit then the process which
> >writes gets throttled. If this is not the case then there is a bug in
> >the throttling code.
> 
> I believe that is the problem.
> 
> >>Isn't the only thing that is going to change that it ends up
> >>triggering the writeback earlier?
> >
> >Set the limit lowe?
> 
> I think you mean 'lower'. If I do that, what I think will happen
> is that it will start the write-back earlier, 

Yes this is primarily controlled by dirty_background_{bytes|ratio}.

> but the writeback once started will not keep up with the generation of
> data, possibly because the throttling isn't going to work.

This would be good to confirm.

> Note that for instance using ionice to set priority or class to 'idle'
> has no effect. So, to test my hypothesis ...

This has been tested with the original dirty_ratio configuration, right?

> >>Happy to test etc - what would you suggest, dirty_ratio=5,
> >>dirty_background_ratio=2 ?
> >
> >These are measured in percentage. On the other hand if you use
> >dirty_bytes resp. dirty_background_bytes then you get absolute numbers
> >independent on the amount of memory.
> 
> ... what would you suggest I set any of these to in order to test
> (assuming the same box) so that it's 'low enough' that if it still
> hangs, it's a bug, rather than it's simply 'not low enough'. It's
> an 8G box and clearly I'm happy to set either the _ratio or _bytes
> entries.

I would use _ratio variants as you have a better control over the amount
of dirty data that can accumulate. You will need to experiment a bit to
tune this up. Maybe somebody with more IO experiences can help you more
with this.
I think what you see is related to your filesystem as well. Other
processes probably wait for fsync but the amount of dirty data is so big
it takes really long to finish it.
-- 
Michal Hocko
SUSE Labs

  parent reply	other threads:[~2012-10-15  8:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-11 12:23 Local DoS through write heavy I/O on CFQ & Deadline Alex Bligh
2012-10-11 13:46 ` Alan Cox
2012-10-12 12:57   ` Alex Bligh
2012-10-12 13:30 ` Michal Hocko
2012-10-12 14:48   ` Alex Bligh
2012-10-12 14:58     ` Michal Hocko
2012-10-12 16:29       ` Alex Bligh
2012-10-13 13:53         ` Hillf Danton
2012-10-13 19:33           ` Alex Bligh
2012-10-14  2:43             ` Hillf Danton
2012-10-15  8:17         ` Michal Hocko [this message]
2012-10-18 21:28         ` Jan Kara
2012-10-18 22:13           ` Chris Friesen
2012-10-18 22:24             ` Jan Kara
2012-10-14 21:17 ` Dave Chinner

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=20121015081715.GC29069@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --cc=alex@alex.org.uk \
    --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