[lkml]   [2004]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: swapping and the value of /proc/sys/vm/swappiness

    Marcelo Tosatti wrote:

    > Huh, that changes the meaning of the dirty limits. Dont think its suitable
    > for mainline.

    The change is, in fact, not much different from what is already actually
    there. The code in get_dirty_limits() adjusts the value of the user supplied
    parameters in /proc/sys/vm depending on how much mapped memory there is. If
    you undo the convoluted arithmetic that is in there, one finds that if you are
    using the default dirty_ratio of 40%, then if the unmapped_ratio is between
    80% and 10%, then

    dirty_ratio = unmapped_ratio / 2;

    and, a little bit of algebra later:

    dirty = (total_pages - wbs->nr_mapped)/2


    background = dirty_background_ratio/vm_background_ratio * (total_pages
    - wbs->nr_mapped)

    That is, for a wide range of memory usage, you are really running with an
    dirty ratio of 50% stated in terms of the number of unmapped pages, and there
    is no direct way to override this.

    Of course, at the edges, the code changes these calculations. It just seems
    to me that rather than continue the convoluted calculation that is in
    get_dirty_limits(), we just make the outcome more explicit and tell the user
    what is really going on.

    We'd still have to figure out how to encourage a minimum page cache size of
    some kind, which is what I understand the 5% min value for dirty_ratio is in
    there for.

    Best Regards,
    Ray Bryant
    512-453-9679 (work) 512-507-7807 (cell)
    The box said: "Requires Windows 98 or better",
    so I installed Linux.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:06    [W:0.021 / U:12.752 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site