public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: William Lee Irwin III <wli@holomorphy.com>
Cc: Andrea Arcangeli <andrea@suse.de>,
	Norman Gaywood <norm@turing.une.edu.au>,
	linux-kernel@vger.kernel.org
Subject: Re: Maybe a VM bug in 2.4.18-18 from RH 8.0?
Date: Thu, 05 Dec 2002 21:25:15 -0800	[thread overview]
Message-ID: <3DF034BB.D5F863B5@digeo.com> (raw)
In-Reply-To: 20021206024140.GL9882@holomorphy.com

William Lee Irwin III wrote:
> 
> Yes, it's necessary; no, I've never directly encountered the issue it
> fixes. Sorry about the miscommunication there.

The google thing.

The basic problem is in allowing allocations which _could_ use
highmem to use the normal zone as anon memory or pagecache.

Because the app could mlock that memory.   So for a simple
demonstration:

- mem=2G
- read a 1.2G file
- malloc 800M, now mlock it.

Those 800M will be in ZONE_NORMAL, simply because that was where the
free memory was.  And you're dead, even though you've only mlocked
800M.  The same thing happens if you have lots of anon memory in the
normal zone and there is no swapspace available.

Linus's approach was to raise the ZONE_NORMAL pages_min limit for
allocations which _could_ use highmem.  So a GFP_HIGHUSER allocation
has a pages_min limit of (say) 4M when considering the normal zone,
but a GFP_KERNEL allocation has a limit of 2M.

Andrea's patch does the same thing, via a separate table.   He has
set the threshold much higher (100M on a 4G box).   AFAICT, the
algorithms are identical - I was planning on just adding a multiplier
to set Linus's ratio - it is currently hardwired to "1".   Search for 
"mysterious" in mm/page_alloc.c ;)

It's not clear to me why -aa defaults to 100 megs when the problem
only occurs with no swap or when the app is using mlock.  The default
multiplier (of variable local_min) should be zero.  Swapless machines
or heavy mlock users can crank it up.

But mlocking 700M on a 4G box would kill it as well.  The google
application, IIRC, mlocks 1G on a 2G machine.  Daniel put them
onto the 2G+2G split and all was well.

Anyway, thanks.   I'll take another look at Andrea's implementation.

Now, regarding mlock(mmap(open(/dev/hda1))) ;)

  reply	other threads:[~2002-12-06  5:17 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-06  0:13 Maybe a VM bug in 2.4.18-18 from RH 8.0? Norman Gaywood
2002-12-06  1:00 ` Andrew Morton
2002-12-06  1:17   ` Andrea Arcangeli
2002-12-06  1:34     ` Andrew Morton
2002-12-06  1:44       ` Andrea Arcangeli
2002-12-06  2:15         ` William Lee Irwin III
2002-12-06  2:28           ` Andrea Arcangeli
2002-12-06  2:41             ` William Lee Irwin III
2002-12-06  5:25               ` Andrew Morton [this message]
2002-12-06  5:48                 ` Andrea Arcangeli
2002-12-06  6:14                   ` William Lee Irwin III
2002-12-06  6:55                   ` Andrew Morton
2002-12-06  7:14                     ` GrandMasterLee
2002-12-06  7:25                       ` Andrew Morton
2002-12-06  7:34                         ` GrandMasterLee
2002-12-06  7:51                           ` Andrew Morton
2002-12-06 11:37                             ` Christoph Hellwig
2002-12-06 16:19                             ` GrandMasterLee
2002-12-06 14:57                     ` Andrea Arcangeli
2002-12-06 15:12                       ` William Lee Irwin III
2002-12-06 23:32                         ` Andrea Arcangeli
2002-12-06 23:45                           ` William Lee Irwin III
2002-12-06 23:57                             ` Andrea Arcangeli
2002-12-06  6:00                 ` William Lee Irwin III
2002-12-06 22:28               ` Andrea Arcangeli
2002-12-06 23:21                 ` William Lee Irwin III
2002-12-06 23:50                   ` Andrea Arcangeli
2002-12-07  0:30                     ` William Lee Irwin III
2002-12-07  0:01                   ` Andrew Morton
2002-12-07  0:21                     ` William Lee Irwin III
2002-12-07  0:30                       ` Andrew Morton
2002-12-07  2:19                       ` Alan Cox
2002-12-07  1:46                         ` William Lee Irwin III
2002-12-07  1:56                           ` Andrea Arcangeli
2002-12-07  2:31                           ` Alan Cox
2002-12-07  2:09                             ` William Lee Irwin III
2002-12-07  0:22                     ` Andrea Arcangeli
2002-12-07  0:35                       ` Andrew Morton
2002-12-07  0:46                     ` William Lee Irwin III
2002-12-07 10:55                     ` Arjan van de Ven
2002-12-06 10:36           ` Arjan van de Ven
2002-12-06 14:23             ` William Lee Irwin III
2002-12-06 15:12               ` William Lee Irwin III
2002-12-06 22:34                 ` Andrea Arcangeli
2002-12-07 18:27                   ` Eric W. Biederman
2002-12-06  1:08 ` Andrea Arcangeli
     [not found] <mailman.1039133948.27411.linux-kernel2news@redhat.com>
2002-12-06  0:35 ` Pete Zaitcev
2002-12-06  1:27   ` Norman Gaywood
2002-12-06 12:48     ` 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=3DF034BB.D5F863B5@digeo.com \
    --to=akpm@digeo.com \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=norm@turing.une.edu.au \
    --cc=wli@holomorphy.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