Tag about-low-level

18 bookmarks have this tag.

Low-level stuff: CPUs, syscalls, embedded.

Speculation in JavaScriptCore

www.webkit.org/blog/10308/speculation-in-javascriptcore

This post is all about speculative compilation, or just speculation for short, in the context of the JavaScriptCore virtual machine.

about-compilers,about-low-level,is-blog,to-show

So you want custom allocator support in your C library

nullprogram.com/blog/2023/12/17

Some thoughts on custom allocator interfaces with nice examples.

about-low-level,is-blog,to-archive,to-show

Pinning all system calls in OpenBSD

marc.info/?l=openbsd-tech&m=170205367232026&w=2

How OpenBSD prohibited all syscalls from unknown locations.

about-low-level,about-security,is-blog,to-show

Designing a SIMD Algorithm from Scratch

mcyoung.xyz/2023/11/27/simd-base64/#fnref:pad-with-A

A nice post about SIMD algorithms using Rust’s portable SIMD as an example.

about-low-level,is-blog,to-read

Linus Torvalds about spinlocks and locking in general

www.realworldtech.com/forum/?threadid=189711&curpostid=189723
about-low-level,for-memequeue,is-blog,to-read

Efficient Userspace Optimistic Spinning Locks

lpc.events/event/4/contributions/286/attachments/225/398/LPC-2019-OptSpin-Locks.pdf

How to spin before sleeping so that it actually helps and not harms?

about-low-level,for-memequeue,is-paper,to-read

Mutexes Are Faster Than Spinlocks

matklad.github.io/2020/01/04/mutexes-are-faster-than-spinlocks.html

Microbenchmark for futexes + spinlocks and some useful links at the bottom.

about-low-level,about-rust,for-memequeue,is-blog,to-show

Spinlocks Considered Harmful

matklad.github.io/2020/01/02/spinlocks-considered-harmful.html

Because spin locks are so simple and fast, it seems to be a good idea to use them for short-lived critical sections. For example, if you only need to increment a couple of integers, should you really bother with complicated syscalls? In the worst case, the other thread will spin just for a couple of iterations…
Unfortunately, this logic is flawed! A thread can be preempted at any time, including during a short critical section. If it is preempted, that means that all other threads will need to spin until the original thread gets its share of CPU again. And, because a spinning thread looks like a good, busy thread to the OS, the other threads will spin until they exhaust their quants, preventing the unlucky thread from getting back on the processor!

about-low-level,about-rust,is-blog,to-show

Game: OVERFLOW

punkx.org/overflow

The [board] game is about creating a small shellcode in memory by copying existing instructions and then exploiting a buffer overflow to jump into it, so that you can overwrite your opponent’s return address to force them to go to the game_over() function.There are other mechanics as well and more layers of strategy (like setting the exception handler or monkeypatching).

about-low-level,is-game,to-try

Measuring Mutexes, Spinlocks and how Bad the Linux Scheduler Really is

probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is

This blog post is one of those things that just blew up. From a tiny observation at work about odd behaviors of spinlocks I spent months trying to find good benchmarks, (still not entirely successful) writing my own spinlocks, mutexes and condition variables and even contributing a patch to the Linux kernel. The main thing I’ll try to answer is to give some more informed guidance on the endless discussion of mutex vs spinlock. Besides that I found that most mutex implementations are really good, that most spinlock implementations are pretty bad, and that the Linux scheduler is OK but far from ideal. The most popular replacement, the MuQSS scheduler has other problems instead. (the Windows scheduler is pretty good though)

about-low-level,for-memequeue,is-blog

nand2tetris

www.nand2tetris.org

The site contains all the lectures, project materials and tools necessary for building a general-purpose computer system and a modern software hierarchy from the ground up.

about-low-level,about-programming,is-book,is-game,to-try

Bootstrapping with FORTH

compilercrim.es/bootstrap

What if all software suddenly disappeared? What's the minimum you'd need to bootstrap a practical system? I decided to start with a one sector (512-byte) seed and find out how far I can get.

about-compilers,about-low-level,is-blog,to-read

Futexes Are Tricky

dept-info.labri.fr/~denis/Enseignement/2008-IR/Articles/01-futex.pdf

Detailed explanation of futexes, including some possible pitfalls.

about-low-level,for-memequeue,is-paper,to-read

No Sane Compiler Would Optimize Atomics

www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4455.html

The paper’s claim:

False.

Compilers do optimize atomics, memory accesses around atomics, and utilize architecture-specific knowledge. This paper illustrates a few such optimizations, and discusses their implications.

Interestingly, none of the optimizations proposed in the paper actually work on GCC or Clang.

about-compilers,about-low-level,for-memequeue,is-blog,to-archive

The Magic Ring Buffer

fgiesen.wordpress.com/2012/07/21/the-magic-ring-buffer

A first (as far as I know) description of ringbuffer based on two mmaps. I hope to make a better one sometime, but for now this’ll the best explanation I have.

about-low-level,for-memequeue,is-blog,to-show

What every programmer should know about memory

lwn.net/Articles/250967
about-low-level,is-blog,to-read

Rust Atomics and Locks by Mara Bos

marabos.nl/atomics

A free book about atomics and locks that also serves as a nice cheatsheet for x86_64, aarch64 and futexes.

about-low-level,about-rust,for-memequeue,is-book,to-show

A close encounter with false sharing

morestina.net/blog/1976/a-close-encounter-with-false-sharing

An example of false sharing in real-ish workload.

about-low-level,about-rust,for-job,is-blog,to-show