Fedora 31 has decided to allow (and have) giant process IDs (PIDs)
utcc.utoronto.ca
utcc.utoronto.ca
I don't know if I'm a systemd fan (yeah, I'm not), but there's nothing wrong with having more than 32K PIDs. At all. If your software breaks, it's stupid and broken and needs to be fixed.
Distributions using systemd may still change the default if they wish.
Note that this is exactly the reason why anything Lennart does is met with vitriol. He can’t keep his hands out of the cookie jar and when challenged, he and his supporters bring on the excuses. It is not for Lennart or his supporters to decide what’s better for me. That’s for the distributors to decide. Systemd does not get to decide preferences and neither does it get to set defaults.
Why did Fedora leave it the way upstream did? Because it's probably a good default. Every UNIX I know of has had this 20 years ago.
> cookie jar
The INIT daemon is pretty tightly involved in PIDs. So, not really hand in the cookie jar, in this case.
Audio subsystem, imho, not part of init's job. Bugs? Bloat? not good. If you want to criticize systemd, this is NOT the thing to complain over.
And because there are worse things it’s not a problem?
Systemd does not get to set the defaults to Lennarts preferences. And if it tries to, it deserves all the vitriol that results.
It was clearly Fedora that chose this setting for their distro, not Lennart (of course he's always personally is solely responsible, right?). Fedora just decided that as of 31 it was fine to use systemd and also have big PIDs.
It's also not a problem because behavior related to PID management is a major part of the job for the init daemon. Like it or not, init is central to the bring-up and management of userspace and processes, so after the kernel or maybe glibc, it's one of the few other packages that should reasonably own this setting. So it's not like systemd in this case is overextending into questionably relevant areas.
But vitriol for an upstream changing it's way of doing things? vitriol for an upstream even having a preference? vitriol for any reason at all about a triviality like this? For what's pretty clearly a better preference at that?
This tells me that there is baseless irrationality and unwarranted emotions going on to a level that I find absolutely shocking.
Bottom line: If someone makes something and gives it to you for free, you are way out of line to criticize them for making it they way they wanted to. You are looking at a Fedora Gift Horse that contains a systemd Gift Horse in the mouth. And then complaining that, while arguably better, it's wrong in principle for them to have given it to you they way they did.
If you don't like the thing that Lennart and his folks made and gave to you for free with no strings attached, stop using it! Go make something better. Fix it! Fork it! Stage a systemd maintainer hostile coup and lead them to push out only your desired preferences if you want.
You don't like that Fedora used systemd and allowed them to set this setting, and then gave it to you for free. Same answer.
Don't spew anger about things you got for free that no one made you take.
Is there a technical reason you would oppose this?
* tools like top format the columns so a very long pid doesn’t fit * like with IPv6 addresses very long pids are hard to remember, type and pronounce.
Software that can’t handle 64 bit process ids is broken and should be fixed.
There are benefits to sequential allocation - for one thing, the PID doesn't need to be stored anywhere (which can matter on very low memory machines), and optimizations can be made when there are only a handful of PID's.
That isn't a guarantee, technically though, is it? And if you consider it guaranteed, then why wouldn't a (P)RNG be just as trustworthy? Is there a mathematical argument why it's better?
Block cipher modes like CTR, CBC, etc, are built by combining this basic, reversible building block--a permutation--with additional state. The modes provide additional features, but they necessarily require additional state so that transformations are reversible. Stream ciphers, like RC4, have implicit state, such that to decrypt you have to iterate the function from the beginning state. Modern stream ciphers are built more like CTR-mode block ciphers.
You can build reversible transformations from non-reversible functions, such as a one-way hash function, using methods like the Feistel construction (https://en.wikipedia.org/wiki/Feistel_cipher), which was the traditional method for building block ciphers.
For my DNS library I used a simple, 16-bit Feistel "cipher" to generate non-repeating QIDs.[1] Most DNS libraries shuffle a 65536-element array (e.g. using a Knuth shuffle), or keep a 65536-bit set to filter values generated by a PRNG. I preferred the cipher approach because the only state necessary was a single integer "key" for each DNS query context, which may need to send a small number of packets to resolve a record. Plus I got to try out a new technique.
[1] Non-repeating until you've cycled through all 2^16 values. But even a cryptographically secure permutation becomes increasingly easier to guess the more values you can observe. And of course if you can observe the whole series then you can always guess with 100% accuracy successive values--it just cycles again. For my DNS library I got to generate a new key for every context, which resulted in a new permutation. But for system PIDs it's self-defeating to use a new key to produce a new permutation; the whole point was to avoid having to deal with potential collisions. That's why operating systems like OpenBSD don't bother with this technique for generating random PIDs or ephemeral port numbers.
I doN't think those matter that much anymore, if the machine has low memory it won't run a lot of processes and those optimizations won't matter much and if it runs a lot of processes it's likely to have more memory.
Unfortunately I don't know anything specific, I haven't followed CRIU. I noticed they did a number of releases during the last years, since I needed to compile CRIU for work. I would take a look at their website [1], it seems to list recent events and they have a mailing list.
There is procfd's nowadays that let you have a consistent handle on a specific process, but it doesn't solve the problem for anything that looks at PIDs.
It also naturally limits you to hosting only 32K processes; my browser at work consumes almost 1000 PIDs mainly via a lot of threads running at the same time. At home where I have even more tabs open, it's likely that it is getting close to 5000 threads running. Of those 32K processes, only 27k remain, which is a significant chunk.
I believe PID is a bit of a dated way to refer to processes and ultimately we should move to opaque process handles (like procfd).
One could make a collection of bugs that are revealed by (quite normal) process ID re-use. One of particular note in this context is the bug that occurs when one is using Linux control groups in lieu of proper job objects (which Linux does not have) and trying to do what on an actual first-class job object would be a "terminate all processes in this job" system call.
* http://jdebp.uk./FGA/linux-control-groups-are-not-jobs.html
What this made me realize, is that because I do this so little overtly, I hadn't even considered it a high risk. I do have pids in files: /var/run/nginx.pid style. They aren't fixed width fields.
Top and the like may mis-display on a wide pid I guess, unless its set to use some truncating field but then you get a problem of mis-attributing the PID value to the truncated value, cut/paste.. BOOM
"1500 bytes of payload"