Re: headsup: swap_pager.c

From: Andy Farkas (andyf_at_speednet.com.au)
Date: 08/02/03

  • Next message: Mike Silbersack: "Another 4.x ABI question; uidinfo"
    Date: Sat, 2 Aug 2003 10:28:10 +1000 (EST)
    To: Poul-Henning Kamp <phk@phk.freebsd.dk>
    
    

    Poul-Henning Kamp wrote:

    > People who do not adjust NSWAPDEV to match their configuration spend
    > a lot of RAM on holding the radix bitmap which is 3/4 empty:
    >
    > critter phk> sysctl kern.malloc | grep -i swap
    > SWAP 2 753K 753K 2 64
    > critter phk> pstat -s
    > Device 1K-blocks Used Avail Capacity
    > /dev/ad0s1b 1321312 0 1321312 0%
    >
    > This is because the radix bitmap gets allocated for the full
    > stripe width, but only one quarter of it is actually used.
    >
    > Another thing is that striping does not belong in the swap_pager in
    > the first place, we have CCD and similar pieces of code for that.

    I wasn't going to say anything (you can delete now) but the more I think
    about it, the more I think "if it aint broke, dont fix it".

    For a start, what do those kern.malloc numbers mean? Mine are different:

    # sysctl kern.malloc | grep -i swap
             SWAP 2 73K 137K 12 64,65536
    # pstat -s
    Device 1K-blocks Used Avail Capacity Type
    /dev/ad0s1b 65536 144 65392 0% Interleaved
    /dev/md0 65104 0 65104 0% Interleaved
    /dev/md1 65104 0 65104 0% Interleaved
    /dev/md2 130208 0 130208 0% Interleaved
    Total 325952 144 325808 0%

    I don't understand what the concern about using "a lot of RAM" is when you
    yourself say that RAM is cheap. If its affecting KVA or something, then
    maybe NSWAPDEV should be added into GENERIC along with an explanation that
    tuning it saves memory. If the user^Wadmin is aware of the "problem" then
    she can adjust the value when she customises her kernel.

    Maybe it should be mentioned somewhere (sysinstall or swapctl.8) that the
    *size* of swap also affect the memory footprint of the kernel. The general
    rule is to have swap 2x RAM - do people really make huge swapfiles that
    never get used? My box has 512M RAM, my swapfile size is 64M and hardly
    used. I don't do crashdumps. Sure, developers will want crashdumps...but
    thats different.

    So I guess Im saying you could "fix" this issue but just documenting what
    effects swapfile metrics have on your RAM.

    --
     :{ andyf@speednet.com.au
            Andy Farkas
        System Administrator
       Speednet Communications
     http://www.speednet.com.au/
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: Mike Silbersack: "Another 4.x ABI question; uidinfo"

    Relevant Pages