• swapon command error

    From lin dimitri@21:1/5 to All on Thu Sep 9 16:40:02 2021
    Hi,

    I am trying to increase my swap memory, below is the commands I used:-
    $ sudo swapon --show
    $ sudo swapoff -a
    $ sudo fallocate -l 4G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    swapon failed: Function not implemented

    i got above error.

    I have CONFIG_SWAP=y in /proc/config.gz.

    i don't know how this can be solved

    plz help.


    Regards,

    lin

    <div dir="ltr"><div>Hi,</div><div><br></div><div>I am trying to increase my swap memory, below is the commands I used:-</div><div>$ sudo swapon --show</div><div>$ sudo swapoff -a<br></div><div>$ sudo fallocate -l 4G /swapfile<br>$ sudo chmod 600 /
    swapfile<br>$ sudo mkswap /swapfile<br>$ sudo swapon /swapfile</div><div>swapon failed: Function not implemented</div><div><div class="gmail-post-message" dir="auto"><div><p>i got above error.</p><p> I have CONFIG_SWAP=y in /proc/config.gz.</p><p>i don&#
    39;t know how this can be solved</p><p>plz help.</p><p><br></p><p>Regards,</p><p>lin<br></p></div></div></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From stefano gozzi@21:1/5 to lindimitri@gmail.com on Thu Sep 9 19:10:02 2021
    maybe you are using a custom kernel without swapfile flag?
    try to use the standard debian kernel
    all the best
    ste

    On Thu, Sep 9, 2021 at 4:33 PM lin dimitri <lindimitri@gmail.com> wrote:

    Hi,

    I am trying to increase my swap memory, below is the commands I used:-
    $ sudo swapon --show
    $ sudo swapoff -a
    $ sudo fallocate -l 4G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    swapon failed: Function not implemented

    i got above error.

    I have CONFIG_SWAP=y in /proc/config.gz.

    i don't know how this can be solved

    plz help.


    Regards,

    lin


    <div dir="ltr"><div>maybe you are using a custom kernel without swapfile flag?<br></div><div>try to use the standard debian kernel</div><div>all the best</div><div>ste<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu,
    Sep 9, 2021 at 4:33 PM lin dimitri &lt;<a href="mailto:lindimitri@gmail.com">lindimitri@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="
    ltr"><div>Hi,</div><div><br></div><div>I am trying to increase my swap memory, below is the commands I used:-</div><div>$ sudo swapon --show</div><div>$ sudo swapoff -a<br></div><div>$ sudo fallocate -l 4G /swapfile<br>$ sudo chmod 600 /swapfile<br>$
    sudo mkswap /swapfile<br>$ sudo swapon /swapfile</div><div>swapon failed: Function not implemented</div><div><div dir="auto"><div><p>i got above error.</p><p> I have CONFIG_SWAP=y in /proc/config.gz.</p><p>i don&#39;t know how this can be solved</p><p>
    plz help.</p><p><br></p><p>Regards,</p><p>lin<br></p></div></div></div></div> </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Matus UHLAR - fantomas@21:1/5 to lin dimitri on Thu Sep 9 19:20:02 2021
    On 09.09.21 19:46, lin dimitri wrote:
    I am trying to increase my swap memory, below is the commands I used:-
    $ sudo swapon --show
    $ sudo swapoff -a
    $ sudo fallocate -l 4G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    swapon failed: Function not implemented

    i got above error.

    I have CONFIG_SWAP=y in /proc/config.gz.

    i don't know how this can be solved

    from mkswap man page:

    Note that a swap file must not contain any holes. Using cp(1) to cre‐
    ate the file is not acceptable. Neither is use of fallocate(1) on file
    systems that support preallocated files, such as XFS or ext4, or on
    copy-on-write filesystems like btrfs. It is recommended to use dd(1)
    and /dev/zero in these cases. Please read notes from swapon(8) before
    adding a swap file to copy-on-write filesystems.


    --
    Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
    Warning: I wish NOT to receive e-mail advertising to this address.
    Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
    Posli tento mail 100 svojim znamim - nech vidia aky si idiot
    Send this email to 100 your friends - let them see what an idiot you are

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tom Dial@21:1/5 to lin dimitri on Fri Sep 10 00:10:02 2021
    I can't contribute to solving the problem you state, but it is not clear
    that it is the real problem at all.

    You do not describe the system on which you want to add a swap file or
    the problem that is meant to solve, but the list addressed,
    debian-laptop, suggests it might be a laptop. If that is true, and if
    the root problem is poor performance or insufficient main memory for the workload, adding swap is unlikely to solve it.

    At best, adding swap allows the system scheduler to substitute paging to storage that is hundreds to tens of thousands of times slower than main
    memory when there is not enough RAM available. That is reasonable in
    server environments in which there are dozens to hundreds of active jobs
    in memory and many of them may be waiting at any given time for slow
    operations like network or storage I/O.

    On a laptop being used interactively, it often is not reasonable to have
    swap at all or, at most, more than a small amount to handle occasional,
    but rare, instances of full memory to avoid a system crash. Significant
    swap activity, whether to a device or an even slower file, is very
    unlikely to improve performance.

    The best way to improve performance issues caused by insufficient memory
    is to add memory. Running fewer jobs or opening fewer browser tabs may
    improve performance, but adding swap to an actively swapping system and
    keeping the workload the same (or increasing it) is quite unlikely to
    improve performance, and might make it worse.

    Regards,
    Tom Dial


    On 9/9/21 08:16, lin dimitri wrote:
    Hi,

    I am trying to increase my swap memory, below is the commands I used:-
    $ sudo swapon --show
    $ sudo swapoff -a
    $ sudo fallocate -l 4G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    swapon failed: Function not implemented

    i got above error.

    I have CONFIG_SWAP=y in /proc/config.gz.

    i don't know how this can be solved

    plz help.


    Regards,

    lin


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mi@21:1/5 to All on Sun Feb 12 19:40:02 2023
    storage that is hundreds to tens of thousands of times slower than main memory

    That's true and all your arguments are noteworthy.

    But is swap performance really that horrible with modern SSDs ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dan Ritter@21:1/5 to All on Mon Feb 13 23:30:01 2023
    mi wrote:

    storage that is hundreds to tens of thousands of times slower than main memory

    That's true and all your arguments are noteworthy.

    But is swap performance really that horrible with modern SSDs ?

    It's much better than it was, and still terrible.

    -dsr-

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)