News for hackers. Stuff that matters.
Re:Apple Silicon M1: Black Magic Fuckery by fomine3 on Tuesday November 24, 2020 @08:43PM (#25205100)
I can't understand why less RAM is enough specially in Apple Silicon rather than Intel. Is the argument proved?

RAM capacity is just RAM capacity. Possibly Swift-made apps uses less RAM compared to other apps, but microarchitecture shouldn't be matter.

Re:Apple Silicon M1: Black Magic Fuckery by audunw on Wednesday November 25, 2020 @04:27AM (#25207397)
> RAM capacity is just RAM capacity. Possibly Swift-made apps uses less RAM compared to other apps, but microarchitecture shouldn't be matter.

My guess it's mostly faster swapping.

Microarchitecture could help, perhaps by making context switches faster.

But it could also be custom peripheral/DMA logic for handling swapping between RAM and NVM.

I think it makes sense.. NVM should be fast enough that RAM only needs to act as more of a cache. But existing architectures have a lot of legacy of treating NVM like just a hard drive. Intel is also working on this with its Optane related architecture work.

You could also do on-the-fly compression of some kinds of data to/from RAM. But I havent heard any clues that M1 is doing that, and you'd need applications to give hints about what data is compressible.

Re:Apple Silicon M1: Black Magic Fuckery by sirn on Wednesday November 25, 2020 @07:07AM (#25208357)
I also believe this is the case.

Most experiment with 8GB M1 Macs I've seen so far (on YouTube) seems to start slowing down once the data cannot fit in a RAM, although the rest of the system remain responsive e.g. 8K RED RAW editing test. In the same test with 4K RED RAW there were some shuttering on the first playback but subsequent playback were smooth, which I guessed it was a result of swap being moved back into a RAM.

My guess would be they've done a lot of optimization on swap, making swapping less of an performance penalty (as ridiculous as it sounds, I guess they could even use Neural Engine to determine what should be put back into RAM at any given moment to maximize responsiveness.)

macOS has been doing memory compression since Mavericks using WKdm algorithm, but they also support Hybrid Mode[1] on ARM/ARM64 using both WKdm and a variant of LZ4 for quite some time (WKdm compress much faster than LZ4). I wouldn't be too surprised if M1 has some optimization for LZ4. So far I haven't seen anybody tested it.

It might be interesting to test M1 Macs with vm_compressor=2 (compression with no swap) or vm_compressor=8 (no compression, no swap)[2] and see how it runs. I'm not sure if there's a way to change bootargs on M1 Macs, though.

[1]: https://github.com/apple/darwin-xnu/blob/a449c6a3b8014d9406c...

[2]: https://github.com/apple/darwin-xnu/blob/a449c6a3b8014d9406c...

Re:Apple Silicon M1: Black Magic Fuckery by anentropic on Wednesday November 25, 2020 @09:17AM (#25209429)
Exactly, several reports since the launch have pointed out that both the memory bandwidth of the RAM is higher than before, and also the SSDs are faster than before (by 2-3x in both cases I think?)

combined it should make a big difference to swapping

Re:Apple Silicon M1: Black Magic Fuckery by socialdemocrat on Tuesday November 24, 2020 @09:32PM (#25205382)
I don't quite see that either. But I suspect that it is just macOS itself which uses less memory than Windows in general.

But the much faster SSD to RAM transfer for the M1 means that shuffling stuff in and out of RAM is much faster meaning RAM matters less.

Re:Apple Silicon M1: Black Magic Fuckery by lhl on Wednesday November 25, 2020 @12:31AM (#25206278)
On my almost-stock (primarily used for iOS deployment) MBP, Catalina uses 3GB RAM (active+wired) memory on boot. It's much more than my Linux laptop (~400MB). I haven't booted Win10 recently but I'd assume it'd be close to macOS.

The transfer speeds of the M1 SSDs have been benched at 2.7GB/s - about the same speed as mid-range NVMe SSDs (my ADATA SX8200 Pro and Sabrent Rocket are both faster and go for about $120/TB).

Re:Apple Silicon M1: Black Magic Fuckery by fomine3 on Tuesday November 24, 2020 @09:57PM (#25205540)
I think OS' usage isn't main matter for RAM. Browser, Electron apps, professional apps like Photoshop, IntelliJ, and VM should be.

I expected SSD is way fast, but benchmark says its SSD is about below 3000MB/s RW, not very fast but usual Gen3 x4 speed.

Re:Apple Silicon M1: Black Magic Fuckery by wsc981 on Tuesday November 24, 2020 @10:11PM (#25205623)
I’m guessing swapping happens quicker, perhaps due to the unified memory architecture. With quicker swapping you’d be less likely to notice a delay.

That said I’d still be very hesitant buying a 8 GB M1 Mac. When my iMac only had 8 GB it was a real pain to use. Increasing my iMac’s memory to 24 GB made it usable.

Re:Apple Silicon M1: Black Magic Fuckery by fomine3 on Tuesday November 24, 2020 @10:59PM (#25205915)
Bottleneck for swap in/out must be SSD, not memory. Also its SSD isn't fast compared to other NVMe SSDs in both throughput and IOPS. Possibly latency is great thanks to integrated SSD controller onto M1 but I don't think it changes the game.
Re:Apple Silicon M1: Black Magic Fuckery by amelius on Wednesday November 25, 2020 @05:40AM (#25207814)
Is a SSD suitable for swap, given its limited number of write cycles?
Re:Apple Silicon M1: Black Magic Fuckery by foldr on Wednesday November 25, 2020 @06:12AM (#25208025)
When I looked into this, the information I found suggested that modern consumer SSDs generally have more than enough write cycles to spare for any plausible use case. Possibly this was more of an issue five to ten years ago.