Linux kswapd but without swap partition - Linux

This is a discussion on Linux kswapd but without swap partition - Linux ; Hi, I am doing embedded system, we don't configure the swap partition till now: cat /proc/swaps Filename Type Size Used Priority We are doing migration from 64M RAM to 32M RAM, so sometimes the RAM is stringent(actually it's after some ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Linux kswapd but without swap partition

  1. Linux kswapd but without swap partition

    Hi,

    I am doing embedded system, we don't configure the swap partition till
    now:

    cat /proc/swaps
    Filename Type Size Used
    Priority

    We are doing migration from 64M RAM to 32M RAM, so sometimes the RAM
    is stringent(actually it's after some time threshold), it is because
    the memory leak I think.

    But I am curious why the top show that kswapd is consuming many CPU
    power when the system getting low memory, I mean, without configured
    swap partition. I can guess what the kswapd doing now is shrink the
    cache/buffer pages to fetch more memory. But it really slow down the
    entire system.

    So what I want to do is configure the page/buffer cache size to make
    it smaller than original 64MB configuration, which by another way is
    doing kswapd's work by hand. How can I tune such parameters? Do I need
    to recompile the kernel?

    Or I am wrong in the direction? Any other jobs the kswapd is doing
    also?

    Thanks.
    Bin


  2. Re: Linux kswapd but without swap partition

    In comp.os.linux.development.system Bin Chen wrote:

    | But I am curious why the top show that kswapd is consuming many CPU
    | power when the system getting low memory, I mean, without configured
    | swap partition. I can guess what the kswapd doing now is shrink the
    | cache/buffer pages to fetch more memory. But it really slow down the
    | entire system.

    It is spending more time looking around for pages to swap out, even
    though there is no place to put them. It would help to have _some_
    swap space, even less than RAM. And it can be a small (1M) ramdisk.

    --
    |---------------------------------------/----------------------------------|
    | Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
    | first name lower case at ipal.net / spamtrap-2007-06-15-0737@ipal.net |
    |------------------------------------/-------------------------------------|

  3. Re: Linux kswapd but without swap partition

    On Jun 15, 8:40 pm, phil-news-nos...@ipal.net wrote:
    > In comp.os.linux.development.system Bin Chen wrote:
    >
    > | But I am curious why the top show that kswapd is consuming many CPU
    > | power when the system getting low memory, I mean, without configured
    > | swap partition. I can guess what the kswapd doing now is shrink the
    > | cache/buffer pages to fetch more memory. But it really slow down the
    > | entire system.
    >
    > It is spending more time looking around for pages to swap out, even
    > though there is no place to put them. It would help to have _some_
    > swap space, even less than RAM. And it can be a small (1M) ramdisk.
    >

    If no swap at all, why it STILL try to swap??



  4. Re: Linux kswapd but without swap partition

    On 2007-06-15, Bin Chen wrote:

    > On Jun 15, 8:40 pm, phil-news-nos...@ipal.net wrote:
    >> In comp.os.linux.development.system Bin Chen wrote:
    >>
    >> | But I am curious why the top show that kswapd is consuming many CPU
    >> | power when the system getting low memory, I mean, without configured
    >> | swap partition. I can guess what the kswapd doing now is shrink the
    >> | cache/buffer pages to fetch more memory. But it really slow down the
    >> | entire system.
    >>
    >> It is spending more time looking around for pages to swap out, even
    >> though there is no place to put them. It would help to have _some_
    >> swap space, even less than RAM. And it can be a small (1M) ramdisk.
    >>

    > If no swap at all, why it STILL try to swap??


    does it also choose which text pages to unmap?

    Bye.
    Jasen

  5. Re: Linux kswapd but without swap partition

    On Jun 16, 10:55 am, Jasen wrote:
    > On 2007-06-15, Bin Chen wrote:
    >
    > > On Jun 15, 8:40 pm, phil-news-nos...@ipal.net wrote:
    > >> In comp.os.linux.development.system Bin Chen wrote:

    >
    > >> | But I am curious why the top show that kswapd is consuming many CPU
    > >> | power when the system getting low memory, I mean, without configured
    > >> | swap partition. I can guess what the kswapd doing now is shrink the
    > >> | cache/buffer pages to fetch more memory. But it really slow down the
    > >> | entire system.

    >
    > >> It is spending more time looking around for pages to swap out, even
    > >> though there is no place to put them. It would help to have _some_
    > >> swap space, even less than RAM. And it can be a small (1M) ramdisk.

    >
    > > Ifno swapat all, why it STILL try to swap??

    >
    > does it also choose which text pages to unmap?
    >
    > Bye.
    > Jasen


    And on what basis it can unmap the text pages ?


  6. Re: Linux kswapd but without swap partition

    Vicky wrote:
    [...]
    > And on what basis it can unmap the text pages ?


    Because text pages are read-only and exist in files, so can be trivially
    reloaded if needed. Discarding text pages that haven't been used for a while
    is a standard technique to recover memory.

    --
    ┌── dg*cowlark.com ─── http://www.cowlark.com ──────────────── ──

    │ "There does not now, nor will there ever, exist a programming language in
    │ which it is the least bit hard to write bad programs." --- Flon's Axiom

  7. Re: Linux kswapd but without swap partition

    On Aug 1, 6:18 pm, David Given wrote:
    > Vicky wrote:
    >
    > [...]
    >
    > > And on what basis it can unmap the text pages ?

    >
    > Because text pages are read-only and exist in files, so can be trivially
    > reloaded if needed. Discarding text pages that haven't been used for a while
    > is a standard technique to recover memory.
    >
    > --
    > http://www.cowlark.com
    >
    > "There does not now, nor will there ever, exist a programming language in
    > which it is the least bit hard to write bad programs." --- Flon's Axiom


    But it still cannot unload all the text area in case of memory
    pressure, it needs to have some text for execution.
    So my question is how much it will keep and how much it will unload to
    be read again when demand paged.


  8. Re: Linux kswapd but without swap partition

    Vicky wrote:
    [...]
    > But it still cannot unload all the text area in case of memory
    > pressure, it needs to have some text for execution.
    > So my question is how much it will keep and how much it will unload to
    > be read again when demand paged.


    Oh, I see --- I thought you were asking *why*, not how.

    I don't know exactly. I presume it uses some heuristics based on how recently
    a page was used, how high a priority the process using the page is, and how
    urgently it needs the memory --- after all, process that's asleep is obviously
    not running any code, therefore its code can all be discarded.

    Given that text pages don't have to be saved, it's actually faster to throw
    away text than to swap out data, so it probably does it in preference to
    normal swappng.

    --
    ┌── dg*cowlark.com ─── http://www.cowlark.com ──────────────── ──

    │ "There does not now, nor will there ever, exist a programming language in
    │ which it is the least bit hard to write bad programs." --- Flon's Axiom

  9. Re: Linux kswapd but without swap partition


    "David Given" wrote in message
    news:46b201fc$0$645$5a6aecb4@news.aaisp.net.uk...
    > Given that text pages don't have to be saved, it's actually faster to
    > throw away text than to swap out data, so it probably does it in
    > preference to normal swappng.


    Pre-emptive paging gives the same effect for data (not sure if Linux does
    this or not).

    Alex



+ Reply to Thread