News for hackers. Stuff that matters.
Re:Testing AMD's Bergamo: Zen 4c by crote on Saturday June 22, 2024 @10:53PM (#40764365)
I wonder if these large cache sizes make it possible to operate functionally RAM-less servers? When optimized for size, it'd probably be possible to fit some microservices in an MB of 8 of RAM. You can fit a decent bit of per-connection client state in a few KB, which can take up the rest of the cache. Throw in the X3D cache for 96MB per CCD and you can actually do some pretty serious stuff.

With the right preprocessing, it should be possible to essentially stream from NIC straight to CPU, process some stuff, and output it straight to the NIC again without ever touching RAM - although I doubt current DMA hardware allows this. It'd require quite a bit of re-engineering of the on-wire protocol to remove the need for any nontrivially-sized buffers, but I reckon it isn't impossible.

Re:Testing AMD's Bergamo: Zen 4c by yusyusyus on Saturday June 22, 2024 @11:05PM (#40764426)
> With the right preprocessing, it should be possible to essentially stream from NIC straight to CPU, process some stuff, and output it straight to the NIC again without ever touching RAM

this already exists [0]

[0] https://www.intel.com/content/dam/www/public/us/en/documents...

Re:Testing AMD's Bergamo: Zen 4c by crote on Sunday June 23, 2024 @06:58PM (#40771342)
I wasn't aware of that, thanks for sharing!
Re:Testing AMD's Bergamo: Zen 4c by timschmidt on Sunday June 23, 2024 @12:23AM (#40764773)
Lots of older or low end wireless routers have only 16 or 32mb RAM. A full linux stack fits in that. I do a full HTTPS stack on ESP32-C3 in ~500k. Lots of limitations, of course. Probably the biggest difficulty is that most modern systems simply refuse to boot without RAM installed, so you can't choose any platform without BIOS / EFI modifications. Definitely a worthwhile idea though.
Re:Testing AMD's Bergamo: Zen 4c by crote on Sunday June 23, 2024 @07:04PM (#40771374)
The difference is that those low end routers offload most or even all of the packet processing to dedicated networking hardware: it never even touches the CPU. The whole Linux stack is only used to host the management interface, configure the switching hardware, and deal with high-level stuff like DNS and DHCP. That's also why VPN performance is so horribly bad: there's no hardware acceleration for encryption, so it needs to be done on the CPU, which is not sized to deal with that kinds of traffic.
Re:Testing AMD's Bergamo: Zen 4c by timschmidt on Sunday June 23, 2024 @07:22PM (#40771461)
Offloading the packet processing doesn't really save any RAM at all. The limitations you're discussing are related to running on a low power ~700mhz MIPS or ARM core with very low performance. As you said, using a VPN or adding additional routing rules requires the packets to pass through the CPU, which demonstrates that all the software and buffers for doing the routing on the CPU are present within the 16 or 32Mb ram. It's just attached to a very low performance CPU core.

It's perfectly possible to load the same OpenWRT release on a modern x86 and run in the same amount of ram with much higher performance. That's how I do my routing on a 1gbit/s synchronous fiber connection and I can do line-speed wireguard just fine.

Distributions like OpenWRT require so little RAM because they select very conservative options when compiling everything, are very selective about what they include, build against minimal C libraries like musl libc, make use of highly integrated system utilities like busybox, and strip things like debugging symbols from the resulting binaries.

Re:Testing AMD's Bergamo: Zen 4c by wmf on Sunday June 23, 2024 @12:24AM (#40764776)
Intel definitely has cache injection for DMA; I'm not sure about AMD. With DPDK you should be able to process packets completely in the L3.
Re:Testing AMD's Bergamo: Zen 4c by foota on Sunday June 23, 2024 @12:33AM (#40764819)
This is theoretically true, but I think you'd have to get a lot of support from AMD and be responsible for implementing most of a traditional computer yourself. I have a feeling it's be roughly as feasible to do it all with fully custom hardware.

Otoh if you just mean try to write software to minimize the need to hit memory, that's totally reasonable -- and what you have to do if you want the best performance.

Re:Testing AMD's Bergamo: Zen 4c by tremon on Sunday June 23, 2024 @07:52AM (#40766742)
But in that case, wouldn't it be more efficient to put a processing core on/near the NIC, and do simple responses without even bothering the main CPU? I mean, if your "process some stuff" doesn't need data from RAM, it doesn't need to involve the main CPU either.
Re:Testing AMD's Bergamo: Zen 4c by crote on Sunday June 23, 2024 @07:11PM (#40771409)
Pretty much, yeah! But the only NICs with compute that I'm aware of use quite expensive FPGAs. Being able to use off-the-shelf hardware would be far cheaper, far easier to develop for, and far more flexible.