Core scheduling lands in Linux 5.14(lwn.net) |
Core scheduling lands in Linux 5.14(lwn.net) |
"spamming Internet users at scale requires a lot of parallel activity, after all. If those processes can be segregated so that all siblings of any given core run processes from the same customer, we can be spared the gruesome prospect of one spammer stealing another's target list — or somebody else's private keys."
Maybe I'm too used to stab myself and laugh at it.
For me "long-form writing" brings to mind textbooks, LWN, some bug report emails, some HN comments. These are a different category of writing. I don't think you should sit around to wait for someone else to summarize these for you -- that attitude must be terrible for you in the long run.
But... this does not apply to this post. It is not that long, not low density and does not have fillers or sugar.
Lol it's just a thousand words!
Assigning OS threads of the same process to the hyperthreads in the same core is a good thing anyway. The threads probably share many data in the process and can benefit from the shared cache in the core.
Nevertheless, the CPU affinity of any process or thread can be changed at any time with sched_setaffinity() so the httpd process itself could run its children on different cores, if it wanted so, but it is unlikely that any httpd program does this.
The new feature that is discussed in this thread will limit the cores on which the threads of a user can be scheduled to those having the same cookie, so a process will no longer be able to reschedule its children to run on the same core as the threads of another user.
There is no mention of performance though. How is it? Presumably it is better!! And if so, this sounds like a concept that the OpenBSD community would be interested in since they prefer SMT disabled for security reasons.
It would obviously impact whole-system performance, since this setting would intentionally limit what can run on each core leading to some idle cycles. That's expected though, and is merely a consequence of using this feature for security.
I'm curious if it measurably slows down the scheduler and impacts performance from there.
int prctl(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);
Is there a reason why a more idiomatic void * to struct wasn't used for the args?Here 'unsigned long' is just a convenient stand-in for "generic register-sized argument".
A "void * pointing to struct" requires a copy from user space. If a particular prctl() does need a struct, it can certainly stuff a pointer into one of those 'unsigned long' parameters (in the kernel environment, a pointer can be converted to and from an unsigned long without concern).
That wouldn't be register-sized on x86 would it?
Depending on option, the args can be pointers to structure.
It’s also worth noting that most older Linux system calls do not follow that pattern in general, so I don’t know that I would consider void* idiomatic for system calls until recently.
Is this accurate? I was under the impression SMT gains are not from running other threads when one is blocked (preemption is a old feature) but the processor having a multi stage pipeline so that the net number of instructions that are executed per cycle is more than 1 (closer to 2 in the above example)
What the article describes is temporal multithreading where only one thread executes at a time.
https://en.wikipedia.org/wiki/Multithreading_(computer_archi...
SMT is a second set of registers that uses the same execution hardware. If a thread stalls waiting for a main memory read then the other thread can jump in after the pipeline is cleared out (or maybe before if you're clever and careful, but idk if this is done in practice). You can also impose some governance over time sharing so threads with low data memory footprints don't lock out other threads.
I'm currently on Ubuntu HWE line, but that only goes to 5.11.0. Ubuntu kernel devs have debs for [mainline][1], but I'm not finding any good feedback/experience stories about these.
I'm dead haha. This is great.
I frequently use taskset, because otherwise Linux migrates continuously the process between cores, which can degrade the performance of the programs that do some computations with a long duration, unlike the programs that are mostly waiting for events to happen.
This new feature has a different purpose, it is intended for multiuser servers, to enable the secure partitioning of the runnable threads into groups that can be scheduled on different cores, so that they will not be able to interfere with each other, even when they would have intended that.
The phone app screenshots show three charge one discharge cycle at the same time. It's a 4 channel charger which can work even with a single battery.
Currently I use IKEA's battery chargers*, but if I gonna need something more advanced, gonna look at this one.
*: IKEA's battery chargers are no slouches either. They're very intelligent with battery fault detection and very good charging characteristics.
Therefore, Linux-only code (including the Linux kernel itself) commonly uses "long" or "unsigned long" to mean "register-sized" and "large enough to fit a pointer"; portable code normally uses "size_t" or "uintptr_t" for that.