[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: swap-fle on arm64, need to disable, how?



Hello,

On Sat, Sep 30, 2023 at 03:26:19AM -0400, gene heskett wrote:
> On 9/29/23 17:32, Andy Smith wrote:
> > On Fri, Sep 29, 2023 at 04:36:04PM -0400, gene heskett wrote:
> > > Swap file is the last thing I want, much slower than a swap partition.
> > 
> > There has been no performance difference between swap files and
> > swap partitions for more than a decade.
> 
> Maybe on wintel stuff, but the u-sd card the pi runs on has a write speed
> below 10 megs/second, an extremely obvious performance hit, and wearing out
> the u-sd card rapidly.

Please show evidence or retract your claim that on a raspberry pi a
swap partition performs better than a swap file (when they are both
on the same storage device). I believe you are making it up, as it
isn't the case in the kernel code and should not make any difference
by architecture.

Testimony from one of the maintainers of the memory management and
ext filesystems in the Linux kernel:

    https://lkml.org/lkml/2005/6/29/11
    https://lkml.org/lkml/2005/7/7/326

Swapping on SD cards in general is a bad idea regardless of
architecture, but there should be no difference between swap file or
swap partition. I did not suggest you swap to a file on SD card. I
suggested that whether you swap to a file on SSD or a partition on
SSD, the performance will be the same.

> Here is the current fstab:
>  cnc@rpi4:~$ cat /etc/fstab
> UUID=8E25-4B18  /boot/broadcom                          vfat defaults,flush
> 0 2
> UUID=47946eb6-d88c-4331-bba9-cbe269a35925       /       ext4
> defaults,noatime,commit=600,errors=remount-ro 0 1
> tmpfs                                           /tmp    tmpfs
> defaults,nosuid 0 0
> # to which I've added but commented ATM
> #LABEL=TEMP1                                    /tmp    ext4
> defaults,noatime,errors=remount-ro 0 1

There's no swap listed there and the only thing you've added seems
to have a comment in front of it, so you've effectively added
nothing so I don't understand why you expect something to change now.

> > > cnc@rpi4:/etc$ sudo swapon -s
> > > Filename                                Type            Size Used
> > > Priority
> > > /dev/zram0                              partition       1048572 98304
> > > 100
> > > /dev/sda2                               partition       9859068 0
> > > -3
> > > 
> > > I need it to forget zram0 and use the swap on sda2
> > 
> > You didn't respond to the part about /etc/fstab so we have no idea
> > if you found the information you needed.
> 
> I didn't find the swap listed in the fstab, its apparently setup someplace
> else in debian 12 for arm64's, so I've not finalized that yet.  Awaiting
> guidance.

This isn't Debian 12 though is it? Debian doesn't use zram by
default so this is something else. As usual we struggle to answer
your questions as they're off-topic here, amongst other
difficulties.

As the other poster mentioned, zram is set up by a systemd unit but I
don't know more about it off the top of my head.

> > 1. swapoff -a
> > 2. edit /etc/fstab to be correct
> > 3. swapon -a
> 
> I'd also point out that despite the presence of the above listed swap,
> swapon -a and swapoff -a, does not enable it, I have to mount it by hand.

As I said, your fstab as shown does not contain any reference to
swap, so I'm not surprised that you have to manually tell it to use
/dev/sda2.

First tackle disabling the zram (or making it use sda2).

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: