lkml.org 
[lkml]   [2004]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [2.4] heavy-load under swap space shortage
    On Mon, 2 Feb 2004 j-nomura@ce.jp.nec.com wrote:
    >
    > swap_out() seems always trying scan even if there are no swap space available.
    > This keeps CPU(s) busy with rare successful page-out and may cause lock
    > contention in big smp system.
    >...
    > How about checking nr_swap_pages first and giving up if it's 0?

    Sorry, no. Don't be misled by the name, swap_out() is used to free
    all kinds of mapped pages, not just those which would end up on swap.
    Your patch just disables freeing mapped pages under memory pressure.

    You could try the untested patch below to swap_out_vma(), but I don't
    really recommend it: it still skips freeing up a less common category
    of clean pages, just when you'd most like to free them.

    Hugh

    --- 2.4.25-pre8/mm/vmscan.c 2004-01-30 13:41:14.000000000 +0000
    +++ linux/mm/vmscan.c 2004-02-02 13:01:28.067918544 +0000
    @@ -263,6 +263,14 @@
    if (vma->vm_flags & VM_RESERVED)
    return count;

    + /* If no swap, don't waste time on areas which need it */
    + if (nr_swap_pages <= 0) {
    + if (!vma->vm_ops ||
    + !vma->vm_ops->nopage ||
    + vma->vm_ops->nopage == shmem_nopage)
    + return count;
    + }
    +
    pgdir = pgd_offset(mm, address);

    end = vma->vm_end;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:00    [W:2.549 / U:0.144 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site