You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raspberry Pi is very limited in RAM. Can you please enable zram (CONFIG_ZRAM) in kernel config? Compressing in ARM CPU is still a lot faster than writing swap to sd disk (and save write cycles for storage media). Thanks a lot!
needs:
CONFIG_ZSMALLOC=m
CONFIG_ZRAM=m
but this might need more scripted support too, like to make or move a swap partition on a /dev/zramX device, or folders like /tmp and /run
also, CleanCache & FrontSwap are nice to have and they do not need extra scripting work to have an effect:
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
Any evidence on the effect of CleanCache and FrontSwap on performance when ZRAM is not enabled.
They include the phrase "resulting in a negligible performance hit".
The tracing options we had enabled a while back included that phrase and cost us 10-20% of performance.
These were the tracing options that proved expensive: 5412f28
Reduced iperf speed by 20% and xbmc framerate by 10%.
Other possible benchmarks might be nbench and the quake timed demo.
You need to keep in mind that the tracing itself has non-neglible preformance implications.
Just using some userspace benchmarks, i notice on average a 2-5% increase in latency when using the SD card for root and swap, and about 1-3% when using a USB connected SSD for both.
The data might also be different between rev 1 and rev 2 hardware, because they use unallocated memory only, the numbers I listed above are for a rev 1 board, I'm picking up a rev 2 later this week, and can do the same checks on that board if you like.
One thing that I've noticed, in my own kernel too, BogoMIPS number gets messed up, so usually BogoMIPS follows ARM core freq say 697 for stock or 849 ( when OC to 850MHz ), yet now with kernel #350 it's 547 for 850MHz. Any idea?
Another option is to use older raspbian kernel that still supports it.
Also when 256M is dedicated to zram, you can expect only max. 128MB real gain in usable virtual memory (it compresses only 2:1). It's best for occassional spikes, like gcc compilations. Might not help for sustained heavyweight memory hogs like LibreOffice.
Yes, it's built into the kernel now. It seems to improve performance and stability for me by avoiding applications getting killed due to OOM conditions. It's particularly good with multi-stream LZ4 compression. Here's the script I use to enable it on my Pi 3 and Pi 2 boards: https://gist.github.com/sultanqasim/79799883c6b81c710e36a38008dfa374
Activity
licaon-kter commentedon Dec 30, 2012
needs:
CONFIG_ZSMALLOC=m
CONFIG_ZRAM=m
but this might need more scripted support too, like to make or move a swap partition on a /dev/zramX device, or folders like /tmp and /run
also, CleanCache & FrontSwap are nice to have and they do not need extra scripting work to have an effect:
CONFIG_CLEANCACHE=y
CONFIG_FRONTSWAP=y
Ferroin commentedon Dec 30, 2012
I can say from experience that CleanCache and FrontSwap improve overall system performance.
krisan commentedon Jan 2, 2013
how can I get this zram module working after firmware upgrade to 3.6.11+ ?
popcornmix commentedon Jan 3, 2013
Any evidence on the effect of CleanCache and FrontSwap on performance when ZRAM is not enabled.
They include the phrase "resulting in a negligible performance hit".
The tracing options we had enabled a while back included that phrase and cost us 10-20% of performance.
licaon-kter commentedon Jan 3, 2013
I compiled them, any pointers on what tracing options you used and what/how should I test?
popcornmix commentedon Jan 3, 2013
These were the tracing options that proved expensive:
5412f28
Reduced iperf speed by 20% and xbmc framerate by 10%.
Other possible benchmarks might be nbench and the quake timed demo.
Ferroin commentedon Jan 3, 2013
You need to keep in mind that the tracing itself has non-neglible preformance implications.
Just using some userspace benchmarks, i notice on average a 2-5% increase in latency when using the SD card for root and swap, and about 1-3% when using a USB connected SSD for both.
The data might also be different between rev 1 and rev 2 hardware, because they use unallocated memory only, the numbers I listed above are for a rev 1 board, I'm picking up a rev 2 later this week, and can do the same checks on that board if you like.
licaon-kter commentedon Jan 4, 2013
stock freqs, kernel 3.6.11 as build 346
nbench compiled as per Eben's challenge thread ( CFLAGS = -s -static -Wall -O3 -fomit-frame-pointer -funroll-loops -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard ):
#346 stock: http://pastebin.com/2u0qtCnz
#346+cleancache+frontswap: http://pastebin.com/2KF1wSiC
quake3demo using my 2 demos ( mentioned here http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=6201&p=183723#p183723 and reuploaded here: http://www.sendspace.com/file/3vv92n ):
#346 stock: 24.3fps / 36.1fps
#346+cleancache+frontswap: 24.6fps / 36.3fps
popcornmix commentedon Jan 4, 2013
@licaon-kter
sounds okay. Any difference in free memory after boot?
licaon-kter commentedon Jan 5, 2013
Not sure what you want me to check,but:
I get:
stock:
with Cleancache+Frontswap:
popcornmix commentedon Jan 7, 2013
Added these options. Use rpi-update and test please.
licaon-kter commentedon Jan 8, 2013
One thing that I've noticed, in my own kernel too, BogoMIPS number gets messed up, so usually BogoMIPS follows ARM core freq say 697 for stock or 849 ( when OC to 850MHz ), yet now with kernel #350 it's 547 for 850MHz. Any idea?
licaon-kter commentedon Feb 26, 2013
I just realized that zcache is not activated, can you
CONFIG_ZSMALLOC=y
CONFIG_ZCACHE=y
it will activate some CONFIG_LZO_* too
This is in staging, true, but it will not activate unless one adds the zcache keyword in the cmdline.txt so it won't affect anything else.
popcornmix commentedon Feb 26, 2013
I've added those options and looked at free memory after boot. We lose 168K.
That seems a bit expensive for an option few people will use.
36 remaining items
zerxy commentedon Nov 4, 2014
Google think it helps. They're using it in Chrome OS. It certainly beats using swap on a slow SD card.
marji: Download my zram enabled 3.10.59 kernel for the Pi at http://wikisend.com/download/264740/kernel.img
With that kernel installed you can put 256 MB of swap (recommended for 512 MB Pi) on zram by doing the following:
echo 268435456 > /sys/block/zram0/disksize
mkswap /dev/zram0
swapon -p 100 /dev/zram0
Let us know how you get on.
jurov commentedon Nov 5, 2014
Another option is to use older raspbian kernel that still supports it.
Also when 256M is dedicated to zram, you can expect only max. 128MB real gain in usable virtual memory (it compresses only 2:1). It's best for occassional spikes, like gcc compilations. Might not help for sustained heavyweight memory hogs like LibreOffice.
ARM: fix lockdep unannotated irqs-off warning
Ruffio commentedon May 8, 2016
Isn't zram build into the kernel already now?
ARM: dts: exynos: Add async-bridge clock to MFC power domain for Exyn…
sultanqasim commentedon Jun 21, 2016
Yes, it's built into the kernel now. It seems to improve performance and stability for me by avoiding applications getting killed due to OOM conditions. It's particularly good with multi-stream LZ4 compression. Here's the script I use to enable it on my Pi 3 and Pi 2 boards: https://gist.github.com/sultanqasim/79799883c6b81c710e36a38008dfa374
ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get…
ipmr, ip6mr: fix scheduling while atomic and a deadlock with ipmr_get…
crypto: talitos - fix memory corruption on SEC2
crypto: talitos - fix memory corruption on SEC2
powerpc/pseries: Fix unitialized timer reset on migration
powerpc/pseries: Fix unitialized timer reset on migration
smc91x: fix broken irq-context in PREEMPT_RT
smc91x: fix broken irq-context in PREEMPT_RT
smc91x: fix broken irq-context in PREEMPT_RT