public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Chavet <lchavet@av.com>
To: linux-kernel@vger.kernel.org
Subject: Very bad behavior of kswapd
Date: Wed, 18 Apr 2001 02:56:45 -0700	[thread overview]
Message-ID: <3ADD64DD.5D8428BA@av.com> (raw)
In-Reply-To: <Pine.LNX.3.96.1010418134153.20558A-100000@medusa.sparta.lu.se> <3ADD99E8.FB7F8542@coplanar.net>

Try this (my example I've 2GB of ram)

turn all your swap off

dd about 15% of the size of your RAM:
dd if=/dev/zero of=/local/test count=300 bs=1000000

Run this program with SIZE about 95% of your RAM:

#include <stdlib.h>
#include <unistd.h>
#include <assert.h>

#define SIZE (1900 * 1024 * 1024)
int main()
{
  int i;
  char *p = malloc(SIZE);
  assert (p != NULL);
  for (i = 0; i < SIZE; i++)
 p[i] = 1;
  printf ("done %p\n", p);

  while (1)
  {
 sleep (60);
  }
  return 0;
}


Watch top: when this program needs the memory that kswapd keep in cache they go
both at 100% cpu (on SMP) but still the size of the program only grows at about
100KB/s, why is kswapd releasing it so slowly and taking so much CPU ?

Laurent Chavet


  reply	other threads:[~2001-04-18 18:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-17 16:37 Is there a way to turn file caching off ? Laurent Chavet
2001-04-18  4:56 ` David Schwartz
2001-04-18 11:49 ` Bjorn Wesen
2001-04-18 13:43   ` Jeremy Jackson
2001-04-18  9:56     ` Laurent Chavet [this message]
2001-04-18 18:52       ` Very bad behavior of kswapd Rik van Riel
2001-04-18 19:15         ` David S. Miller
2001-04-19  8:21     ` Is there a way to turn file caching off ? Helge Hafting
2001-04-19 16:15       ` Jeremy Jackson
2001-04-19 18:01       ` John Lenton

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=3ADD64DD.5D8428BA@av.com \
    --to=lchavet@av.com \
    --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