News for hackers. Stuff that matters.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by yjftsjthsd-h on Tuesday April 14, 2020 @06:06PM (#22872076)
When I was younger, I was very pleased when I stumbled across the trick of putting all of a DOS system on a RAM-disk, which made the system fly. Then I got to college and discovered in my CS classes that CPUs now had multi-megabyte on-CPU cache, which immediately led me to wonder how hard it would be to make a DOS system that ran completely out of cache. I'm not convinced that it would be practical for any number of reasons, but it still blows me away every time I look at what modern CPUs have in-package:)
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by abbeyj on Tuesday April 14, 2020 @07:21PM (#22872650)
Coreboot does something similar to this. Very early in the boot process the RAM has not yet been initialized and so cannot be used. You need to execute some code to set up the RAM before you can use it. One approach to handling this is to write that initialization code in assembly language and make sure it only uses registers and doesn't touch any memory.

But that's inconvenient. You'd much rather be able to write your code in something like C. Any C code compiled by an ordinary compiler is going to access memory (at least for the stack). Writing and maintaining a custom C compiler for this is a lot of work and still comes with a lot of limitations on the C code that it will accept.

So they set up the cache in a way that it will never try to write its contents out to RAM. Then you can use the output of an ordinary C compiler that uses memory accesses and those accesses will all be served by the cache and never touch RAM. They call this "Cache as RAM".

With some work you could probably boot into DOS like this.

https://www.coreboot.org/data/yhlu/cache_as_ram_lb_09142006....

Re:AMD Claims World’s Fastest Per-Core Performance with New ... by als0 on Tuesday April 14, 2020 @07:31PM (#22872725)
Not just coreboot, pretty much any BIOS uses cache-as-RAM.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by ahmedalsudani on Tuesday April 14, 2020 @10:05PM (#22873710)
Wow that is so cool. Most of us never have to dig that deep and so weird stuff like that usually flies completely under the radar...

Thank you for sharing!

Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jnwatson on Wednesday April 15, 2020 @03:04AM (#22875301)
This is a common approach for most bootloaders, in fact for several microprocessors (the IBM 440 comes to mind), it is the only way to boot.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by myself248 on Wednesday April 15, 2020 @09:52AM (#22877684)
Is there a way to mess with the cache or MMU and prevent it from _trying_ to write out to DRAM, and be able run a minimal system purely from cache with the DRAM slots completely empty?
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by mcot2 on Wednesday April 15, 2020 @02:57AM (#22875268)
Interesting that no one to my knowledge has built an architecture where sram is ‘memory’ such that it would be transparent to C code but no slower dram is used. 32MB is more than my 1998 computer had.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jnwatson on Wednesday April 15, 2020 @03:03AM (#22875289)
Many embedded systems have a block of SRAM directly addressable.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by rijoja on Wednesday April 15, 2020 @03:02AM (#22875285)
modify tcc maybe
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by keanebean86 on Tuesday April 14, 2020 @06:28PM (#22872262)
Run windows 95 in L3 cache and use this to store the install: https://github.com/prsyahmi/GpuRamDrive
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jschwartzi on Tuesday April 14, 2020 @06:47PM (#22872415)
This is effectively what you do with some of the smaller MCUs -- you're running out of a megabyte or two of on-die static RAM. This is more to eliminate latency in RTOSes than it is to improve throughput but it's the same idea.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by gpderetta on Tuesday April 14, 2020 @08:32PM (#22873119)
More than eliminating latency I guess is done to eliminate latency variance, which is inherent in the relatively unpredictable behaviour of caches, and is required to characterize worst case scheduling of realtime systems.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by yetihehe on Wednesday April 15, 2020 @04:24AM (#22875643)
Megabyte of RAM? That's a very big MCU for most of embedded programmers. 20KB is plenty for most, and some even go to zero RAM (ATtiny11).
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by vardump on Wednesday April 15, 2020 @06:48AM (#22876305)
Working with embedded systems. Different MCUs' memory ranges from bytes to gigabytes. What's plenty for one project isn't for another.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by jschwartzi on Wednesday April 15, 2020 @06:14PM (#22883721)
Yeah I've worked on projects with Toshiba MCUs with 10's of kB of RAM, and the last truly embedded project I was on used a safety-critical MCU from TI with about a megabyte of internal ECC RAM.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by baybal2 on Tuesday April 14, 2020 @08:42PM (#22873181)
> I'm not convinced that it would be practical for any number of reasons, but it still blows me away every time I look at what modern CPUs have in-package:)

The optimism is premature. A CPU may flush cache even when it pages exactly the same page. Modern CPUs have too much of completely unfathomable prefetch, and cache coherence logic

Re:AMD Claims World’s Fastest Per-Core Performance with New ... by londons_explore on Wednesday April 15, 2020 @04:52AM (#22875751)
But they're also configurable via various config registers, and can be set to not touch RAM, as most early-boot firmware uses.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by baybal2 on Wednesday April 15, 2020 @12:42PM (#22879872)
No, all tricks to control cache behaviour are not 100% reliable on modern CPUs, or at least intel ones
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by sdenton4 on Wednesday April 15, 2020 @03:50AM (#22875515)
Ha. I still use ram disk for local training of machine learning models. You can get a SOLID throughput boost by just loading up the dataset in RAM... My work desktop has something like 192Gb, so can handle a pretty sizeable dataset this way.
Re:AMD Claims World’s Fastest Per-Core Performance with New ... by thesmileyone on Wednesday April 15, 2020 @06:57AM (#22876349)
Isn't this what 5-eyes have been doing with MiniX3? etc