News for hackers. Stuff that matters.
Re:Moving Google toward the mainline by sudarshnachakra on Tuesday October 05, 2021 @11:13PM (#28768740)
A genuine question. Why is that Google uses a custom kernel (with patches that could not be mainlined) when the below options are available.

1. Compiling the kernel with custom knobs 2. Write the custom code as Linux modules

Re:Moving Google toward the mainline by dboreham on Tuesday October 05, 2021 @11:30PM (#28768857)
Because originally they were (way) ahead of the mainline. Article doesn't actually say this fwiw. Nowadays mainline is mostly caught up, but it's hard to rebase (article does say this).
Re:Moving Google toward the mainline by danobi on Wednesday October 06, 2021 @12:11AM (#28769103)
Because you can’t add a feature with a knob. And not all changes can be made in a module (eg core kernel). And even if they could, kernel internals are not stable and you would still need to rebase your out of tree modules.
Re:Moving Google toward the mainline by geofft on Wednesday October 06, 2021 @12:23AM (#28769174)
Not everything can be written as modules. The module API is fairly limited, and it doesn't let you arbitrarily customize the behavior of existing parts of the kernel. Examples from the article include OOM and scheduling. One I ran into myself recently is that, despite the name, Linux Security Modules (LSMs) are not loadable modules, and the LSM initialization code is unloaded after kernel boot, so even if I wanted to play tricks with unpublished APIs, the code is just not there.

A little more philosophicallh, if all these customization points were available as modules, the process of updating modules to work with new versions of the kernel would be exactly as much of a mess.

Re:Moving Google toward the mainline by MichaelMoser123 on Wednesday October 06, 2021 @02:29AM (#28769871)
for OOM you do have a lot of flexibility with containers/control groups, nowadays. What kind of problems were they solving with the scheduler? I anything known about that?
Re:Moving Google toward the mainline by dodobirdlord on Wednesday October 06, 2021 @04:23AM (#28770537)
For background context, a reminder that control groups were originally developed in Google’s kernel fork, and later mainlined.

As for the scheduler stuff, the main change is a SwitchTo set of syscalls that allow threads to bypass the kernel’s scheduler and just continue execution as a different thread. https://lkml.org/lkml/2020/7/22/1202

Re:Moving Google toward the mainline by MichaelMoser123 on Thursday October 07, 2021 @03:04AM (#28783127)
Thanks for the link, it is explained in the linked video:

https://www.youtube.com/watch?v=KXuZi9aeGTw They explain it around 15:01 - google added it's own syscall switchto_thread - that puts the current thread to sleep and is switching to the argument thread id. (and some other calls too). That one helps with cutting down latency in inter thread calls for m:n threading. The real effort is to make latency for individual application requests predictable, while keeping it low.

Re:Moving Google toward the mainline by MichaelMoser123 on Thursday October 07, 2021 @06:12PM (#28792767)
the linked video briefly mentions that google has it's own futexs. What would be the difference between regular futexes and the google implementation?
Re:Moving Google toward the mainline by geofft on Wednesday October 06, 2021 @12:26PM (#28775000)
The article makes a passing reference to "Google Fibers" and "a new API for cooperative scheduling in user space."

There seems to be a Phoronix article with some more info and a link to a preparatory patchset that's public: https://www.phoronix.com/scan.php?page=news_item&px=Google-F...

Re:Moving Google toward the mainline by fragmede on Wednesday October 06, 2021 @04:21AM (#28770517)
Some things just don't want to be a knob. Weird stuff that no sane person would consider, until they need to, like raising the limit on how long a command line can be.
Re:Moving Google toward the mainline by hinkley on Wednesday October 06, 2021 @10:33AM (#28773643)
That one is not that weird and I don’t like having to use xargs to create multiple calls.
Re:Moving Google toward the mainline by pjmlp on Wednesday October 06, 2021 @02:09AM (#28769757)
Because as monolithic kernel, every feature touches lots of places and kernel modules have a very specific set of use cases.
Re:Moving Google toward the mainline by bonzini on Wednesday October 06, 2021 @02:14AM (#28769785)
It is not necessarily true that features touch a lot of places. But most of the changes are improvements to existing functionality (e.g. KVM, or the scheduler) rather than something self contained.
Re:Moving Google toward the mainline by ndesaulniers on Tuesday October 05, 2021 @11:29PM (#28768850)
I'd imagine drivers for lots of custom hardware that will never leave the datacenters.
Re:Moving Google toward the mainline by CameronNemo on Wednesday October 06, 2021 @12:02AM (#28769062)
But drivers for custom hw are easy to rebase. They are quite self contained.

It is when you get into kernel internals that rebasing continuously becomes a challenge. Some parts of the core Linux kernel don't change often, but I imagine many other parts see significant churn.

[dead]
Re:Moving Google toward the mainline by brantonb on Tuesday October 05, 2021 @11:28PM (#28768841)
>Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."

https://news.ycombinator.com/newsguidelines.html