linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Con Kolivas <kernel@kolivas.org>,
	linux-mm@kvack.org
Subject: Re: [patch] mm: adjust kswapd nice level for high priority page allocators
Date: Mon, 1 Mar 2010 09:56:02 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1003010941020.26562@chino.kir.corp.google.com> (raw)
In-Reply-To: <20100301135242.GE3852@csn.ul.ie>

On Mon, 1 Mar 2010, Mel Gorman wrote:

> > When kswapd is awoken due to reclaim by a running task, set the priority
> > of kswapd to that of the task allocating pages thus making memory reclaim
> > cpu activity affected by nice level.
> > 
> 
> Why?
> 
> When a process kicks kswapd, the watermark at which a process enters
> direct reclaim has not been reached yet. In other words, there is no
> guarantee that a process will stall due to memory pressure.
> 
> The exception would be if there are many high-priority processes allocating
> pages at a steady rate that are starving kswapd of CPU time and
> consequently entering direct reclaim.

They don't necessarily need to be allocating pages, they may simply be 
starving kswapd of cputime which increases the liklihood of subsequently 
entering direct reclaim because of a low watermark on a later allocation.  
Without this patch, it's trivial especially on smaller desktop machines or 
servers using cpusets to preempt kswapd from running by setting nice 
levels for processes from userspace to have high priority.

If we're going to be doing background reclaim, it should not be done 
slower than one or more processes allocating pages; otherwise, we bias 
high priority tasks trying to allocate pages and favor lower priority.

> My main concern is that in the case there are a mix of high and low processes
> with kswapd towards the higher priority as a result of this patch, kswapd
> could be keeping CPU time from low-priority processes that are well behaved
> that would would make less forward progress as a result of this patch.
> 

That would only be the case if we constantly follow the slowpath in the 
page allocator, in which case we want kswapd to run and reclaim memory so 
that all processes can use the fastpath.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2010-03-01 17:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 10:14 David Rientjes
2010-03-01 13:52 ` Mel Gorman
2010-03-01 17:56   ` David Rientjes [this message]
2010-03-01 18:04     ` Mel Gorman
2010-03-08 23:23       ` David Rientjes
2010-03-02 23:48   ` Andrew Morton
2010-03-01 16:02 ` Minchan Kim
2010-03-02  4:29   ` Minchan Kim
2010-03-03  0:14     ` David Rientjes
2010-03-03  6:25       ` Minchan Kim

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.DEB.2.00.1003010941020.26562@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel@kolivas.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /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