mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Jendrissek <berndj@prism.co.za>
To: linux-kernel@vger.kernel.org
Subject: Re: Break 2.4 VM in five easy steps
Date: Thu, 7 Jun 2001 12:46:22 +0200	[thread overview]
Message-ID: <20010607124621.A30328@prism.co.za> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

First things first: 1) Please Cc: me when responding, 2) apologies for
dropping any References: headers, 3) sorry for bad formatting

"Jeffrey W. Baker" wrote:
> On Tue, 5 Jun 2001, Derek Glidden wrote: 
> > This isn't trying to test extreme low-memory pressure, just how the 
> > system handles recovering from going somewhat into swap, which is
> > a real 
> > day-to-day problem for me, because I often run a couple of apps
> > that 
> > most of the time live in RAM, but during heavy computation runs,
> > can go 
> > a couple hundred megs into swap for a few minutes at a time.
> > Whenever 
> > that happens, my machine always starts acting up afterwards, so I 
> > started investigating and found some really strange stuff going on. 

Has anyone else noticed the difference between
 dd if=/dev/zero of=bigfile bs=16384k count=1
and
 dd if=/dev/zero of=bigfile bs=8k count=2048
deleting 'bigfile' each time before use?  (You with lots of memory may
(or may not!) want to try bs=262144k)

Once, a few months ago, I thought I traced this to the loop at line ~2597
in linux/mm/filemap.c:generic_file_write
  2593          remove_suid(inode);
  2594          inode->i_ctime = inode->i_mtime = CURRENT_TIME;
  2595          mark_inode_dirty_sync(inode);
  2596  
  2597          while (count) {
  2598                  unsigned long index, offset;
  2599                  char *kaddr;
  2600                  int deactivate = 1;
...
  2659  
  2660                  if (status < 0)
  2661                          break;
  2662          }
  2663          *ppos = pos;
  2664  
  2665          if (cached_page)

It appears to me that pseudo-spins (it *does* do useful work) in this
loop for as long as there are pages available.

BTW while the big-bs dd is running, the disk is active.  I assume that
writes are indeed scheduled and start happening even while we're still
dirtying pages?

Does this freezing effect occur on SMP machines too?  Oops, had access
to one until this morning :(  Would an SMP box still have a 'spare'
cpu which isn't dirtying pages like crazy, and can therefore do things
like updating mouse cursors, etc.?

Bernd Jendrissek

P.S. here's my patch that cures this one symptom; it smells and looks
ugly, I know, but at least my mouse cursor doesn't jump across the whole
screen when I do the dd=torture.

I have no idea if this is right or not, whether I'm allowed to call
schedule inside generic_file_write or not, etc.  And the '256' is
just random - small enough to let the cursor move, but large enough
to do work between schedule()s.

If this solves your problem, use it; if your name is Linus or Alan,
ignore or do it right please.

diff -u -r1.1 -r1.2
--- linux-hack/mm/filemap.c     2001/06/06 21:16:28     1.1
+++ linux-hack/mm/filemap.c     2001/06/07 08:57:52     1.2
@@ -2599,6 +2599,11 @@
                char *kaddr;
                int deactivate = 1;
 
+               /* bernd-hack: give other processes a chance to run */
+               if (count % 256 == 0) {
+                       schedule();
+               }
+
                /*
                 * Try to find the page in the cache. If it isn't there,
                 * allocate a free page.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7H1tb/FmLrNfLpjMRAguAAJ0fYInFbAa6LjFC/CWZbRPQxzZwrwCeNqT0
/Kod15Nx7AzaM4v0WhOgp88=
=pyr6
-----END PGP SIGNATURE-----

             reply	other threads:[~2001-06-07 10:47 UTC|newest]

Thread overview: 111+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-07 10:46 Bernd Jendrissek [this message]
     [not found] ` <20010607153835.T14203@jessica>
2001-06-08  7:37   ` Bernd Jendrissek
2001-06-08 19:32 ` Pavel Machek
2001-06-11 12:06   ` Maciej Zenczykowski
2001-06-11 19:04     ` Rik van Riel
2001-06-12  7:46       ` Bernd Jendrissek
  -- strict thread matches above, loose matches on Subject: below --
2001-06-10 22:04 Rob Landley
2001-06-07 14:22 Bulent Abali
2001-06-07 15:38 ` Mike Galbraith
2001-06-06 15:31 Derek Glidden
2001-06-06 15:46 ` John Alvord
2001-06-06 15:58   ` Derek Glidden
2001-06-06 18:27     ` Eric W. Biederman
2001-06-06 18:47       ` Derek Glidden
2001-06-06 18:52         ` Eric W. Biederman
2001-06-06 19:06           ` Mike Galbraith
2001-06-06 19:28             ` Eric W. Biederman
2001-06-07  4:32               ` Mike Galbraith
2001-06-07  6:38                 ` Eric W. Biederman
2001-06-07  7:28                   ` Mike Galbraith
2001-06-07  7:59                     ` Eric W. Biederman
2001-06-07  8:15                       ` Mike Galbraith
2001-06-07 17:10                 ` Marcelo Tosatti
2001-06-06 19:28           ` Derek Glidden
2001-06-09  7:55           ` Rik van Riel
2001-06-06 20:43       ` Daniel Phillips
2001-06-06 21:57       ` LA Walsh
2001-06-07  6:35         ` Eric W. Biederman
2001-06-07 15:25           ` LA Walsh
2001-06-07 16:42             ` Eric W. Biederman
2001-06-07 20:47               ` LA Walsh
2001-06-08 19:38                 ` Pavel Machek
2001-06-09  7:34     ` Rik van Riel
2001-06-06 21:30 ` Alan Cox
2001-06-06 21:57   ` Derek Glidden
2001-06-09  8:09     ` Rik van Riel
2001-06-05 22:19 Derek Glidden
2001-06-05 23:38 ` Jeffrey W. Baker
2001-06-06  1:42   ` Russell Leighton
2001-06-06  7:14     ` Sean Hunter
2001-06-06  2:16   ` Andrew Morton
2001-06-06  3:19     ` Derek Glidden
2001-06-06 14:16       ` Disconnect
     [not found]       ` <3B1DEAC7.43DEFA1C@idb.hist.no>
2001-06-06 14:51         ` Derek Glidden
2001-06-06 21:34           ` Alan Cox
2001-06-09  8:07             ` Rik van Riel
2001-06-07  7:23           ` Helge Hafting
2001-06-07 16:56             ` Eric W. Biederman
2001-06-07 20:24             ` José Luis Domingo López
2001-06-06  4:03     ` Jeffrey W. Baker
2001-06-06  8:19     ` Xavier Bestel
2001-06-06  8:54       ` Sean Hunter
2001-06-06  9:57         ` Dr S.M. Huen
2001-06-06 10:06           ` DBs (ML)
2001-06-06 10:08           ` Vivek Dasmohapatra
2001-06-06 10:19             ` Lauri Tischler
2001-06-06 10:22           ` Sean Hunter
2001-06-06 10:48             ` Alexander Viro
2001-06-06 16:58               ` dean gaudet
2001-06-06 17:10               ` Remi Turk
2001-06-06 22:44             ` Kai Henningsen
2001-06-09  7:17             ` Rik van Riel
2001-06-06 16:47           ` dean gaudet
2001-06-06 17:17           ` Kurt Roeckx
2001-06-06 18:35             ` Dr S.M. Huen
2001-06-06 18:40               ` Mark Salisbury
2001-06-07  0:20           ` Mike A. Harris
2001-06-09  8:16             ` Rik van Riel
2001-06-09  8:57               ` Mike A. Harris
2001-06-07 21:31           ` Shane Nay
2001-06-07 20:00             ` Marcelo Tosatti
2001-06-07 21:55               ` Shane Nay
2001-06-07 20:29                 ` Marcelo Tosatti
2001-06-06 10:04         ` Jonathan Morton
2001-06-06 11:16         ` Daniel Phillips
2001-06-06 13:58         ` Gerhard Mack
2001-06-08  4:56           ` C. Martins
2001-06-06 15:28         ` Richard Gooch
2001-06-06 15:42           ` Christian Bornträger
2001-06-06 17:14           ` Ben Greear
2001-06-06 19:11         ` android
2001-06-07  0:27           ` Mike A. Harris
2001-06-06  9:16       ` Xavier Bestel
2001-06-06  9:25         ` Sean Hunter
2001-06-06 12:07       ` Jonathan Morton
2001-06-06 14:41       ` Derek Glidden
2001-06-06 20:29       ` José Luis Domingo López
2001-06-06 13:32     ` Eric W. Biederman
2001-06-06 14:41     ` Marc Heckmann
2001-06-06 14:51     ` Hugh Dickins
2001-06-06  7:47   ` Jonathan Morton
2001-06-06 13:08   ` Eric W. Biederman
2001-06-06 16:48     ` Jeffrey W. Baker
     [not found] ` <m2lmn61ceb.fsf@sympatico.ca>
2001-06-06 14:37   ` Derek Glidden
2001-06-07  0:34     ` Mike A. Harris
2001-06-07  3:13       ` Miles Lane
2001-06-07 15:49         ` Derek Glidden
2001-06-07 19:06         ` Miles Lane
2001-06-09  5:57         ` Mike A. Harris
2001-06-06 18:59 ` Mike Galbraith
2001-06-06 19:39   ` Derek Glidden
2001-06-06 20:47 ` Linus Torvalds
2001-06-07  7:42   ` Eric W. Biederman
2001-06-07  8:11     ` Linus Torvalds
2001-06-07  8:54       ` Eric W. Biederman
2001-06-06 21:39 ` android
2001-06-06 22:08 ` Jonathan Morton
2001-06-06 22:27 ` android
2001-06-06 22:33   ` Antoine
2001-06-06 22:38 ` Robert Love
2001-06-06 22:40 ` Jonathan Morton

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=20010607124621.A30328@prism.co.za \
    --to=berndj@prism.co.za \
    --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

all inboxes | Powered by JetHome®