All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Peter Osterlund <petero2@telia.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: Can't make use of swap memory in 2.6.7-bk19
Date: Wed, 14 Jul 2004 06:22:56 -0700	[thread overview]
Message-ID: <20040714132256.GR3411@holomorphy.com> (raw)
In-Reply-To: <m2hdsabvdu.fsf@telia.com>

On Wed, Jul 14, 2004 at 02:55:57PM +0200, Peter Osterlund wrote:
> Out of memory: pid 2655, comm xterm        , gfp 0x466, order 0
[...]
>  [<c0131d69>] out_of_memory+0xb2/0x105
>  [<c013a0bd>] try_to_free_pages+0x143/0x190
>  [<c0132bae>] __alloc_pages+0x1c3/0x347
>  [<c013595b>] do_page_cache_readahead+0x13b/0x197
>  [<c012fb50>] filemap_nopage+0x2d8/0x371
>  [<c013cfe9>] do_no_page+0xb7/0x30f
>  [<c013d431>] handle_mm_fault+0xd6/0x171
>  [<c0111076>] do_page_fault+0x346/0x548
>  [<c01d5868>] __copy_to_user_ll+0x48/0x6c
>  [<c015c7c3>] sys_select+0x228/0x4b0
>  [<c0110d30>] do_page_fault+0x0/0x548
>  [<c01040a1>] error_code+0x2d/0x38
> Out of Memory: Killed process 2666 (memalloc2).

$ printf "%lx\n" $(( 0x100 | 0x80 | 0x40 | 0x10 | 0x2 ))
1d2
$ egrep '(0x100|0x80|0x40|0x10) |0x02' /mnt/dm0/laptop-2.6.8-rc1/include/linux/gfp.h                               
#define __GFP_HIGHMEM   0x02
#define __GFP_WAIT      0x10    /* Can wait and reschedule? */
#define __GFP_IO        0x40    /* Can start physical IO? */
#define __GFP_FS        0x80    /* Can call down to low-level FS? */
#define __GFP_COLD      0x100   /* Cache-cold page required */

Hmm, I wonder why we didn't just fail the allocation. Maybe we should
check (gfp_mask & __GFP_NOFAIL) instead of !(gfp_mask & __GFP_NORETRY);
everything else should be allowed to fail, except things loop if
without __GFP_NORETRY, as presumably only __GFP_NOFAIL allocations are
ones that supposedly can't handle failures in-context.

The only difference laptop_mode should have is dirty memory handling,
but you don't have any dirty memory. Maybe swapcache is fooling things.
Most notably, add_to_swap() sets the page dirty...

Something is very wrong here... could you try this?


- wli

Index: oom-2.6.8-rc1/mm/vmscan.c
===================================================================
--- oom-2.6.8-rc1.orig/mm/vmscan.c	2004-07-14 06:17:13.876343912 -0700
+++ oom-2.6.8-rc1/mm/vmscan.c	2004-07-14 06:22:15.986416200 -0700
@@ -417,7 +417,8 @@
 				goto keep_locked;
 			if (!may_enter_fs)
 				goto keep_locked;
-			if (laptop_mode && !sc->may_writepage)
+			if (laptop_mode && !sc->may_writepage &&
+							!PageSwapCache(page))
 				goto keep_locked;
 
 			/* Page is dirty, try to write it out here */

  reply	other threads:[~2004-07-14 13:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-08  1:36 Can't make use of swap memory in 2.6.7-bk19 Peter Osterlund
2004-07-08  1:43 ` William Lee Irwin III
2004-07-08  2:14 ` Nick Piggin
2004-07-08  2:30   ` William Lee Irwin III
2004-07-08 12:59     ` Peter Osterlund
2004-07-08 19:39       ` William Lee Irwin III
2004-07-09  0:57         ` Nick Piggin
2004-07-09  1:53           ` William Lee Irwin III
2004-07-09  2:06             ` Nick Piggin
2004-07-09  2:09               ` William Lee Irwin III
2004-07-09  2:12                 ` Andrew Morton
2004-07-09  2:50                   ` William Lee Irwin III
2004-07-09  4:51                     ` Andrew Morton
2004-07-09  2:14                 ` Nick Piggin
2004-07-08  8:12   ` Peter Osterlund
2004-07-08  8:20     ` Andrew Morton
2004-07-08  8:23       ` Nick Piggin
2004-07-08  9:30         ` Peter Osterlund
2004-07-14  5:20           ` William Lee Irwin III
2004-07-14 10:39             ` Peter Osterlund
2004-07-14 10:57               ` William Lee Irwin III
2004-07-14 12:55                 ` Peter Osterlund
2004-07-14 13:22                   ` William Lee Irwin III [this message]
2004-07-14 20:00                     ` Peter Osterlund

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=20040714132256.GR3411@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=petero2@telia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.