Re: Very aggressive swapping after 2 hours rest

From: Byron Stanoszek (gandalf@winds.org)
Date: Sat Sep 16 2000 - 14:27:08 EDT

  • Next message: Alain Knaff: "Re: [PATCH] Fix floppy ioctl (which were broken in 2.4.0-test5)"

    On Sat, 16 Sep 2000, Rik van Riel wrote:

    > MemFree: memory on the freelist, contains no data
    > Buffers: buffer cache memory
    > Cached: page cache memory
    >
    > Active: buffer or page cache memory which is in active
    > use (that is, page->age > 0 or many references)
    > Inact_dirty: buffer or cache pages with page->age == 0 that
    > /might/ be freeable
    > (page->buffers is set or page->count == 2 when
    > we add the page ... while holding a reference)
    > Inact_clean: page cache pages with page->age == 0 of which
    > we are /certain/ that they are freeable, these
    > are counted almost as free pages
    > Inact_target: the net amount of allocations we get per second,
    > averaged over one minute

    I think I understand what those numbers mean, now. :)

    But, I guess I'm still looking for a calculation that tells me exactly how many
    free (non-in-use) pages that I can allocate before running out of memory. In
    other words, how many KB of memory processes are actually taking up, versus
    buffer/cache space.

    For example, this doesn't tell me how much memory I can allocate before I
    get to the point where swapping is inevitable:

    root:~/local/benchmarks> cat /proc/meminfo; free
     [stuff omitted]
    Buffers: 16648 kB
    Cached: 35276 kB
    Active: 2036 kB
    Inact_dirty: 37264 kB
    Inact_clean: 12624 kB
    Inact_target: 4 kB
                 total used free shared buffers cached
    Mem: 126516 98852 27664 0 16648 35276
    -/+ buffers/cache: 46928 79588
    Swap: 32124 0 32124

    So I take a guess and allocate that much memory.

    root:~/local/benchmarks> ./memspeed 88
    Memory read 88M: 784.57 MB/s
    Memory fill 88M: 347.12 MB/s
    8-byte fill 88M: 344.73 MB/s
    Memory copy 44M: 163.47 MB/s
    8-byte copy 44M: 231.42 MB/s
    Memory cmp 44M: 100.46 MB/s (Test OK)
    Mem search 88M: 254.24 MB/s

    Overall Memory Performance: 343.56 MB/s
    root:~/local/benchmarks> echo $[27664+16648+35276]
    79588
    root:~/local/benchmarks> cat /proc/meminfo; free
     [stuff omitted]
    Buffers: 264 kB
    Cached: 7836 kB
    Active: 5080 kB
    Inact_dirty: 956 kB
    Inact_clean: 2064 kB
    Inact_target: 0 kB
                 total used free shared buffers cached
    Mem: 126516 34728 91788 0 264 7836
    -/+ buffers/cache: 26628 99888
    Swap: 32124 964 31160

    Here, the value 26628+964 is closer to what the 'actual' amount of RAM usage
    really is by processes (minus shared mem, buffers, and cache). But I was unable
    to find that without the allocation. So, my question is, is it possible to add
    a line to /proc/meminfo that tells us this information? Or am I going against
    the whole grain of the VM management system?

      -Byron

    -- 
    Byron Stanoszek                         Ph: (330) 644-3059
    Systems Programmer                      Fax: (330) 644-8110
    Commercial Timesharing Inc.             Email: bstanoszek@comtime.com
    

    - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Sep 16 2000 - 14:58:57 EDT