linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Robert Love <rml@tech9.net>
Cc: linux-kernel@vger.kernel.org, Valdis.Kletnieks@vt.edu,
	piggin@cyberone.com.au, kernel@kolivas.org, linux-mm@kvack.org
Subject: Re: [patch] real-time enhanced page allocator and throttling
Date: Tue, 5 Aug 2003 17:09:54 -0700	[thread overview]
Message-ID: <20030805170954.59385c78.akpm@osdl.org> (raw)
In-Reply-To: <1060121638.4494.111.camel@localhost>

Robert Love <rml@tech9.net> wrote:
>
> > There is a very good argument for giving !SCHED_OTHER tasks
>  > "special treatment" in the VM.
> 
>  Yes, there is.
> 
>  Attached patch is against 2.6.0-test2-mm4. 

Thanks.  I guess we should extend the special treatment in the page
allocator and in balance_dirty_pages() we still should go and update the
various bits of state and poke pdflush if needed.

These changes should yield quite significant improvements in worst-case
latencies for realtime tasks under some situations.  I'll test them...


diff -puN mm/page_alloc.c~rt-tasks-special-vm-treatment-2 mm/page_alloc.c
--- 25/mm/page_alloc.c~rt-tasks-special-vm-treatment-2	2003-08-05 16:57:51.000000000 -0700
+++ 25-akpm/mm/page_alloc.c	2003-08-05 16:58:11.000000000 -0700
@@ -592,6 +592,8 @@ __alloc_pages(unsigned int gfp_mask, uns
 		local_min = z->pages_min;
 		if (gfp_mask & __GFP_HIGH)
 			local_min >>= 2;
+		if (rt_task(p))
+			local_min >>= 1;
 		min += local_min;
 		if (z->free_pages >= min ||
 				(!wait && z->free_pages >= z->pages_high)) {
diff -puN mm/page-writeback.c~rt-tasks-special-vm-treatment-2 mm/page-writeback.c
--- 25/mm/page-writeback.c~rt-tasks-special-vm-treatment-2	2003-08-05 16:57:51.000000000 -0700
+++ 25-akpm/mm/page-writeback.c	2003-08-05 17:02:40.000000000 -0700
@@ -144,7 +144,7 @@ get_dirty_limits(struct page_state *ps, 
  * If we're over `background_thresh' then pdflush is woken to perform some
  * writeout.
  */
-void balance_dirty_pages(struct address_space *mapping)
+static void balance_dirty_pages(struct address_space *mapping)
 {
 	struct page_state ps;
 	long nr_reclaimable;
@@ -167,8 +167,9 @@ void balance_dirty_pages(struct address_
 		nr_reclaimable = ps.nr_dirty + ps.nr_unstable;
 		if (nr_reclaimable + ps.nr_writeback <= dirty_thresh)
 			break;
-
 		dirty_exceeded = 1;
+		if (rt_task(current))
+			break;
 
 		/* Note: nr_reclaimable denotes nr_dirty + nr_unstable.
 		 * Unstable writes are a feature of certain networked
@@ -223,7 +224,7 @@ void balance_dirty_pages_ratelimited(str
 	 * Check the rate limiting. Also, we do not want to throttle real-time
 	 * tasks in balance_dirty_pages(). Period.
 	 */
-	if (get_cpu_var(ratelimits)++ >= ratelimit && !rt_task(current)) {
+	if (get_cpu_var(ratelimits)++ >= ratelimit) {
 		__get_cpu_var(ratelimits) = 0;
 		put_cpu_var(ratelimits);
 		balance_dirty_pages(mapping);

_

--
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:"aart@kvack.org"> aart@kvack.org </a>

  reply	other threads:[~2003-08-06  0:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-05 22:13 Robert Love
2003-08-06  0:09 ` Andrew Morton [this message]
2003-08-06  0:39   ` Robert Love
2003-08-06  0:45     ` Andrew Morton
2003-08-06  3:58       ` Robert Love
2003-08-06  8:41         ` Andrew Morton
2003-08-06 17:01           ` Robert Love

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=20030805170954.59385c78.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=piggin@cyberone.com.au \
    --cc=rml@tech9.net \
    /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