lkml.org 
[lkml]   [2004]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: Can't make use of swap memory in 2.6.7-bk19
    Peter Osterlund wrote:
    > I created a test program that allocates a 300MB buffer and writes to
    > all bytes sequentially. On my computer, which has 256MB RAM and 512MB
    > swap, the program gets OOM killed after dirtying about 140-180MB, and
    > the kernel reports:
    >

    Someone hand me a paper bag... Peter, can you give this patch a try?



    ---

    linux-2.6-npiggin/mm/vmscan.c | 6 +++---
    1 files changed, 3 insertions(+), 3 deletions(-)

    diff -puN mm/vmscan.c~vm-allocfail-fix mm/vmscan.c
    --- linux-2.6/mm/vmscan.c~vm-allocfail-fix 2004-07-08 12:10:29.000000000 +1000
    +++ linux-2.6-npiggin/mm/vmscan.c 2004-07-08 12:12:33.000000000 +1000
    @@ -917,12 +917,12 @@ int try_to_free_pages(struct zone **zone
    sc.nr_reclaimed += reclaim_state->reclaimed_slab;
    reclaim_state->reclaimed_slab = 0;
    }
    - if (sc.nr_reclaimed >= SWAP_CLUSTER_MAX) {
    + total_scanned += sc.nr_scanned;
    + total_reclaimed += sc.nr_reclaimed;
    + if (total_reclaimed >= SWAP_CLUSTER_MAX) {
    ret = 1;
    goto out;
    }
    - total_scanned += sc.nr_scanned;
    - total_reclaimed += sc.nr_reclaimed;

    /*
    * Try to write back as many pages as we just scanned. This
    _
    \
     
     \ /
      Last update: 2005-03-22 14:04    [W:4.142 / U:1.804 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site