7 ms·
Core scheduling lands in Linux 5.14
- earthscienceman 5y agoThis is such a great post, I'm surprised it doesn't have more traction but maybe people aren't into reading longform plain text. "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."
- jacquesm 5y agoTechnical writing with a sense of humor is great. Highly recommended: the user manual of the SkyRC MC3000 Li-Ion charger.
- HanaShiratori 5y agoHaha yeah the good old MC3000. I love this charger, it makes a simple task a little more exciting and sometimes (a bit) unnecessarily complicated - but at the least you've got full control about charging those damn batteries!
- wazoox 5y agoI still remember the fun I had 30 years ago reading the t.c. electronics 2290 digital delay user manual.
- Fnoord 5y agoLink to PDFs [1] (scroll down, EN and DE it seems). Seems like an amazing device, too. Too bad it could only charge one at a time, so I guess you'd buy multiple of these on a tech dept. [1] https://www.skyrc.com/MC3000_Charger https://www.skyrc.com/MC3000_Charger
- bayindirh 5y ago> Too bad it could only charge one at a time, so I guess you'd buy multiple of these on a tech dept. 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.
- jacquesm 5y agoHighly recommended, I have a whole slew of consumer and pro-sumer Li-Ion chargers and this one is by far the best, it's not the cheapest but it works very well.
- HanaShiratori 5y agoWhat do you mean with one at a time? I've been using one of these chargers for a couple for years now and can charge multiple batteries at the same time. Even different types are not a problem. (nimh / liion)
- Fnoord 5y agoWhat I mean is the very same type is going to work only once since you cannot convert it to twice the type you need. So in a work environment where you use these, you might end up with say two of these to load two of such rechargeable batteries at the same time. Whereas 'normal' chargers for things like AA and AAA have multiple spots for the same battery. Like the other comment, I also currently use IKEA's charger (my wife bought it), and it can charge a lot of batteries at the same time.
- HanaShiratori 5y agoI'm sorry I don't really get what you're saying. You can charge any (supported) battery type in any of those slots regardless of how many you want to charge at the same time. I can charge 4 eneloops simultaneously or 18650 or whatever...
- bayindirh 5y agoThat's a fine charger too. Good hardware, good features, humorous user manual. A splendid combination, indeed.
- sytelus 5y agoA majority of long form writing is extremely low information density and, even worse, just designed to retain attention as long as possible. I now dislike majority of news articles which starts with pseudo-literary description of anecdot and a main detail is revealed 3/4 of the way in sentence or two. It’s purely filler and like sugar it has a purpose. I want all long form writing to have sub title to tell the core of story in one line, followed by abstract, or let Twitter guy summarize it for me.
- tluyben2 5y agoYes, and I have the same issue with videos: 30 min videos with something that fits in 1 written sentence. Ugh. People are so afraid of reading (or are just very slow readers?); many even here won't read beyond the first line of this comment and if they comment, they comment only on that line often). But... this does not apply to this post. It is not that long, not low density and does not have fillers or sugar.
- azalemeth 5y agoI have exactly this issue with video, moaned about it here a few weeks ago -- and another HN reader explained, very pithily why the trend has occurred: money. It's much easier to monetise a YouTube video than it is an easy, or a blog post. Video impressions get more currency/eyeball even outside of YouTube. Our lack of ability to skim read or rapidly search for information doesn't enter the calculus.
- AshamedCaptain 5y agoThese days I'm supposed to watch a 30 min video in order to check if a Wikipedia source really contains the quoted statement.
- deleted 5y ago[deleted]
- BBC-vs-neolibs 5y ago
- mwcampbell 5y agoMaybe I'm just being too humorless, but I found the quoted passage a bit too dismissive of all the good things that are being done in cloud environments. Some of us are developing products that actually make people's lives better, and we're selling those products as SaaS, but we're not yet big enough to operate dedicated hardware with the same level of reliability and security that, say, AWS can achieve, so we run in a shared cloud environment. Anyway, the constant cynicism in online communities like this one, and reflected in that part of the OP, gets to me.
- secondaryacct 5y agoYes you're being too humourless :)
- bayindirh 5y agoWe also do useful things in cloud/HPC which touches people's lives, but a little joke here and there doesn't hurt IMHO. Maybe I'm too used to stab myself and laugh at it.
- wayoutthere 5y agoThe Linux kernel community has always had a bit of a suspicious attitude towards commercial use. This attitude long predates the cloud / SaaS and reflects Linux’s origins (and Linus Torvalds’ world view) inside Scandinavian academia.
- sosadmin007 5y agoI agree, especially since this huge change was a prime example of how open source is incredible ! This work was made possible because engineers working for competitors such as DigitalOcean, Google, Oracle and Microsoft worked together with the kernel community to find an acceptable software solution to a hardware problem that impacts a lot of people.
- Diederich 5y agoSuch dry humor is one of the best things about Jonathan Corbet's writing style.
- chrisseaton 5y ago> longform plain text Lol it's just a thousand words!
- tpxl 5y agoIs there not a way to pin processes to cores in linux already, and/or why it cannot be used to achieve a similar thing (pin user1 to cores 0,1 and user2 to cores 2,3)?
- dharmab 5y agoCore pinning exists but it requires the administator to manually assign processes to specific cores. Core scheduling lets you group trusted processes together and then the OS can figure out which cores can run which processes dynamically. Also, core scheduling does not permit userspace attackers to "game the system" and target a specific core they want to attack.
- tpxl 5y agoWell can't software do that automatically? I would love a piece of software that could reserve a couple of cores for games, another couple of cores for firefox, etc. dynamically based upon some settings.
- flatiron 5y agoSecurity problems probably. I could only imagine the new spectre vulns if you got to pick your own core.
- formerly_proven 5y agoSure, you could use cgroups for that.
- adrian_b 5y agoOn a computer that you control completely, in Linux you can use taskset to launch programs on whichever cores you want and to migrate already running programs to whichever cores you like and there is no obstacle that prevents you to use this in some scripts to automatically implement any policies you desire. 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.
- jeff_vader 5y agoRandom question: does anyone use recent mainline kernels with Ubuntu 20.04? How? How's the experience? 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. [1]: https://kernel.ubuntu.com/~kernel-ppa/mainline/ https://kernel.ubuntu.com/~kernel-ppa/mainline/
- kevin_thibedeau 5y agoint 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?
- caf 5y agoIt's a leaky abstraction over the underlying system call mechanism. Because the user stack lives in user space and accessing it from the kernel requires the same dance as any other access to user memory, system call arguments are instead passed in registers where they are immediately available to the kernel with no possibility of faults or TOCTTOU holes. 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).
- dataflow 5y ago> Here 'unsigned long' is just a convenient stand-in for "generic register-sized argument". That wouldn't be register-sized on x86 would it?
- oynqr 5y agoThe minimum size for unsigned long is 4 bytes
- dataflow 5y agoOh I didn't realize its size varies on x86 and x64... I thought it's always 64-bit under compilers that target Linux! Today I learned...
- jamesfinlayson 5y agoI think the size can vary by compiler rather than just by architecture.
- ww520 5y agoThat's very fast in adding the feature to kernel to address the loss of performance due to Sprectre. 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.
- po1nt 5y agoEverything is cool, except for the naming. At first I thought this was about implementation of Intel's new architecture.
- jimmyed 5y ago> When one sibling is executing, the other must wait. SMT is useful because CPUs often go idle while waiting for events — usually the arrival of data from memory. While one CPU waits, the other can be executing 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)
- zaxcellent 5y agoWhat you're describing sounds like a superscalar processor which utilizes instruction level parallelization: https://en.wikipedia.org/wiki/Superscalar_processor https://en.wikipedia.org/wiki/Superscalar_processor
- willis936 5y agoAs someone else said, this is superscalar, though these days companies refer to the number of concurrent out-of-order pipelines as Execution Units (EUs). 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.
- Symmetry 5y agoNo, it's not. SMT is specifically when you're running two threads simultaneously on a superscalar processor that can execute multiple instructions in a single cycle. During SMT one thread might be using execution reasources the other thread doesn't need further increasing performance beyond just having something to do during a cache miss. What the article describes is temporal multithreading where only one thread executes at a time. https://en.wikipedia.org/wiki/Multithreading_(computer_architecture) https://en.wikipedia.org/wiki/Multithreading_(computer_archi...
- exabrial 5y ago> While one might argue that cloud-computing providers are usually grumpy anyway, there is still value in anything that might improve their mood. I'm dead haha. This is great.
- OldHand2018 5y agoThe first link in the linked article mentions Linus saying (in 2019) that performance needs to be better than simply running with SMT disabled. 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.
- Arcuru 5y agoYea, I'm curious what they even mean by 'performance' in this context. 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.
- 656565656565 5y agoI’m surprised this has made into the mainline kernel, it feels like it is a niche use case. Perhaps cloud provider pressure?