TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Biscuit: A monolithic, POSIX-subset operating system kernel in Go

252 pointsby appwizover 4 years ago

13 comments

azakaiover 4 years ago
Oh nice, the results are pretty good!<p>&gt; On a set of kernel-intensive benchmarks (including NGINX and Redis) the fraction of kernel CPU time Biscuit spends on HLL features (primarily garbage collection and thread stack expansion checks) ranges up to 13%. The longest single GC-related pause suffered by NGINX was 115 microseconds; the longest observed sum of GC delays to a complete NGINX client request was 600 microseconds. In experiments comparing nearly identical system call, page fault, and context switch code paths written in Go and C, the Go version was 5% to 15% slower.<p>10% slowdown in return for memory safety could be a worthwhile tradeoff in some cases. And GC pauses were almost not an issue (less than 1ms in the worst measured).
评论 #24572693 未加载
评论 #24574727 未加载
评论 #24573694 未加载
评论 #24576990 未加载
评论 #24577003 未加载
评论 #24575378 未加载
评论 #24574543 未加载
评论 #24577253 未加载
pjmlpover 4 years ago
Not to steal the thread, but for the Go sceptics in system programming, F-Secure decided also to prove them wrong and is shipping bare metal Go for their security solutions.<p><a href="https:&#x2F;&#x2F;labs.f-secure.com&#x2F;blog&#x2F;tamago&#x2F;" rel="nofollow">https:&#x2F;&#x2F;labs.f-secure.com&#x2F;blog&#x2F;tamago&#x2F;</a><p><a href="https:&#x2F;&#x2F;www.f-secure.com&#x2F;en&#x2F;consulting&#x2F;foundry" rel="nofollow">https:&#x2F;&#x2F;www.f-secure.com&#x2F;en&#x2F;consulting&#x2F;foundry</a>
pcwaltonover 4 years ago
Note that this isn&#x27;t unmodified Go; it&#x27;s Go with some features for memory management, in particular having to annotate loops with the number of trips (see section 6.3).
评论 #24575497 未加载
评论 #24573546 未加载
habermanover 4 years ago
Note that in addition to the CPU overheads, the paper notes that Go&#x27;s heap requires a factor of 2 to 3 of headroom to run efficiently:<p><pre><code> &gt; A potential problem with garbage collection is that it &gt; consumes a fraction of CPU time proportional to the &gt; “headroom ratio” between the amount of live data and &gt; the amount of RAM allocated to the heap. This section &gt; explores the effect of headroom on collection cost. &gt; &gt; [...] &gt; &gt; In summary, while the benchmarks in §8.4 &#x2F; Figure 7 &gt; incur modest collection costs, a kernel heap with millions of live &gt; objects but limited heap RAM might spend &gt; a significant fraction of its time collecting. We expect &gt; that decisions about how much RAM to buy for busy &gt; machines would include a small multiple (2 or 3) of the &gt; expected peak kernel heap live data size. &gt; &gt; [...] &gt; &gt; If CPU performance is paramount, &gt; then C is the right answer, since it is faster (§8.4, §8.5). &gt; If efficient memory use is vital, then C is also the right &gt; answer: Go’s garbage collector needs a factor of 2 to 3 of &gt; heap headroom to run efficiently (see §8.6).</code></pre>
评论 #24577263 未加载
评论 #24577256 未加载
tptacekover 4 years ago
See also, for something surprisingly and alarmingly close to this, gvisor:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;gvisor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;gvisor</a>
评论 #24593184 未加载
评论 #24575752 未加载
评论 #24576743 未加载
qlk1123over 4 years ago
But the development seems stopped. The latest commit was on Jun 8, 2019.<p>At the time this project showed up, I gave it a try on QEMU. It was cool and I was like &quot;I must join this!&quot; As the result, except for one minor fix, I was not able to contribute more because the development environment was not comfortable. The patched go tree was not easy to follow. It also looks impossible for others to just rebase to later go.<p>My take on this is that, although go provides many OS-like features, you still have to draw a clear line between the OS and the language it uses if you want it to be maintainable and evolvable. I am still obsessed to the idea of making an OS in go and somehow trying doing one in a very slow pace.
评论 #24574847 未加载
评论 #24574456 未加载
robotover 4 years ago
This is interesting in that if you can use channels as described by the CSP book[1] you could build a kernel that is guaranteed to be free of concurrency bugs.<p>This would be important because even if you have proven the functional correctness of a kernel, that typically excludes the concurrency aspect.<p>[1] (<a href="https:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;~crary&#x2F;819-f09&#x2F;Hoare78.pdf" rel="nofollow">https:&#x2F;&#x2F;www.cs.cmu.edu&#x2F;~crary&#x2F;819-f09&#x2F;Hoare78.pdf</a>)
评论 #24573626 未加载
评论 #24574420 未加载
Ericson2314over 4 years ago
Reminds me of when I was excited about <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20120104065532&#x2F;http:&#x2F;&#x2F;web.cecs.pdx.edu&#x2F;~kennyg&#x2F;house&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20120104065532&#x2F;http:&#x2F;&#x2F;web.cecs.p...</a> for a high level language kernel.
Ericson2314over 4 years ago
The best thing to use Rust for is writing garbage collectors :D
评论 #24574946 未加载
hendryover 4 years ago
Why don&#x27;t they distribute an ISO to boot from Virtualbox?
02020202over 4 years ago
they say its go but the soruce code is full of C...
评论 #24572945 未加载
als0over 4 years ago
[deleted]
评论 #24573570 未加载
_alex_over 4 years ago
[rust intensifies]