Tech Explained: Compressed RAM

Last week, I happened to go through a slide deck by Gregory Price of Meta about CRAM, presented at the Linux Plumbers Conference. It’s good stuff. With RAM prices rising, I think the idea is worth understanding.

From fundamentals first. Linux already uses kernel modules zram & zswap that compress less-used blocks of memory called pages. A 4 KiB page might shrink to 1 KiB. That’s 3 KiB saved, letting you store more in the same RAM. But when an application needs it again, it triggers a page fault. Linux pauses the app, decompresses the page and restores access. Repeating this costs time.

How does CRAM work?

Now CRAM asks a simple question. What if the CPU could read that page without Linux first unpacking it? The idea is to put compression and decompression inside the memory hardware. Data stays compressed in RAM, but when the CPU requests it, the hardware returns the original bytes automatically. Applications still use normal memory addresses. Linux doesn’t need to swap the page back in just for a read. This could be especially useful for data you read often but rarely change.

Writes are harder. Our 1 KiB compressed page might expand to nearly 4 KiB if you replace its contents with data that won’t compress. CRAM handles this by keeping compressed pages read-only. A write triggers a move back to ordinary RAM before the change is made. So the benefit depends on the workload. His work reported a 452x throughput gain over zram. But the test used DRAM-backed memory to isolate page-fault overhead. It doesn’t prove 452x faster applications on real compressed hardware.

I think the question is whether this can scale. With RAM prices rising, saving physical memory could matter for servers. But it’s no magic bullet. CRAM needs compression-capable hardware, making widespread use a next-generation change rather than a software update. The approach isn’t limited to Linux either. Will hardware makers and OS developers, including Microsoft, see value in adopting it? I really hope they do.

If you liked the post, Share it with your friends!

Leave a Comment

Your email address will not be published. Required fields are marked *

Back to Basics: Passive Entry Key Fobs

These days key fobs that unlock a car while still in your pocket are fairly common. The car is doing more than checking whether a valid key is nearby. It needs to work out whether that key is outside, near a particular door, or already inside the cabin. Let’s focus on that bit of tech today.

Usual car passive-entry system uses two wireless links. The car has several low-frequency antennas (~125 kHz) placed around the cabin and different parts of exteriors. When you touch a door handle or another wake-up condition is triggered, it energises one or more antennas and sends a wake-up message and cryptographic challenge.

How Key Fobs and Passive Entry works?

Now, inside the fob is a low-frequency receiver, often using three orthogonal coils so it can receive the magnetic field regardless of how the key is sitting in your pocket. The fob measures the field strength, processes the challenge, and sends an authenticated response back over a longer-range UHF or sub-GHz radio.

So the question now is why several antennas? One measurement gives only limited position information. Comparing field-strength readings from different locations lets the car classify useful zones such as driver-door side, passenger side, boot area or inside the cabin. It usually does not need an exact x-y coordinate but needs enough confidence to decide what action is safe.

That is what separates passive entry from the older remote-keyless-entry fob. With the older system, you press a button and the fob transmits an authenticated command. Passive entry adds a car-to-fob wake-up path and proximity information, so the key can stay in your pocket.

Newer systems can replace this approach with Bluetooth Low Energy and UWB. BLE handles low-power communication, while UWB can measure distance much more precisely using signal timing. The underlying question remains the same: is this an authorised key? and is it physically where the car expects it to be? You just use better tech to answer that these days. That’s it.

If you liked the post, Share it with your friends!

Leave a Comment

Your email address will not be published. Required fields are marked *

1 2 3 … 146