Raspberry Pi Boosts Performance with Micron Through Memory Timing Adjustments
According to a post by engineers at the Raspberry Pi Foundation, Raspberry Pi is currently collaborating with Micron to enhance performance through optimization of memory timing. These adjustments have led to noticeable improvements in the performance of both Raspberry Pi 4 and 5.
For instance, the Raspberry Pi 5 has seen speed increases of 10% to 20% at its standard frequency of 2.4GHz without overclocking. When overclocked to 3.2GHz, performance improvements of around 32% have been observed.
Raspberry Pi engineers had previously recognized that memory issues could limit performance. For example, the 8GB memory version of Raspberry Pi runs slower than the 4GB version due to SDRAM self-refresh consuming part of the theoretical bandwidth, and JEDEC timings require more time to refresh larger capacity SDRAMs.
To address this, Raspberry Pi reached out to Micron, who confirmed that they had indeed been using the refresh timings for 4GB memory to test their 8GB SDRAMs. Thus, applying the 4GB memory refresh timings to 8GB memory was deemed safe.
To better manage SDRAM contention, Raspberry Pi engineers also divided the SDRAM into 8 NUMA zones, configuring the kernel to interleave allocation within these memory boundaries. This improvement has enhanced SDRAM performance during multicore tasks.
This optimization is still ongoing, but Raspberry Pi 5 users, in particular, can test it in non-production environments. Upon completion of testing, Raspberry Pi is expected to update this optimization as a default setting for users.
Below is the method to enable this experimental feature:
First, completely update the system:
sudo apt update && sudo apt full-upgrade
Then, edit the bootloader configuration:
sudo rpi-eeprom-config -e
For Raspberry Pi 5, add this line of code:
SDRAM_BANKLOW=1
For Raspberry Pi 4, add this line of code:
SDRAM_BANKLOW=3
After saving and rebooting, you'll find a line containing numa=fake=<n>
in /proc/cmdline
, indicating successful activation. Next, you can perform some tests to see if there's an improvement in performance.