Hacker Newsnew | past | comments | ask | show | jobs | submit | Asmod4n's commentslogin

sysadmins CI is hoping the machine still boots after an update. Unless you are lucky you got two identical machines to have a test env.

Also the case of 'learning that someone did updates directly on AWS console instead of terraform and losing 0.5 or more days cleaning up the resulting mess'

Loads of hosting sites do this, username.domain.tld is the most common one.

I guess it's a good thing my bank doesn't have a free web hosting service

Win32 is the most stable abi on the Linux desktop.

Correct, most of Linux user land targets API stability, not ABI stability. Windows targets ABI stability because applications are typically distributed as binary blobs. Most applications on Linux are open-source and built per each distro, so it’s a non-issue, just recompile.

This doesn’t work for proprietary software that’s distributed as blobs and rarely updated, like say, video games. But that’s a minority of stuff on Linux. But not on windows.

Realistically, on Linux applications target specific API versions of frameworks. Like Qt 6, or GTK 3, or whatever. Then everything is compiled or dynamically linked at a per-distro level. The ABI compat can bite specifically when distros enforce strict dynamic linking. But then containerization technologies come in.

And there is a difference between API and ABI stability. For example, adding SSO to std::string in C++ broke ABI, not API. If you recompile it’s fine, everything works. If you don’t then it doesn’t.


Sadly glibc made the choice for everyone that you have to recompile constantly to keep your app working.

That’s one of the biggest issues keeping Linux small on the desktop since nearly no commercial oriented company works that way.

But it looks like we will soon be able to „virtualize“ the dynamic loader so glibc has no say in this matter anymore.


Dead wrong. Win32 (externally) only seems stable, but internally it changes between Windows releases. Win7 syscalls are completely different from Win11 syscalls, meaning if I want to release a binary _without relying_ on Win32 I need to provide full syscall mappings _for each and every Windows version_. This doesn't happen on Linux.

> only seems stable, but internally it changes

That's literally the definition of it being stable. Programs written against an interface keep working despite the implementation changing. The Linux kernel also constantly changes internally but programs written against syscalls keep working, so it is stable; that fact doesn't stop being a fact just because I dislike perf_event_open(2) or whatever. This is all very basic and easy to understand.


>> Win32 is the most stable abi on the Linux desktop.

> Dead wrong [...] if I want to release a binary _without relying_ on Win32

Then you are not using the Win32 ABI, are you?


Those are not a part of the API contract in case with NT kernel, though, unlike Linux.

Also, there are OS-provided shims in ntdll.dll (which, by the way, isn't a part of Win32 platform API, but a part of the NT kernel interface).


There is sadly no hdmi CEC support on Most GPUs for pcs. So when you want your tv to turn on and off with your pc it is only possible with the tv being reachable from your pc via ip.

I believe LG doesn’t advertise such an api via Bluetooth


You can get USB controlled CEC injectors for HDMI.

https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter


For a 4K120Hz TV I'd be worried about this adding signal integrity issues - "all versions of HDMI®, including HDMI® 2.0a" doesn't inspire confidence.


My understanding is that CEC can be received on any alive interface, not just the active.


Yes but you will lose 120 FPS/VRR. So for high end TVs not really ideal.


HDMI breakout and a esp32 module flashed with esphome is another option. The tv most likely doesn’t care that the port that sent on/off command is not the same port the video signal is coming from..


The tv does care which port it came from, since it automatically switches to the one which made the request.

One could build a IR emitter but you need soldering skills for that or buy a usb one which cost north of 30€ + shipping.


For responsiveness that’s what you want, context switches add quite a lot of jitter and perceived slowness’s, making your app feel slow despite running at 120 fps.


I found out that using mmap and just telling uring to read form there to beat anything else.


Depends a lot on the memory pressure. If you can be fairly certain the data is (or will be) resident in memory, mmap is basically unbeatable. If you can't (because the data is larger than RAM or there's other stuff competing for RAM), mmap can have gnarly system-wide performance implications[1].

[1] Mandatory mmap=poop-emoji link: https://db.cs.cmu.edu/mmap-cidr2022/


In my case: its a PROT_READ, MAP_PRIVAT map and i cannot get a SIGBUS since i tell the kernel to handle it all for me, thanks to liburing, instead i get a short send in that case.


Why would you use uring to read from an mmap? Couldn't you just memcpy?


To be more precise: i use that map to send assets out directly to clients from a zip file.

Its a new web server i am building and its the fastest way i could find out.

Just switching from epoll to liburing made the server ~45% faster too, its ridiculous. It can serve 10 gigabyte per second with a single thread, or around 10 million responses per second with h2 and 32 multiplexed requests.

I had to write a new http load generator for that since i couldn't find one which could generate enough load to saturate my server or be fast enough to withstand it.


10 gb per second is pretty slow for a disk. You should be seeing much higher than that.


??? The only configuration that will allow disk reads at 10 GB/s is if you're using PCIe 5.0. PCIe 4.0 or lower, and SATA will not drop out long before that.

He's very clearly hauling data straight from the page cache.


...I'm still confused why you wouldn't use memcpy?


How can one memcpy from a fd to a socket? I don’t touch the bytes in userspace, I just tell the kernel to send them out.


So why would you mmap?


to not let the bytes i forward enter userspace, i serve from the page cache for the asset path, directly from a zip file.

i open the file, mmap it, close it and tell io_uring_prep_send which bytes from the mapping to send, this also saves me from a possible SIGBUS cause the access to the mmap happen inside the kernel, and when a SIGBUS would happen in userspace the kernel just reports a shorter send in cqe->res


Maybe they meant using IORING_OP_MADVISE with MADV_WILLNEED to bring ranges into memory?


The Linux-specific MADV_POPULATE_READ is much more reliable than MADV_WILLNEED if you want to implement read-ahead for a memory-mapped file.

In my opinion, the POSIX advices specified for madvise are useless or even dangerous.

On Linux, for precise control of memory-mapped files one should use only these 4 Linux-specific advices: MADV_COLD, MADV_PAGEOUT, MADV_POPULATE_READ & MADV_POPULATE_WRITE.

These should be used within io_uring, so that they will be executed asynchronously.

These have a well-documented meaning and using them carefully should be sufficient to reach optimum performance with mmap.


Though at that point you can just use FADV_WILLNEED.


I'm just steelmanning here ¯\_(ツ)_/¯


Databases vendors usually find that read outperforms mmap. Mmap being fast is a myth.


Tried every way to get contents of a file as fast to a client socket as possible.

mmap and io_uring_prep_send were faster than everything else, no matter the size as long as you keep the map around for the lifetime of the process.

for one off sends when a file is smaller than 256kb then io_uring_prep_read + prep_send are faster than everything else.


Databases don't send files to client sockets as fast as possible. They do computation and lots of random access.


Note that grandparent actually didn't say they used mmap to actually get the memory, just mapping it.


Firefox is still popular in Germany, at around 10%


I remember when it was the last bastion of Firefox users with a majority marketshare there when everyone else already switched to Chrome...


>I would think that the German state or EU should provide funding for his museum. If that's not the case, it's a shame.

There is another Museum of his, which is still funded.


It is still a shame that the city which called itself Zuse-City does not try harder to keep it. I know how hard their financing situation is first hand but the ZCOM as a place and education institute was more worth then they understood.


how do they handle that malloc aint async signal safe?


You don’t have to do any significant work within the signal handler itself. In fact, the signal handler can literally be empty. What matters is that as long as SA_RESTART is not set, after the signal handler runs, the interrupted syscall fails with errno set to EINTR. Then the code that did the syscall can check whether a cancellation occurred (and retry the syscall if not).

Disclaimer: I haven’t looked at Zig’s implementation; I’m only going off how the Unix APIs work.


You can have virtually unlimited amount of rules, its just a limit per list, the number of lists aint really limited.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: