From: Rik van Riel <riel@conectiva.com.br>
To: "Stephen C. Tweedie" <sct@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@transmeta.com>,
MM mailing list <linux-mm@kvack.org>,
linux-kernel@vger.rutgers.edu
Subject: Re: [patch] balanced highmem subsystem under pre7-9
Date: Sat, 13 May 2000 09:03:48 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.21.0005130901070.7316-100000@duckman.distro.conectiva> (raw)
In-Reply-To: <20000513125701.E14984@redhat.com>
On Sat, 13 May 2000, Stephen C. Tweedie wrote:
> On Fri, May 12, 2000 at 07:48:45PM -0300, Rik van Riel wrote:
>
> > > if (tsk->need_resched)
> > > - schedule();
> > > + goto sleep;
> >
> > This is wrong. It will make it much much easier for processes to
> > get killed (as demonstrated by quintela's VM test suite).
>
> It shouldn't. If tasks are getting killed, then the fix should be
> in alloc_pages, not in kswapd. Tasks _should_ be quite able to wait
> for memory, and if necessary, drop into try_to_free_pages themselves.
Indeed, but waiting for memory or running
try_to_free_pages themselves is not without
problems either, as you describe below...
> Linus, the fix above seems to be necessary. Without it, even a
> simple playing of mp3 audio on 2.3 fails once memory is full on
> a 256MB box, with kswapd consuming between 5% and 25% of CPU and
> locking things up sufficiently to cause dropouts in the playback
> every second or more. With that one-liner fix, mp3 is smooth
> even in the presence of other background file activity.
Kswapd freeing pages in the background means that processes
in the foreground can proceed with their allocation without
waiting, leading to smoother VM performance. I guess we
want that ... ;)
Besides, kswapd will _only_ continue if there's a zone with
zone->free_pages < zone->pages_low ... I'm now running pre8
with the patch below and it works fine.
regards,
Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.
Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/ http://www.surriel.com/
--- mm/vmscan.c.orig Fri May 12 20:13:08 2000
+++ mm/vmscan.c Fri May 12 20:15:24 2000
@@ -538,16 +538,19 @@
int i;
for(i = 0; i < MAX_NR_ZONES; i++) {
zone_t *zone = pgdat->node_zones+ i;
+ if (tsk->need_resched)
+ schedule();
if (!zone->size || !zone->zone_wake_kswapd)
continue;
- something_to_do = 1;
+ if (zone->free_pages < zone->pages_low)
+ something_to_do = 1;
do_try_to_free_pages(GFP_KSWAPD);
}
run_task_queue(&tq_disk);
pgdat = pgdat->node_next;
} while (pgdat);
- if (tsk->need_resched || !something_to_do) {
+ if (!something_to_do) {
tsk->state = TASK_INTERRUPTIBLE;
interruptible_sleep_on(&kswapd_wait);
}
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-05-13 12:03 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-08 17:21 [PATCH] Recent VM fiasco - fixed Zlatko Calusic
2000-05-08 17:43 ` Rik van Riel
2000-05-08 18:16 ` Zlatko Calusic
2000-05-08 18:20 ` Linus Torvalds
2000-05-08 18:46 ` Rik van Riel
2000-05-08 18:53 ` Zlatko Calusic
2000-05-08 19:04 ` Rik van Riel
2000-05-09 7:56 ` Daniel Stone
2000-05-09 8:25 ` Christoph Rohland
2000-05-09 15:44 ` Linus Torvalds
2000-05-09 16:12 ` Simon Kirby
2000-05-09 17:42 ` Christoph Rohland
2000-05-09 19:50 ` Linus Torvalds
2000-05-10 11:25 ` Christoph Rohland
2000-05-10 11:50 ` Zlatko Calusic
2000-05-11 23:40 ` Mark Hahn
2000-05-10 4:05 ` James H. Cloos Jr.
2000-05-10 7:29 ` James H. Cloos Jr.
2000-05-11 0:16 ` Linus Torvalds
2000-05-11 0:32 ` Linus Torvalds
2000-05-11 16:36 ` [PATCH] Recent VM fiasco - fixed (pre7-9) Rajagopal Ananthanarayanan
2000-05-11 1:04 ` [PATCH] Recent VM fiasco - fixed Juan J. Quintela
2000-05-11 1:53 ` Simon Kirby
2000-05-11 7:23 ` Linus Torvalds
2000-05-11 14:17 ` Simon Kirby
2000-05-11 23:38 ` Simon Kirby
2000-05-12 0:09 ` Linus Torvalds
2000-05-12 2:51 ` [RFC][PATCH] shrink_mmap avoid list_del (Was: Re: [PATCH] Recent VM fiasco - fixed) Roger Larsson
2000-05-11 11:15 ` [PATCH] Recent VM fiasco - fixed Rik van Riel
2000-05-11 5:10 ` Linus Torvalds
2000-05-11 10:09 ` James H. Cloos Jr.
2000-05-11 17:25 ` Juan J. Quintela
2000-05-11 23:25 ` [patch] balanced highmem subsystem under pre7-9 Ingo Molnar
2000-05-11 23:46 ` Linus Torvalds
2000-05-12 0:08 ` Ingo Molnar
2000-05-12 0:15 ` Ingo Molnar
2000-05-12 9:02 ` Christoph Rohland
2000-05-12 9:56 ` Ingo Molnar
2000-05-12 11:49 ` Christoph Rohland
2000-05-12 16:12 ` Linus Torvalds
2000-05-12 10:57 ` Andrea Arcangeli
2000-05-12 12:11 ` Ingo Molnar
2000-05-12 12:57 ` Andrea Arcangeli
2000-05-12 13:20 ` Rik van Riel
2000-05-12 16:40 ` Ingo Molnar
2000-05-12 17:15 ` Rik van Riel
2000-05-12 18:15 ` Linus Torvalds
2000-05-12 18:53 ` Ingo Molnar
2000-05-12 19:06 ` Linus Torvalds
2000-05-12 19:36 ` Ingo Molnar
2000-05-12 19:40 ` Ingo Molnar
2000-05-12 19:54 ` Ingo Molnar
2000-05-12 22:48 ` Rik van Riel
2000-05-13 11:57 ` Stephen C. Tweedie
2000-05-13 12:03 ` Rik van Riel [this message]
2000-05-13 12:14 ` Ingo Molnar
2000-05-13 14:23 ` Ingo Molnar
2000-05-19 1:58 ` Andrea Arcangeli
2000-05-19 15:03 ` Rik van Riel
2000-05-19 16:08 ` Andrea Arcangeli
2000-05-19 17:05 ` Rik van Riel
2000-05-19 22:28 ` Linus Torvalds
2000-05-11 11:12 ` [PATCH] Recent VM fiasco - fixed Christoph Rohland
2000-05-11 17:38 ` Steve Dodd
2000-05-09 10:21 ` Rik van Riel
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=Pine.LNX.4.21.0005130901070.7316-100000@duckman.distro.conectiva \
--to=riel@conectiva.com.br \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=sct@redhat.com \
--cc=torvalds@transmeta.com \
/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