mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: s3293115@student.anu.edu.au, linux-kernel@vger.kernel.org
Subject: Re: kswapd using all cpu for long periods in 2.4.9-pre4
Date: Wed, 15 Aug 2001 02:43:24 -0700	[thread overview]
Message-ID: <200108150943.f7F9hOh01879@penguin.transmeta.com> (raw)
In-Reply-To: <000c01c12569$65581630$0200a8c0@W2K>

In article <000c01c12569$65581630$0200a8c0@W2K> you write:
>
>Somewhere between 2.4.8 and 2.4.9-pre4 kswapd developed a problem. Actually
>it looks like it is related to the changes in do_try_to_free_pages...
>
>kswapd is using all cpu for long periods (100-200 seconds then 100-200
>seconds break....) there is very little disk activity (heres a vmstat while
>its happening)

For some reason do_try_to_free_pages() doesn't end up ever being happy
with how much memory there is free (that's why kswapd will loop).  But
you actually have a reasonable amount of free memory, so all the memory
free'ers will actually refuse to do anything.  The problem seems to be
that either inactive_shortage() or free_shortage() will just continually
claim that you have a shortage of memory. 

However, you actually do have memory:

>mem info during:
>SysRq: Show Memory
>Mem-info:
>Free pages: 3744kB ( 0kB HighMem)
>( Active: 6946, inactive_dirty: 4296, inactive_clean: 895, free: 936 (256
>512 2048) )
>5*4kB 1*8kB 1*16kB 1*32kB 1*64kB 1*128kB 1*256kB 1*512kB 0*1024kB 0*2048kB = 1036kB)
>263*4kB 105*8kB 5*16kB 1*32kB 1*64kB 1*128kB 0*256kB 1*512kB 0*1024kB 0*2048kB = 2708kB)
> = 0kB)
>Swap cache: add 16680, delete 14047, find 17408/32591
>Free swap: 110016kB
>16368 pages of RAM
>0 pages of HIGHMEM

I bet this is it.

It probably decides that you have a shortage of HIGHMEM pages. Which is
understandable, since you don't have any ;)

Does the following trivial patch fix it for you?

(If it doesn't, please try just removing the "continue" at line 930 or
so in the middle of the kswapd loop.  But I think there's something else
that makes kswapd just think it _should_ loop, and the lack of
zone->size testing in the inactive_shortage() calculations looks like
it).

	Thanks,

		Linus

-----
--- pre4/linux/mm/vmscan.c	Wed Aug 15 02:39:44 2001
+++ linux/mm/vmscan.c	Wed Aug 15 02:37:07 2001
@@ -788,6 +788,9 @@
 			zone_t *zone = pgdat->node_zones + i;
 			unsigned int inactive;
 
+			if (!zone->size)
+				continue;
+
 			inactive  = zone->inactive_dirty_pages;
 			inactive += zone->inactive_clean_pages;
 			inactive += zone->free_pages;


  reply	other threads:[~2001-08-15  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-15  9:05 Nick Piggin
2001-08-15  9:43 ` Linus Torvalds [this message]
2001-08-15 17:19 ` Linus Torvalds
2001-08-16  8:07   ` Nick Piggin

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=200108150943.f7F9hOh01879@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s3293115@student.anu.edu.au \
    /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®