[Arm-dev] unable to configure zram-swap on RPI 4 8G model (32bit)

Thu Dec 17 17:09:00 UTC 2020
mark <mark at havak.nl>

-----Original message-----
> From: mark <mark at havak.nl>
> Sent: Monday, December 14, 2020 6:15 PM
> To: Pablo Sebastián Greco <pablo at fliagreco.com.ar>; Conversations around CentOS on ARM hardware <arm-dev at centos.org>
> Subject: RE: [Arm-dev] unable to configure zram-swap on RPI 4 8G model (32bit)
>
>
>
> -----Original message-----
> > From: Pablo Sebastián Greco <pablo at fliagreco.com.ar>
> > Sent: Monday, December 14, 2020 6:00 PM
> > To: Conversations around CentOS on ARM hardware <arm-dev at centos.org>; mark
> <mark at havak.nl>
> > Subject: Re: [Arm-dev] unable to configure zram-swap on RPI 4 8G model (32bit)
> >
> >
> > On 14/12/20 13:43, mark wrote:
> > >
> > > -----Original Message-----
> > > From: Pablo Sebastián Greco <pablo at fliagreco.com.ar>
> > > Sent: maandag 14 december 2020 17:20
> > > To: Conversations around CentOS on ARM hardware <arm-dev at centos.org>;
> mark
> > <mark at havak.nl>
> > > Subject: Re: [Arm-dev] unable to configure zram-swap on RPI 4 8G model
> (32bit)
> > >
> > >
> > > On 14/12/20 11:42, mark wrote:
> > >> Being aware using zram-swap is not a default feature  on the CentOS
> > >> Userland for armv7hl, Still want to share the problem I ran in to.
> > >>
> > >> I turns out the arm 32bit kernel with large memory support OOPS if zram-swap
> > is deployed if the system has more than 4GB ram.
> > > I'm a heavy user of zram-swap, even not being default, but I have only
> used
> > with devices that have 2G max, this is interesting. Does it still happen
> if
> > you limit the size?
> > >
> > > Did not test limiting the ram to 4GB myself jet, it does according to
> :
> > > https://github.com/raspberrypi/linux/issues/3839#issuecomment-723027652
> > I meant limiting the size of the zram-swap
>
> No the size of the swap does not seem matter: I tried 512, 1024 and 4096MB
>
> On a RPI4 4GB model it works just fine,
> on a 8GB model I get a "Internal error: Oops: 207"
>
> BTW running a fresh homebrew image of CentOS 7.9.2009 without a swap-partition
> and kernel:
> 5.4.72-v7l.1.el7 #1 SMP Wed Oct 21 17:20:56 UTC 2020 armv7l armv7l armv7l
> GNU/Linux
>
>
> > >
> > >
> > >> This issue seems to be addressed (verry recently) in kernel 5.4.81 (1)
> > >>
> > >> As mentioned this is verry recently, version 5.4.81 is just 12 day's
> old..
> > >> However if there is a testbuild of this rpi2-kernel4: I'm eager to test
> > it 

Just a heads-up,

I could not figure out how to make a test build of a kernel => 5.4.81 based on the current raspberrypi2-kernel4-5.4.72 kernel.
Not knowledgeable enough to update the rpi-5.4.x.patch... My Bad

However was able to rebuild the current kernel with the patch mentioned in the commit (1);
needed to include an other, quite harmless looking, patch in order to get it applied clean

Long story short, zram-swap works on my RPI4 8G model:

# swapon --show
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition 3.7G   0B   -2

# uname -a
Linux localhost 5.4.72-v7l.1.1.el7 #1 SMP Thu Dec 17 16:13:03 CET 2020 armv7l armv7l armv7l GNU/Linux

# free -m
              total        used        free      shared  buff/cache   available
Mem:           7876          94        7469          16         312        7691
Swap:          3755           0        3755


In my (probably short lived) git repo the changes I made:
https://github.com/markVnl/Centos-raspberrypi2-kernel/tree/zram-swap-oops


> > > There's no test build yet, I'm still adjusting to what happened last
> > > week, but hopefully we'll have a new kernel soon
> > >> 1) https://github.com/raspberrypi/linux/commit/1bef5f25a69234613b92a0e2456870fee4a57efc
> > >>
> > >>   
> > > Pablo.
> > >
> > > _______________________________________________
> > > Arm-dev mailing list
> > > Arm-dev at centos.org
> > > https://lists.centos.org/mailman/listinfo/arm-dev
> >