HN user

rostayob

1,986 karma

f@mazzo.li -- https://mazzo.li -- https://twitter.com/trascendentale

Posts36
Comments38
View on HN
www.xtxmarkets.com 10mo ago

TernFS – An exabyte scale, multi-region distributed filesystem

rostayob
251pts109
mazzo.li 1y ago

Waiting on many things at once with io_uring

rostayob
3pts0
mazzo.li 2y ago

CRC-32C Tips and Tricks

rostayob
3pts0
github.com 2y ago

Fast CRC32 Implementations

rostayob
1pts0
jaspervdj.be 3y ago

Haskell Puzzles

rostayob
5pts0
aras-p.info 3y ago

Flame Chart Profiler for Clang compilation times

rostayob
1pts0
mazzo.li 3y ago

The essence of Reed-Solomon coding

rostayob
168pts41
mazzo.li 3y ago

Lánczos Interpolation Explained

rostayob
64pts0
github.com 3y ago

Apple AMX instruction set (M1/M2 matrix coprocessor)

rostayob
210pts188
www.corsix.org 3y ago

Faster CRC32-C on x86

rostayob
107pts21
www.youtube.com 4y ago

Haskell Keynotes ZuriHac 2022

rostayob
3pts0
github.com 4y ago

OpenGOAL: Jak and Daxter decompiled, 98% of it being Lisp

rostayob
21pts0
en.wikipedia.org 4y ago

Moon Museum

rostayob
3pts0
mazzo.li 4y ago

How fast are Linux pipes anyway?

rostayob
698pts200
xournalpp.github.io 4y ago

Xournalpp++ – closs-platform, open source note taking software

rostayob
199pts87
ppc.cs.aalto.fi 4y ago

Programming Parallel Computers

rostayob
15pts2
twitter.com 4y ago

Since 2021-09-15 Nixpkgs has merged ~17k PRs

rostayob
1pts1
www.quantamagazine.org 4y ago

How Goedel's Proof Works

rostayob
3pts0
www.youtube.com 4y ago

Building a quality USB-C microphone

rostayob
1pts1
www.patreon.com 4y ago

Epic Megagrant to Develop SDL Next-Gen Rendering API

rostayob
4pts0
www.youtube.com 4y ago

How to Build an Igloo

rostayob
1pts0
twitter.com 4y ago

Factorio in Lieu of Resumes

rostayob
3pts0
www.microsoft.com 4y ago

Mimalloc: Free List Sharding in Action [pdf]

rostayob
3pts0
mazzo.li 4y ago

Backing up WhatsApp data through the multi-device web client

rostayob
3pts0
mazzo.li 4y ago

Remote, encrypted ZFS storage server with NixOS

rostayob
5pts1
mazzo.li 4y ago

Speeding up atan2f

rostayob
245pts103
mazzo.li 5y ago

Beating the L1 cache with value speculation

rostayob
157pts53
mazzo.li 5y ago

When static makes your C code 10 times faster

rostayob
201pts108
mazzo.li 5y ago

Using GDPR to obtain one’s data as JSON

rostayob
182pts133
mazzo.li 5y ago

Quick and Dirty Backpropagation in Haskell

rostayob
3pts0

As I note in the blog post in various places if one can organize the code so that cancellation is explicit things are indeed easier. I also cite eventfd as one way of doing so. What I meant to convey is that there's no easy way to cancel arbitrary code safely.

Cancellation points and cancellability state are discussed in the post. In a C codebase that you fully control pthread cancellation _can_ be made to work, but if you control the whole codebase I'd argue you're better off just structuring your program so that you yield cooperatively frequently enough to ensure prompt termination.

(I'm the author)

I don't really claim that Lanczos interpolation as presented is the "best" 2D interpolation there is. It is definitely popular though, and I couldn't find a source explaining how it is derived, so I thought it'd be an interesting topic for a blog post.

The question is whether there are single Ceph deployments are that large. I believe Hetzner uses Ceph for its cloud offering, and that's probably very large, but I'd imagine that no single tenant is storing hundreds of PBs in it. So it's very easy to shard across many Ceph instances. In our use-case we have a single tenant which stores 100s of PBs (and soon EBs).

I'm not fully up to date since we looked into this a few years ago, at the time the CERN deployments of Ceph were cited as particularly large examples and they topped out at ~30PB.

Also note that when I say "single deployment" I mean that the full storage capacity is not subdivided in any way (i.e. there are no "zones" or "realms" or similar concepts). We wanted this to be the case after experiencing situations where we had significant overhead due to having to rebalance different storage buckets (albeit with a different piece of software, not Ceph).

If there are EB-scale Ceph deployments I'd love to hear more about them.

(Disclaimer: I'm one of the authors of TernFS and while we evaluated Ceph I am not intimately familiar with it)

Main factors:

* Ceph stores both metadata and file contents using the same object store (RADOS). TernFS uses a specialized database for metadata which takes advantage of various properties of our datasets (immutable files, few moves between directories, etc.).

* While Ceph is capable of storing PBs, we currently store ~600PBs on a single TernFS deployment. Last time we checked this would be an order of magnitude more than even very large Ceph deployments.

* More generally, we wanted a system that we knew we could easily adapt to our needs and more importantly quickly fix when something went wrong, and we estimated that building out something new rather than adapting Ceph (or some other open source solution) would be less costly overall.

I am, but I only type the messages I need to type. Which aren't that many. If there's some long explanation to be had I call or I leave a voice message. And yes, I am aware of the fact that everybody hates voice messages, but it's only fair if somebody requires my immediate attention :).

Typing is painful, but not disastrous actually. It's perfectly serviceable.

I've been using this phone as my full time phone for 1 year. It's a great compromise for people that ideally would not want a smartphone, but need to have one since many life situations require it.

I basically only use it for WhatsApp and music, but when some other need arises, it can do everything a normal smartphone can do.

The only problem is that the build quality is not good. The audio jack of the first one I bought (off the initial kickstarter) broke after 6 months or so. I bought another one, and the up volume button recently broke. But otherwise, no complaints.

It could be that when splicing to /dev/null (which I'm doing), the kernel knows that they their content is never witnessed, and therefore no copy is required. But I haven't verified that

Yes, this all makes sense, although like everything splicing-related, it is very subtle. Maybe I should have mentioned the subtleness and dangerousness of splicing at the beginning, rather than at the end.

I still think the man page of vmsplice is quite misleading! Specifically:

       SPLICE_F_GIFT
              The  user pages are a gift to the kernel.  The application may not modify
              this memory ever, otherwise the page cache and on-disk data  may  differ.
              Gifting   pages   to   the  kernel  means  that  a  subsequent  splice(2)
              SPLICE_F_MOVE can successfully move the pages; if this flag is not speci‐
              fied,  then  a  subsequent  splice(2)  SPLICE_F_MOVE must copy the pages.
              Data must also be properly page aligned, both in memory and length.
To me, this indicates that if we're _not_ using SPLICE_F_GIFT downstream splices will be automatically taken care of, safety-wise.

Actually, from re-reading the man page for vmsplice, it seems like it _should_ depend on SPLICE_F_GIFT (or in other words, it should be safe without it).

But from what I know about how vmsplice is implemented, gifting or not, it sounds like it should be unsafe anyhow.

(I am the author of the post)

I haven't digested this comment fully yet, but just to be clear, I am _not_ using SPLICE_F_GIFT (and I don't think the fizzbuzz program is either). However I think what you're saying makes sense in general, SPLICE_F_GIFT or not.

Are you sure this unsafety depends on SPLICE_F_GIFT?

Also, do you have a reference to the discussions regarding this (presumably on LKML)?

Speeding up atan2f 5 years ago

Thanks for the info.

By the way, your writing on floating point arithmetic is very informative -- I even cite a message of yours on FMA in the post itself!

Speeding up atan2f 5 years ago

Ah, regarding edge cases: the only edge cases I do not handle are infinities and the origin. In my case these are both uninteresting: we deal with points from panoramic images, so those both make no sense.

I did want to deal with 0s in either coordinates though, and to preserve NaNs.

You're right that atan2 has a lot of edge cases, which is why it made for an interesting subject. I thought it was neat that the edge cases I did care about fell out fairly naturally from the efficient bit-twiddling.

That said, the versions presented in the article post are _not_ conforming, as I remark repeatedly. The article is more about getting people curious about some topics that I think are neat, more than a guide on how to implement those standard functions correctly.

Speeding up atan2f 5 years ago

(I'm the author)

You're right, I should have specified -- it is glibc 2.32-48 . This the source specifying how glibc is built: https://github.com/NixOS/nixpkgs/blob/97c5d0cbe76901da0135b0... .

I've amended the article so that it says `glibc` rather than `libc`, and added a sidenote specifying the version.

I link to it statically as indicated in the gist, although I believe that shouldn't matter. Also see https://gist.github.com/bitonic/d0f5a0a44e37d4f0be03d34d47ac... .

Note that the hardware is not particularly recent (Q3 2017), but we tend to rent servers which are not exactly on the bleeding edge, so that was my platform.

The only option is when all TU are given at the same time to the compiler

Exactly -- which is the case here. But implementing such a cross cutting implementation would probably be annoying, which is what I wanted to convey with

I think they could concievably assume that the value of modulus won’t be changed in this case, since we’re producing an executable directly, but it’s probably annoying to have an optimization looking so far into the future of the compiler pipeline.

I am not advocating static. I'm advocating for looking at what the compiler outputs when surprising behavior is encountered. The example is extracted from a larger piece of code, and I reported the minimal case as-is.

If anything, the title is meant to be read as "isn't it amusing that something apparently unrelated such as `static` causes a performance improvement".

That said, I have added a note clarifying this at top of the post now.