I talk about the cancelability state and how it can help us shortly after that statement: https://mazzo.li/posts/stopping-linux-threads.html#controlle... . In hindsight I should have made a forward reference to that section when talking about C++. My broad point was that combining C++ exceptions and thread cancellation is fraught with danger and imo best avoided.
HN user
rostayob
f@mazzo.li -- https://mazzo.li -- https://twitter.com/trascendentale
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.
This option is described in detail in the blog posts, with its associated problems, see this section: https://mazzo.li/posts/stopping-linux-threads.html#homegrown... .
This is noted in the blog post, but the problem is that sometimes you don't have the freedom to do so. See this sidenote and the section next to it: https://mazzo.li/posts/stopping-linux-threads.html#fn3 .
(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.
There was no battle actually, everybody (well, my boss and my boss's boss) was very supportive of open sourcing. And thanks for the kind words!
We do use Reed-Solomon codes, as the blog post explains.
No, we have our custom compressor as well but it's outside the filesystem.
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.
Note that I was fairly careless with it, and I'm pretty clumsy. It probably fell 20+ times. But still, it feels very cheap (and I suppose it makes sense given the price).
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.
gpderetta is right -- test/cmp + jump will get fused.
uiCA is a very nice tool which tries to simulate how instructions will get scheduled, e.g. this is the trace it produces for sum3 on Haswell, showing the fusion: https://uica.uops.info/tmp/75182318511042c98d4d74bc026db179_... .
This post is an excuse to explain VM concepts, rather than a tutorial, something I maybe could have made clearer.
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)?
It's not written in perl, it's written in C, and it uses splice() (one of the syscalls discussed in the post).
I've been using this script for years, and it works great: https://mazzo.li/posts/autoscreen.html
It's very much like eternal terminal, but requires no upfront setup apart from having screen installed on the server.
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!
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.
(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.
Thanks, that's good to know!
Yes, see last few paragraphs of the post, in which I also speculate why GCC doesn't infer that there is only one compilation unit.