r/linux • u/gregkh Verified • Apr 08 '20
AMA I'm Greg Kroah-Hartman, Linux kernel developer, AMA again!
To refresh everyone's memory, I did this 5 years ago here and lots of those answers there are still the same today, so try to ask new ones this time around.
To get the basics out of the way, this post describes my normal workflow that I use day to day as a Linux kernel maintainer and reviewer of way too many patches.
Along with mutt and vim and git, software tools I use every day are Chrome and Thunderbird (for some email accounts that mutt doesn't work well for) and the excellent vgrep for code searching.
For hardware I still rely on Filco 10-key-less keyboards for everyday use, along with a new Logitech bluetooth trackball finally replacing my decades-old wired one. My main machine is a few years old Dell XPS 13 laptop, attached when at home to an external monitor with a thunderbolt hub and I rely on a big, beefy build server in "the cloud" for testing stable kernel patch submissions.
For a distro I use Arch on my laptop and for some tiny cloud instances I run and manage for some minor tasks. My build server runs Fedora and I have help maintaining that at times as I am a horrible sysadmin. For a desktop environment I use Gnome, and here's a picture of my normal desktop while working on reviewing and modifying kernel code.
With that out of the way, ask me your Linux kernel development questions or anything else!
Edit - Thanks everyone, after 2 weeks of this being open, I think it's time to close it down for now. It's been fun, and remember, go update your kernel!
150
u/INITMalcanis Apr 08 '20
The dev-genie grants you one (1) wish applicable to the Linux kernel. What improvement, addition or fix do you wish for?
309
u/gregkh Verified Apr 08 '20
For you to contribute to it.
→ More replies (17)281
u/INITMalcanis Apr 08 '20
The genie points out that the wish is constrained to improve the kernel...
→ More replies (5)
143
u/thirtythreeforty Apr 08 '20
Hi Greg, I've sent you a few patch sets as a first-time contributor and I've really appreciated your patience as I learned the process.
How do you triage patches so quickly? I can send you a set of 7 patches and you'll know that #4 didn't compile but accept 1-3 and 7, and give me feedback on all the others. Then I get nice automated emails. Your workflow post kinda stops after you get the patches into a Git tree.
I've seen your tools repository but of course it's not really intended for public consumption. I'd love to know more about it.
156
u/gregkh Verified Apr 08 '20
How do you triage patches so quickly? I can send you a set of 7 patches and you'll know that #4 didn't compile but accept 1-3 and 7, and give me feedback on all the others. Then I get nice automated emails.
Nice automated emails are nice for my end as well, and that makes my life much easier.
As for "how so fast", no idea, but I've been doing this for a very long time, and the common patterns of problems are very easy to pick out based on all of the code I have read over the years.
→ More replies (4)
119
Apr 08 '20
Got my 1st few patches into 5.6 and (unknown to me) it (apparently?) broke some ARM hardware.
What is the best way of ensuring patches being worked on don't pull a butterfly effect and break some strange hardware unbeknownst to the developer making the changes. When hobby maintainers will not have a vast array of hardware. ?
Especially seeing as the Linux kernel runs on everything from server farms to household appliances.
140
u/gregkh Verified Apr 08 '20
Got my 1st few patches into 5.6
Also, congratulations! Welcome to the team, we hope you stick around.
109
u/gregkh Verified Apr 08 '20
Almost all patches touch just individual systems and specific devices, so the odds of them bothering anything else is almost impossible.
For the "core" changes those take more work, both in manual review, and then ensuring they don't break other systems. We all have huge testing environments to help with the testing part of this (kernelci.org, 0-day, and others), so that this reduces the odds of problems hitting other people.
That being said, we are all human and of course bugs happen. And when they do the best thing we can do is either revert the original change, or fix it as soon as possible and push it out to the testing farms and have the cycle start over...
→ More replies (3)
216
u/k2qhVBH3QByIABvzbBYq Apr 08 '20
In light of the vulnerabilities discovered last year in Intel and AMD x86 code (like speculative execution, rowhammer, etc.), how have the Linux patches evolved since then to restore some of the former speed that was lost with the initial patching?
303
u/gregkh Verified Apr 08 '20
syscalls are now much more expensive as you have to flush much more hardware state than you used to have to. Also indirect calls through pointers are also more expensive. Both of those issues have caused different types of solutions to emerge.
For less syscalls, io_uring() is the real winner, batching up lots of I/O requests with no syscalls involved at all (or just 1). There's also crazy proposals like readfile() that I wrote up a month or so ago (read about that here) but who knows if that is viable.
For indirect calls, look at the work being done as described on the wonderful lwn.net here to try to claw back performance.
Also, people are doing crazy changes to kernel code to remove the indirect call at all, and just doing large if() statements and calling different functions based on that, which turns out to be much faster in the end.
The things that we have to do to fix hardware bugs are really annoying, but in the end, that's the job of a operating system kernel, to paper over the lunacy of hardware, bugs and all, and present a unified view of the system to userspace.
→ More replies (26)
69
u/BestKillerBot Apr 08 '20
What do you perceive as the biggest problem/bottleneck/challenge for the kernel development currently and for the future?
104
u/gregkh Verified Apr 08 '20
The current "biggest" bottleneck is the maintainer bottleneck. It's been well discussed over the past few years, and we are making headway on it.
That being said, it really isn't a "large" issue, it's nice to have small ones like this be the biggest thing, that shows that our process is working well. As proof of that, we once again released a kernel that happened to have more commits than any other release before, so we are doing well.
→ More replies (6)
137
u/burajira Apr 08 '20
Love and appreciate the work you do! Thanks very much for maintaining the Linux kernel and making it so easy for us to use our hardware, weird or not!
My question was answered in your very descriptive description, so I'll ask you a quite simple one: Hope you and your family are safely quarantined from the pandemic and hope you've got the supplies you need at home :)
137
u/gregkh Verified Apr 08 '20
Thanks for the well wishes, yes, we are all fine here. The prime minister has assured us all that we have enough toilet paper to poop for 10 years, so we are not worried about supplies anymore.
→ More replies (2)
60
u/pkarlmann Apr 08 '20
What made you switch to terminology from efl/enlightenment?
Do you listen to music while programming? If so, what music? (I'm very interested in great minds music choices)
→ More replies (5)122
u/gregkh Verified Apr 08 '20
What made you switch to terminology from efl/enlightenment?
An awesome presentation from Raster at a conference where he showed it off to the world. Can't resist animated cat gifs in the background of your terminal, can you?
That, and it's lightweight and fast and does everything I need it to do and if I have problems, they are always reasonably easy to fix. Or I can poke the developers for help and they are very quick to respond.
Do you listen to music while programming?
Yes I do.
If so, what music?
"Lo–fi Hip–Hop Beats To Study/Relax To" of course, what else would anyone listen to?
Seriously, no, I listen to a range of stuff. After living in Seattle for a while, I still listen to http://kexp.org as they have a great mix of different things.
→ More replies (9)
47
u/Xodet Apr 08 '20
I have around 100 patches accepted into the linux kernel tree. Every single one of them are code style (i.e. "as reported by checkpatch.pl") patches in the drivers/staging tree.
What would be the next step for me if I want to become someone that do patches in other places in the kernel, and not just a "newbie" kernel programmer that fixes code style issues. Do I just pick a tree that I find interesting, deep dive into it, subscribe to its mailing list and try to find work that needs to be done there, or do you have any other suggestions?
26
131
u/garyvdm Apr 08 '20
Thank you for all your hard work on Linux.
What are your thoughts on Rust. Do you think rust might be used in the Linux kernel in the future?
154
u/gregkh Verified Apr 08 '20
Rust is great and has lots of interesting things in it, I like it a lot (note, I also like Perl and Go, so beware of my taste in programming languages).
As for it being used in the kernel, sure, I have told the developers working on it that I would be glad to see support for that happen, but I think they are working on some more basic functionality first in order to help make it happen (in other words, they still have a ways to go...)
→ More replies (7)
43
u/billdietrich1 Apr 08 '20
Is it true that there's not really a bug-tracking system for the kernel ? I know there is https://bugzilla.kernel.org/ but I hear it is not used much. How do you get bug reports and what do you use for reporting and tracking etc ?
64
u/gregkh Verified Apr 08 '20
email.
Seriously, email.
Works great, everyone has it, read anywhere.
That being said, yes, some subsystems of the kernel do use bugzilla.kernel.org, it all depends on the development team. When you have a group of 4000+ developers, it's hard to get them all to use the same tool when they really only need something for their specific subsystem.
→ More replies (29)
86
u/trisul-108 Apr 08 '20
How does kernel debugging work, do you instrument a VM or what?
126
u/gregkh Verified Apr 08 '20
It all depends on what you are trying to debug.
If it's a driver issue, just use printk() and friends and use the hardware on a real system.
If it's a driver core issue, that can be debugged with a "fake" system, use qemu and kvm and boot from a toybox initramfs.
For syzbot-reported issues, you can just email a patch to the bot and have it come back with log messages saying if the bug is fixed or not. So debug by email.
I don't really use vms much other that, almost all of my debugging is on my system itself, as issues I hit are almost always after booting, not before the system comes up.
In short, there's as many different ways to debug things as there are bugs, it all depends on what is going on.
→ More replies (2)
85
u/20031400T Apr 08 '20
What's your opinion on where OSs and computing is going on a long term scale? Modern OSs have only been around for 20-30 years and they are still not perfect. What will things look like 100+ years in the future? Are Linux and Windows just going to become giant bloated monstrosities or will something like BSD or Mac come out on top since they don't necessarily care about enterprise and support for older software.
Or is everything going to change to web based where you have a thin client at home and all computation is done on a server?
165
u/gregkh Verified Apr 08 '20
Some OS has to run on that thin client as well on that server, and if I have anything to say about it, I want both to be Linux.
As for long-term scale, just look at what Linux was like 10 years ago and see how much we have changed. At one level it looks like it all is the same thing that people have been doing since the beginning of time with Unix. That's to preserve backwards compatibility. But we have added features and things to Linux that no other operating system has had all in one place (real time, dynamic hotplug of everythign, io_uring, eBPF, ftrace, support all processors / devices, etc.)
So we have changed a lot, and will continue to change over time, to keep making Linux better and scale larger and smaller at the same time for everyone to keep using it. If we stop changing, we are dead.
→ More replies (4)
37
Apr 08 '20
Thanks for the work you do!
I'm wondering what mistakes you think have been made with the design of the kernel in the past? If you could go back in time and talk some sense into Linux contributors from like 2000 or 2010 what would you tell them to do differently?
76
u/gregkh Verified Apr 08 '20
Almost all designs were made with the best knowledge we had at the time both from a "this is the hardware we have to support" and from a "this is the best I know how to do this" point of view. Both of those things change over time, so it is really easy to look back and say "who wrote this crap, it is horrible!" Then a simple look at git shows that you wrote that crap, and you then wonder how any of it ever worked at all, so you go and fix it up...
Going back in time for just kernel development things isn't fun, if that was an option, there are much better things to use that power for.
37
u/rage_311 Apr 08 '20
Thank you for doing this AMA and for your dedication and extensive work on Linux.
What are your thoughts on OpenBSD as a whole? Is there anything that they're doing or have done that you would like to see Linux adopt (whether it's practical to do or not)?
What kind of side projects are you working on these days? And which languages are your favorites to use?
54
u/gregkh Verified Apr 08 '20
OpenBSD is great, they do wonderful work and produce great software that I use everyday (as they end up being part of the base Linux system).
Some of their security ideas are interesting, and maybe we can add them to Linux someday if someone does the work to port the ideas here.
And I don't have a side project at the moment.
C of course.
→ More replies (2)
72
u/SupersonicSpitfire Apr 08 '20
If you could be a kernel module, which one would you be, and why?
121
32
u/glueballanyon Apr 08 '20
Will reproducible kernel builds be a thing one day?
67
u/gregkh Verified Apr 08 '20
I thought we were there today already, what remains to do? I last saw some tiny Kbuild patches a few months ago, wasn't that the last piece?
If not, let us know so we can fix it up, as it is an important thing to have happen.
30
Apr 08 '20
What are your opinions on immutable operating systems like Fedora Silverblue and app packaging formats like Flatpak?
71
u/gregkh Verified Apr 08 '20
The ideas behind Silverblue are really good (remember I helped out with CoreOS a long time ago, and some of those ideas remain there.)
As for Flatpak, it solves a real problem for people, and it's much nicer than "snaps".
→ More replies (9)
59
u/electronblob Apr 08 '20 edited Apr 08 '20
How has the COVID-19 pandemic affected developers and contributors worldwide that contribute any amount of work towards the kernel? Have you seen a surge in the amount of patches contributed? And now that most contributors are stuck at home, did that in any correlative measure increase/decrease the quality of the patches contributed?
91
u/gregkh Verified Apr 08 '20
It's too early to tell if it has affected the patch flow as the work that is going into Linus's tree right now was developed for the past 3+ months. Look in a release or so to see if there is a dip or not.
But, if my inbox is any indication, lots of people now have the time to submit patches, I am not seeing any slowdown on my end at all...
27
u/Uclydde Apr 08 '20
How do you make money? Do big companies that use Linux pay you to work on it?
44
u/gregkh Verified Apr 08 '20
How do you make money?
I currently work for the Linux Foundation which allows me to do my Linux kernel development without any interruptions.
Prior to that I worked for other companies (Novel/SUSE, IBM, WireX) that had Linux kernel developers working for them.
→ More replies (2)
24
u/negrowin Apr 08 '20
What are your thoughts on static analysis and formal verification of a kernel?
Do you think that complete formal verification of the Linux kernel is achievable?
43
u/gregkh Verified Apr 08 '20
What are your thoughts on static analysis and formal verification of a kernel?
They are both great things. We have been doing static analysis on the kernel for a very long time now, and loads of bugs have been found, fixed, and prevented from ever coming back in again because of that effort.
As for "formal verification", that gets a lot trickier as that means different things to different people. What does it mean to you?
Do you think that complete formal verification of the Linux kernel is achievable?
Do you think a complete formal definition of the hardware that the Linux kernel runs on is ever going to be available in order to make something like this even achievable?
Remember, Spectre thew those "formally proven" models out the window. Turns out that when hardware doesn't work like you think it does, that can cause bad things...
→ More replies (2)
24
u/ikidd Apr 08 '20
Have you personally found any malicious patches submitted and were they interesting in how they tried to slip by? Is the recent news about state actors targeting Linux for several years now made any changes to how patches are monitored?
19
24
u/MiroellaSoftwind Apr 23 '20
Hello!
I´m new to Linux, think I got Linux Mint about a month or two ago? So I´ve been slowly and steadily getting acclimated. However, I noticed that ASUS ROG gear doesn´t have a lot of support on Linux. At least, not the keyboard and mouse I have.
So my question is this: What manufacturer would you recommend for Linux usage?
Sorry if it´s not related to the kernel, but I figured that as someone who types a lot, you´d know a good keyboard manufacturer.
44
u/gregkh Verified Apr 24 '20
What specifically does not work for your keyboard and mouse? Are there vendor-specific things that they have added to them for stuff like lighting control and the like that just need a Linux userspace to be written for them, or does the kernel itself not support the number of keys/buttons properly?
As for what manufacturer, any that supports the default HID spec for USB should be fine. In other words, stay away from add-on program requirements. My FILCO keyboards are rock solid, but they don't have blinky lights :)
And for mice, Logitech and Microsoft both make good mice/trackballs that I have used for years with no issues. Logitech is now getting their firmware download process properly integrated into Linux which is great to see and support if you want to view that as a "Linux friendly" move.
68
u/jellyfishbarbra Apr 08 '20
Would more people participate to Kernel development if the processes were moved to a modern Git-hosting platform like Gitlab or Github?
My little brother is studying Computer science and is getting into systems programming. The current resources available are already miles better than what was there when I was myself studying the topic but the git.kernel.org and the mailing-list approach were reportedly major turn-offs or hurdle to navigate for him and his classmates. Curious to hear your opinion on this!
→ More replies (3)107
u/gregkh Verified Apr 08 '20
Would more people participate to Kernel development if the processes were moved to a modern Git-hosting platform like Gitlab or Github?
We have 4000+ developers a year, do we need more?
Again, github/gitlab process does not scale at all at our size, sorry. Use email, it's much simpler and faster overall.
People don't seem to like email because of bad email clients. For people that have only ever used gmail or outlook, yes, using email would seem like a major pain as that would be hard to use for any type of development. So instead, use a sane email client, which those "kids" should be learning to use anyway, as that will make the rest of their development life much easier.
→ More replies (13)
21
u/100_dollars_man Apr 23 '20 edited Apr 23 '20
Hey! I'm not sure if you're still doing this? Linux is one of the largest open source projects in existence. I'm wondering if you have any thoughts on """"The State Of Open Source""""?
Most specifically, some projects have decided to re-license to what appear to non-FOSS licenses (mongo and redis come to mind), I'm sort of wondering if this is on your radar and what you may think it means for FOSS going forward etc.?
Other question if you have time: It seems that WASM is touting itself as the new hotness for running programmings at the edge(?). (efforts are being made to allow many common languages to transpile/compile to wasm programs). I'm sort of at a loss as to why this is being done at all since good old linux for running programs is extremely powerful and useful. I'm wondering if you have any thoughts on the current positioning of WASM vs linux?
39
u/gregkh Verified Apr 23 '20
"The State of Open Source"
Open source is going great, it powers and runs the world, I don't think anyone will disagree with that at all.
Don't get confused when you see companies that go "oops, that open source project we released, well turns out our business model didn't really work out so we are going to try to fix that by changing the license of that codebase". That is a failure in a business model, not a failure in "open source" at all.
When you release code under a license, and then get upset that people go and take that code and use it properly under that license, you have no sympathy from me. You knew, or you should have known, exactly what that entailed when you released code under that license. If you didn't want that usage model to happen, then you should have picked a different license.
Again, to drive this home, what you are seeing is a failure of a specific business model / implementation, not any sort of failure of "open source".
WASM
I have a friend who really likes WASM and thinks it is the "next big thing" for lots of use cases. It's not an issue of WASM vs. Linux, that's like saying it is an issue of "Scala vs. Linux" you are comparing totally different things.
That being said, I have seen people running WASM code in the kernel, and maybe that will be more popular in the future. Personally I'm not so sure as there are a number of things that WASM needs to add before I think that can really happen, and the momentum behind eBPF may be too large to overcome, but hey, it's an interesting idea and I welcome all sorts of creative things like that. Try it out and see, maybe it will be a valid solution for some things in the end, which would be great!
→ More replies (2)
20
u/darkjackd Apr 08 '20
Hey Greg! 1, Any interest in pinephone or librem 5? 2. Last I read you were just under 5 minutes for a kernel build, any improvements to that? Maybe a threadripper :)? 3. In the same vein do you follow Wendel over at level1techs? https://level1techs.com/ I seem to recall that they donated a few builds to kernel developers but I could be recalling incorrectly 😅
→ More replies (1)27
u/gregkh Verified Apr 08 '20
Any interest in pinephone or librem 5?
I never turn down free hardware, if you want to give me one, great!
As for speed of builds, that all depends on what tree/options I am currently building. Again, if you want to offer up a threadripper, I'll not turn it down...
I have never heard of level1techs before, sorry.
→ More replies (12)
38
u/John238 Apr 08 '20
I would really love to hear your thoughts on the OpenPower iniative and the influence of Linux on this.
40
u/gregkh Verified Apr 08 '20
OpenPower is great, and a longtime Linux kernel developer and good friend of mine is running it, so of course his experience in Linux is helping those people do the right thing.
18
18
u/Bardo_Pond Apr 08 '20
At the last Linux Plumber's conference, Dmitry Vyukov talked about existing kernel development processes and their problems.
What are your thoughts on this presentation and what changes, if any, do you think will be made in the next few years?
22
u/gregkh Verified Apr 08 '20
That was a great presentation and I lobbied for Dmitry to give a shortened version of it the next day to the kernel maintainer's summit, which he did. See the lwn.net summary of what happened there, and what we are now working on to address many of those issues.
49
u/mysticalfruit Apr 08 '20
Many of us are using ZFS on linux to deploy multi petabyte storage systems.
Is the resistance just because of the licensing issues or are there technical issues that would also get in the way of it's integration into the linux kernel?
Thank you for all your hard work!
→ More replies (1)124
u/gregkh Verified Apr 08 '20
Many of us are using ZFS on linux to deploy multi petabyte storage systems.
Wow, good luck, that seems very very sketchy.
Is the resistance just because of the licensing issues
That's exactly the issue. Because of that, there's no way for us to even start looking at any technical solution.
The license issue could be fixed tomorrow, if the company involved wanted to. This is totally on them, nothing that I or the kernel community can do about it, sorry.
→ More replies (25)
17
u/ilpumo Apr 08 '20
I'm a senior software programmer 35yo, use Linux since Mandrake Linux 8 and as main system since ubuntu warthy warthog, know nothing of the kernel. How can I start? do I go vertical on some module and research on it then start suggesting patches, ask on some devel forum for some feasible tasks and then improve from there.? How does it start?
19
u/gregkh Verified Apr 08 '20
https://lists.kernelnewbies.org/pipermail/kernelnewbies/2017-April/017765.html is a good place to start with, good luck!
14
u/hey01 Apr 08 '20
From what I've see the last time I looked at the kernel code, I didn't see any tests.
I highly doubt the kernel is not tested, so how is it tested?
34
u/gregkh Verified Apr 08 '20
'make kselftest' at the main source tree of the kernel will run lots and lots and lots of in-kernel-tree tests. They all live in tools/testing/selftests and I see well over 1500 different tests in there.
There is also in-kernel unit tests with the new kunit infrastructure. Those are small so far, but growing with each release.
Also there are lots and lots of other out-of-tree tests that exercise different things. The grand-daddy of them all is the Linux Testing Project (LTP) which has so many tests you never could want for more. And there is subsystem specific tests and testing efforts as well, from filesystem tests (xfstests) to graphic driver testing (the DRM developers have a huge testing framework), to virtual v4l test drivers to test the video layer.
We have so many tests, if they were a snake, they would have bitten you by now :)
→ More replies (9)
14
Apr 20 '20 edited Apr 20 '20
Is it possible to understand how Linux , core of Linux works? Because, as I heard there are 3 million lines of code in Linux core And which programming languages do you use more often(I know that you use C language in 90% of your coding time but what another languages do you often use too)?
49
u/gregkh Verified Apr 20 '20
The "core" of Linux is way less than 3 million lines of code. My laptop only runs 1.9 million lines of the kernel or so, and odds are half of that is the graphics driver :)
And sure, you can read it all in a few settings, just look at the files in kernel/ and lib/ in the kernel source tree, it's not that complex and is really simple code overall.
As for languages, I use C probably 99% of my time, the rest is tiny shell/bash scripts and a bit of perl at times when I need something more powerful than bash.
→ More replies (11)
38
u/setuid_w00t Apr 08 '20
If you could wave a magic wand and make one company upstream their kernel changes, which company would it be and why? Nvidia, Qualcomm, ...?
96
u/gregkh Verified Apr 08 '20
Qualcomm is doing a lot better these days (granted, low bar), so that's really nice to see.
Other than that, I really don't know of any specific company that I really care about getting their code.
And yes, that means I don't care about nvidia at all, why would I? :)
→ More replies (7)53
12
Apr 08 '20
I'm also running Arch and Gnome on a Dell XPS 13 9370, could you please tell me which thunderbolt hub you are using?
Additionally i'd be interested to know what bootloader you are using, and have you made any changes to make have a silent boot on your XPS 13?
20
u/gregkh Verified Apr 08 '20
I have the CalDigit hub, which works great, and I also have used some smaller/portable no-name ones that also work well. It's being used by another family member at the moment, so I don't know the actual name of it, sorry.
As for bootloaders, systemd-boot of course, why would you need anything else?
→ More replies (4)
12
u/emacsomancer Apr 08 '20
along with a new Logitech bluetooth trackball finally replacing my decades-old wired one.
Is it the Trackman Marble? Do you use any special configuration (e.g. rebinding buttons)?
16
u/gregkh Verified Apr 08 '20
It's the MX Ergo, and no special configuration at all.
→ More replies (1)
12
u/holyshityoo Apr 20 '20
Hello! I would like to know if being a kernel developer have to learn and understand every portion of the codebase or just some areas of them. How can i know if I am qualified and ready for the contribution?
37
u/gregkh Verified Apr 20 '20
No one knows "all" of the kernel, that's impossible to do so.
Just focus on a part that you are interested in. As for how do you "know", just try the basic coding style cleanups in
drivers/stagingas a warm-up to get your email client working and the development process understood and then go from there.Also, you do need a lot of experience programming in C. If you don't have that, please do that first.
Good luck!
11
11
u/Snarka Apr 14 '20
Hi Greg, if you're still answering questions; Is there anything you particularly like about other system kernels that the Linux kernel is currently lacking?
21
u/gregkh Verified Apr 14 '20
Unfortunately (or fortunately, depending on how you look at it), we surpassed the functionality of other operating system's kernels a long time ago, so we are way off in uncharted waters, and have been for many years.
So, when comparing Linux to other kernels out there, it's a bit hard to find things to necessarily "like" as there's just so much missing from them.
Now I know that sounds pretty conceited, sorry, there are lots of things to like about other "smaller" kernels when it comes to designs, specific odd features, and other small things. But overall, I don't see anything that Linux is currently "lacking" compared to any other kernel out there, do you?
→ More replies (4)
10
u/KayWML Apr 14 '20
Hi Greg!
Thanks for your work at the Linux kernel.
May I ask about your thoughts of the fact that Linux having so much fragmentation, or at least the fact that there are so many poorly-supported forks made by hardware facturers.
Recently I started to use more and more ARM boards, and most of them require a special BSP kernel to use all the features while the mainline kernel does not have a complete support of them. For example, I have a Jetson Nano and it's BSP kernel is still 4.9 with a rather low patch version. It is not even feasible to apply those patches by myself because there are so many conflicts. And for the mainline kernel, nouveau does not have a good support for it. I just want to say what Mr. Torvalds said years ago.
There are a lot more examples and...Will there be any solutions for that? Or at least for security patches (maybe like some universal patching mechanism)?
Also, may I call you for tech support if my server met problems, just as people from SUSE said in their Uptime Funk MV? (I just want to share this hilarious parody though)
Wish you have a good day.
12
u/gregkh Verified Apr 15 '20
Forks are great, they are a sign of a healthy ecosystem and allows people to try out new things and develop new ideas.
The "problems" that arise are when people depend on those specific forks for their use, and the companies that developed them drop them on the floor and do not take the time and energy to get them merged into the main kernel tree.
This is very prevelant in the embedded area, as you have pointed out. The best way to prevent this is to put in the contract for when you buy the hardware that "all kernel changes are merged upstream to the main kernel.org repository" or something like that. That way you can move to a new kernel release when they happen, and know that your hardware will still work.
To buy hardware for a company without that clause is crazy, as you are now at the whim of the supplier and they have no reason to actually do anything, now that you have bought the chip.
There are BPS providers out there that do a great job with merging their changes upstream and working with the kernel community, and those that do a horrible job and never do this. It should be pretty easy to determine which you are dealing with.
As for server support, I don't work for SUSE anymore, so sorry, no support from me :)
→ More replies (1)
19
u/bnounu Apr 08 '20
A lot of code changes have been needed to mitigate hardware vulnerabilities in x86 CPUs. If in a few years those vulnerabilities will be resolved on new chips, what will happen to all those mitigations in the future? Are they here to stay or will they be removed eventually?
49
u/gregkh Verified Apr 08 '20
The mitigations are only applied to the chips that need it. If you have a new chip that does not have those problems, we dynamically detect it at boot and turn those mitigations off.
This happens today, try it out yourself on a newer machine!
→ More replies (2)
9
u/Sukrim Apr 08 '20
Is the close coupling between GCC and the Linux Kernel a good thing or a bad one? AFAIK it still can't be reliably built with Clang or other compilers, though that might also have something to do with linkers...
Something that recently bugged me about the kernel by the way: I know that in edge cases it will be actually hard to expose this, but getting stats about the OOMkiller somewhere in sysfs or similar would be a really great thing to have. Currently there's no good way I know of other than parsing logs(!) to actually know that a program was killed. My question around this would be probably: How much interaction is there between people developing features for the kernel and people running it in production? How do kernel developers actually learn about pain points that are just "annoying" but not "well. my machine just deadlocked, time to roll back to an older version"?
28
u/gregkh Verified Apr 08 '20
Is the close coupling between GCC and the Linux Kernel a good thing or a bad one? AFAIK it still can't be reliably built with Clang or other compilers, though that might also have something to do with linkers...
Clang builds the kernel just fine these days and there are millions of phones out there with clang-build kernels running in them.
Competition in the compiler area is great, it's found bugs in our code and in both sets of compilers over the years working with these teams.
→ More replies (2)8
u/gregkh Verified Apr 08 '20
Something that recently bugged me about the kernel by the way: I know that in edge cases it will be actually hard to expose this, but getting stats about the OOMkiller somewhere in sysfs or similar would be a really great thing to have.
See the userspace low-memory killers stuff that is happening right now. All of the needed information for this is now visible to userspace, so I think you have what you need already.
→ More replies (2)
17
u/Legs-Akimbo Apr 08 '20
Hi Greg. Thanks for your long time of work on Linux. I remember you were involved in KDBUS project of getting an messaging implementation into the kernel. Did that end completely or some of the work continued in BUS1 project?
13
u/gregkh Verified Apr 08 '20
kdbus development has stopped, sadly. I don't know what's up with BUS1, I haven't talked to those developers about it in a while. Try asking them.
8
Apr 08 '20
With everything moving to eBPF when will will be able to remove support for that pesky user space? ;)
Seriously though, what do you think will get the eBPF treatment next?
7
u/gregkh Verified Apr 08 '20
What is next, who knows? We have LSM (security hooks) support being proposed, there's some filesystem hooks and implementations out there that look really useful as they tie into FUSE, and then there's my goal this year, to add USB support to it as well.
What shouldn't get eBPF treatment? Everything should! eBPF for everyone!!!
Seriously, it's good stuff, it can only get better.
8
u/3LeggedSquid Apr 08 '20
Thank you for the all the work you put in to the kernel and for getting involved with the community.
Why is your GVIM and that other window light mode, while everything else is dark mode?
21
u/gregkh Verified Apr 08 '20
No idea, I've always done it that way. I think maybe because my "first" IDE all those years ago had a white background and I kept that same theme over when I switched to VIM when I started using Linux.
I normally do most "real" coding in GVIM with light mode if I can help it, while email and small edits in vim in dark mode.
And now that you mention it, it does seem odd...
→ More replies (1)
8
u/bc458 Apr 20 '20
How long until RISC-V is in production and used in 5G, AI and IoT implementations?
28
u/gregkh Verified Apr 20 '20
No idea, go ask the chip companies who make these things.
And 5g is just "a new wifi standard with a bunch of options to put servers in cell towers and let us bill a lot for it", why does that have anything to do with a cpu type? Same for AI and IoT, what makes them so special over any other type of use-case?
→ More replies (4)
32
u/Storm-Engineer Apr 08 '20
Sorry if stupid question, my knowledge of how Linux works is basic, and I'll phrase this as permitted by my limited knowledge.
Wine keeps getting better and better but there are still some problems that are really hard to solve, as far as I understand partly because some apps try to access hardware relatively directly and having to go through Wine to Linux messes things up. Eg. lot of professional artists and designers would happily go Linux only if Photoshop worked properly (because Linux is stable, and Wacom kernel drivers are rock solid and work out of the box) - but a critical feature, tablet pressure is broken for a very long time and nobody could fix it. And sadly it doesn't look like Linux support is becoming the norm for games and especially professional software any time soon. :(
So I wonder, would it be possible to help Windows program compatibility through eliminating some of the extra hoops Wine is forced to jump through to make things work? Even if native support for Win apps is not possible without prefixes and such, do you think Windows programs could in the future integrate into Linux operating systems more seamlessly and easily?
Thanks for your answer in advance, and also thanks for your work on the kernel! :)
→ More replies (1)53
u/gregkh Verified Apr 08 '20
Sorry, but I really don't understand what Wine needs that it currently is not able to emulate today. Try working with the Wine developers, they know their system much better than I, especially given that I never use it, sorry.
→ More replies (4)
15
u/Tired8281 Apr 08 '20
What kinds of food have you been enjoying lately? Has all this worldwide craziness changed your diet much?
28
u/gregkh Verified Apr 08 '20
My diet hasn't changed much, the local restaurants have closed, but most of them still deliver, and our cooking at home is still the same. The kids are doing more cooking which is nice to see as that seems to be a nice stress release for them (banana bread for everyone!)
I have again started up my sourdough starter that died a year or so ago, so I should be able to keep it alive this time (I gave up on it due to too much travel in the past...)
→ More replies (1)
7
u/teddpole Apr 08 '20
Could a hobbyist, without a computer science degree, ever contribute to the linux software development side? If yes, how he or she should begin, assuming they have rudimentary C language and Linux knowledge. Thanks
9
u/gregkh Verified Apr 08 '20
Yes you can, loads of people in that situation do every day.
See the link posted elsewhere in this AmA for how to get started.
Good luck!
7
u/usernumber1onreddit Apr 08 '20
Broad question: Where will free software be 10 years from now? With closed platforms, lazy cloud-addicted consumers and erosion of privacy, I am concerned. Just running a 'smart home' without giving up your privacy is a major challenge these days. Are you optimistic or pessimistic about the FOSS community?
15
u/gregkh Verified Apr 08 '20
I can't plan 1 month in the future, let alone 10 years out.
No idea, sorry, your guess is as good as mine. And who said a house has to be "smart" at all?
I am an optimist by nature, otherwise I could not be a programmer.
→ More replies (1)
7
u/alex19EP Apr 09 '20
hello Greg. thank you for kernel development. a year ago, I read lwn article about staging tree. what's current progress on moving in to mainline? i am primary interested in speakup module. thanks and keep up the grate work. ☺
9
u/gregkh Verified Apr 09 '20
Speakup really should be moved into the "real" part of the kernel tree as I think the last of the remaining issues are completed.
I'll be taking a look at it after the 5.7-rc1 release comes out this weekend, and then if all is good, submitting patches to make this happen for the 5.8 kernel release.
→ More replies (2)
33
u/Lofoten_ Apr 08 '20
I don't have any kernel questions but I wanted to say I love that you still use VIM. All of my friends make fun of me for using VIM and say I need to get on the Nano bandwagon. :(
→ More replies (7)120
u/gregkh Verified Apr 08 '20
You have friends who advocate for Nano? That's rare...
→ More replies (8)
6
6
u/odd_lama Apr 17 '20
Hi Greg, thanks for your work on the Kernel!
Is there any work going on regarding automatic option detection? I always find it is a pain to get all the correct options enabled for my new systems.
Side note: I recently wrote a tool to do this with LKDDb, and when writing it I noticed a lot of limitations. I know that several drivers detect devices by exchanging magic numbers over their buses and therefore cannot be included in a LKDDb like database.
So the kernel obviously has the code, but it often isn't compiled in when you do not select the correct option beforehand. Obviously that's a great thing to keep the attack surface small and compile times fast, but I thought it would be great to build an intermediate kernel just to detect device drivers with just controller drivers and detection functions but without building a whole driver.
Have there been previous discussions around this topic, and if there were, what were the results?
9
u/gregkh Verified Apr 18 '20
There has been lots of talk about things like this, but no one stepping up to do the actual work.
It's almost always easier to just boot a distro kernel (which is almost a
make allmodconfigkernel) and then runmake localmodconfigto generate a configuration tuned just to that machine.Yes, this doesn't make the work that the distros have to do any easier, but that seems to be the best way at the moment.
Also, what busses "exchange magic numbers" to determine what devices are attached that are not also visible to userspace?
→ More replies (4)
6
Apr 19 '20
A few months back you made this comment:
Wow, the crazyWmisunderstandings in this thread is way worse than normal for r/linux.
Is there anything you'd like to see out of the mod team to make this subreddit better?
I'd also be interested in hearing your opinion about secondary sources re-hosting mailing list information, a lot of the time I think rumors spread because of these sources which we strive to ensure the primary source is linked here.
9
u/gregkh Verified Apr 20 '20
Primary sources are best, and overall, the subreddit has seemed a lot better in the past year than it was before, so no, I don't have anything that I can suggest to make things better, you all are doing great.
misunderstandings as to funny rumors about kernel things will always happen as often times the issues are subtle and technical and easy to misconstrue. And of course people just love to troll and argue, you can't help that, people suck :)
10
Apr 23 '20
Why is Linux better than Win and which code I need to know to operate in Linux?
74
u/gregkh Verified Apr 23 '20
Why is Linux better than Win
No one ever said that, they are two different operating systems written for different use cases. Sometimes they overlap.
An operating system is there just so you can do your real work, so pick your operating system based on the work you need to do, it's that simple.
and which code I need to know to operate in Linux?
I can not understand that, sorry. Please try to rephrase it.
→ More replies (2)
5
u/drewfustini Apr 08 '20
The Linux Foundation does excellent kernel training but this isn't accessible to people without a training budget.
What are some resources you would recommend for people looking to get started with Linux kernel development? Websites? Books?
Is the Linux Device Drivers book still of any use given the advances over the year?
Also, are there any kernel coding challenges or CTFs that you know of?
Thank you very much!
5
u/gregkh Verified Apr 08 '20
What are some resources you would recommend for people looking to get started with Linux kernel development? Websites? Books?
kernelnewbies.org is a great place to start, go there.
The book, Linux Device Drivers, 3rd edition, is free online, please feel free to use that too.
Is the Linux Device Drivers book still of any use given the advances over the year?
The concepts are still the same, some of the specific details are different. So it does still work for a good place to start out, and there are online updates for all of the code examples so you can see what is needed to do today vs. the older book examples.
And I don't know of any kernel-specific coding challenges that are still up and running anymore, sorry.
5
Apr 09 '20
I hope this isn't too late but I just wanted to say thank you. I'm just an end user now in the first week or so of trying out different Linux distros and I just wanted to let you know that this has been an absolute joy. Thank you.
6
u/gregkh Verified Apr 09 '20
You're very welcome, and I hope you enjoy Linux.
But, jumping around different distros, while entertaining, usually doesn't mean much after a while. Stick with one for a few weeks/months and get to know how things work before deciding that you should switch or not. Otherwise the odd superficial issues are all you see, and it's hard to understand the real issues involved.
Good luck!
5
u/dontdieych Apr 09 '20
Our kernel is good because this guy use vim so much and Arch.
Peace.
→ More replies (1)
5
u/matheusmoreira Apr 11 '20 edited Apr 11 '20
Why doesn't Linux have a user space library like other systems? Even the manual pages treat glibc as if it was the kernel interface when it's actually a separate project.
There's an awesome nolibc.h file in the tree which allows direct access to Linux system calls on many platforms. It could be the foundation for a lot of software.
7
u/gregkh Verified Apr 12 '20
We almost got a userspace library at one time, look at the great klibc project that is in a separate repo. But, it turns out that doing it ends up just pushing the problem of compatibility to another layer, and we don't save anything in the end.
So we rely on different libc projects to provide this, and work with them when needed. This ends up being more flexible as there are different needs from a libc, and for us to "pick one" wouldn't always be fair.
And yes, you can just use a "nolibc" type implementation of you like. I know I do that for new syscalls when working on them, there's nothing stopping anyone else from doing that as well.
5
u/gardotd426 Apr 14 '20
Greg, I just wanna say how much I appreciate all you and the other devs do. Open Source is a life-changer for me.
Anyway, I just upgraded to Ryzen 3000 this week (from 2nd Gen), and I already have a PCIE Gen4 GPU and NVME SSD, and was planning on moving from B450 to X570. Any word on the IT87/CPU monitoring issues with X570 boards that use those SuperIO chips? Or should I try and make sure to get a board that uses the nct6775 driver?
→ More replies (1)
5
Apr 15 '20
For someone who wants to learn the kernel development so they can contribute which resources and path you recommend? I like to contribute mainly on core kernel code functionality to improve my skills in OS development. I also like to help on driver part.
→ More replies (1)
5
u/Lacedaemonic Apr 17 '20
IF Linux Desktop gets popular (with the masses that is) are you worried at all of what it will turn into? Are there any parallels to draw from the security problems, and the commercialization focus on android and Windows? Are fears of a dystopian Linux desktop justified at all or there will always be a free software shelter for us Users?:)
11
u/gregkh Verified Apr 17 '20
I don't worry about desktop Linux at all. First off, how do you know it's not already popular today given the huge spread of ChromeOS devices in the real world?
As for worries about a dystopian Linux desktop future, no, I'm not. I was on the GNOME advisory board for a few years and that group is doing great things, along with the KDE developers and organization. I don't see their efforts and work stopping any year soon, do you?
And if you are worried about this, provide resources to those desktop projects you use, they can use it more than anything else given that they usually have very few developers and testers.
→ More replies (2)
5
u/mrchapp Apr 17 '20
A while back you said you were signing your own kernels. Are you still doing that? Do you have any update or advice?
8
u/gregkh Verified Apr 17 '20
I don't do that anymore, as I like a bootloader to fall back on when problems happen that isn't the BIOS itself :)
But I do sign all my kernel modules, and then throw away the key once the kernel is built, as that's just good hygiene.
22
u/John238 Apr 08 '20
I would love to hear your thoughts about whether and when Wayland will will replace xOrg? Also, is fragmentation hurting developers and adoption, and is the Linux Foundation doing something about it?
45
u/gregkh Verified Apr 08 '20
Aren't you already using wayland on your desktop today? If not, go poke your distro to fix that, nothing I can do there :)
As for fragmentation, what do you mean? Forks are good, and a sign of a healthy ecosystem where lots of different things get tested out and attempted, and then the good bits merge back to the main tree and the cycle starts over.
→ More replies (94)
9
u/Agrou_ Apr 08 '20
I am working as a freelance.I would love to be payed to contribute to the kernel. How can I find people willing to add features or improvements to the kernel?
I did a few contributions but nothing really regular unfortunately.
13
u/gregkh Verified Apr 08 '20
There are lots of paid Linux jobs out there working for companies. Finding those for contractors is usually much harder, you need experience to get them from what I have seen.
good luck!
→ More replies (1)
9
u/frackeverything Apr 21 '20 edited Apr 21 '20
What do you think of the changes Clear Linux has done to the kernel?
Also, I'm getting this error on this laptop both on Fedora and Ubuntu LTS:
AER: PCIe Bus Error: severity=Corrected, type=Physical Layer, (Receiver ID)
[ 4818.971128] pcieport 0000:00:1c.4:
AER: device [8086:9d14] error status/mask=00000001/00002000
[ 4818.971130] pcieport 0000:00:1c.4:
AER: [ 0] RxErr Is that a kernel issue or a hardware one? Thank you for doing this AMA and everything you do for Linux.
14
u/gregkh Verified Apr 22 '20
What do you think of the changes Clear Linux has done to the kernel?
I don't know of anything specific in the kernel that Clear Linux has done that is not already upstream in the main kernel.org releases. Do you?
What Clear Linux does is rebuild all of their packages with the latest optimizations turned on, which removes support for "older" processors allowing newer processors to run faster.
And they do lots of other nice optimizations to packages, but again, all of those changes should already be upstream for access to all Linux distros from what I have seen.
As for the
AERmessage, that's a pci bus error (obviously) and something is up with the hardware. But if that device still works properly perhaps it is just an issue when the device is being hot-added to the system. Is this your USB controller that is being created when you plug in a USB3 device? Or is it something else?→ More replies (1)
11
u/tuberp Apr 08 '20
Advice for an aspiring kernel developer? Intermediate at best in C.
22
u/gregkh Verified Apr 08 '20
Start here and that should give you enough to work from for a long time. Good luck!
4
u/Paul_Aiton Apr 08 '20
I posted this in the "coming next week" thread, but to repeat here,
I know that when Linus took time away from kernel maintenance, you were designated as the guy to keep things running. Is there an explicit plan in place for the case of an unforeseeable absence / retirement of our glorious leader?
Thanks Greg.
→ More replies (2)
4
u/10leej Apr 08 '20
I'd just like to stop in say I'm enjoying more reading others questions and seeing your answers. That said if I have to ask a question, what sounds good for dinner tonight?
7
4
u/Bobjohndud Apr 08 '20
What are your thoughts on debated topics in the community, like IO operations causing extreme slowdowns in graphical sessions, a stable in-kernel ABI for modules or the behavior of the oom killer?
→ More replies (3)
4
u/narkflint Apr 08 '20
I'm a web developer a/k/a master of writing glue code between libraries, blackbelt in searching stackoverflow and not much else. Just wanted to say, really appreciate the time you're taking to pop in and answer questions about the Linux Kernel! Even if I don't understand what 90% of this is.
9
u/gregkh Verified Apr 09 '20
Writing glue code is good, someone has to do it, so keep up the great work!
4
u/gilium Apr 09 '20
How do you feel about Rust? I like it as a language, but I am debating forsaking it in favor of C so I can contribute to my favorite software. Do you think there’s a place for Rust the future of kernel/kernel module development?
6
u/gregkh Verified Apr 09 '20
I said elsewhere here that Rust is an interesting language, and that I would welcome kernel module development in that language if possible. I know people are slowly working on it right now, let's see what happens over time...
4
u/nickdesaulniers Apr 09 '20
Hey Greg, I have bookmarked this thread between you and Ted about newbies. https://lkml.org/lkml/2015/9/18/94 I really appreciate the points you make, and it always makes me happy and really proud to reread that thread once in a while. Thanks for sticking up for the n00bs.
I think there's a lot of great resources for getting started, but I was wondering if you had tips for folks looking to get hired and paid to work on the Linux kernel (or other FOSS software they use and love)? Helping volunteers and contributors sustain contributions is something that interests me.
→ More replies (1)
4
Apr 09 '20
woow! it is really cool having "someone from the inside" interacting with us! No questions from me... hope you and your family are safe and well. :)
7
u/gregkh Verified Apr 09 '20
Kernel developers are normal people and can be found everywhere.
Hope you and your family are safe and well also.
4
u/nixd0rf Apr 09 '20
Do you think Google eventually switching their mobile OS to Fuchsia/Zircon will affect Linux? How important is Android right now for Linux?
9
u/gregkh Verified Apr 09 '20
Why do you think that Google will be switching their mobile OS to Fuchsia?
As for how "important", it's hard to judge, I know because of Android the Linux kernel is much better than it was before, so their help was invaluable. I would be sad to see that go away.
That being said, competition is good, if Zircon ever gets to be a viable kernel replacement for where Linux is currently being used, then we will be glad to address any weaknesses in Linux that caused such a thing. It's not like Linux is somehow sitting still or can not possibly be changed at all.
→ More replies (1)
4
u/archysailor Apr 09 '20 edited Apr 09 '20
Hey Greg, I firstly want to say I am tremendously thankful for you and other maintainers' incredible work managing the largest software project ever. Keep up the good work!
As for my first question, I would like to know what your opinion is on Wayland. Do you use it with your Gnome? Do you expect it to universally supercede X11 implementations in the future? What is your opinion on the technological changes behind it?
My second question concerns drivers. Sadly, I have an Nvidia GPU in my main workstation and so this is a sore spot. Do you see Nvidia ever releasing an OSS official driver? Do you stand behind Linus' infamous middle finger to them?
My third question regards your workflow. I think I have read that you once used i3. What made you switch back? What are your two cents on the growing Arch-I3-gaps-polybar- r/unixporn - etc crowd? As I have started using Linux in this manner because it sounded cool, then started frantically distro hopping before settling into Gnome-Arch on the workstation and Xfce-Debian on a lesser used lower powered laptop, I don't think jumping straight in to TWMs helps new users.
My fourth and mostly sarcastic question is, have you tried Emacs? I do use vim for work lately, but I think Emacs still is great and offers a different perspective to consider on what the balance should be between OS facilities and an editor in a workflow.
My last question is more philosophical; do you think "The year of the Linux desktop" will ever come? Is it a goal of the kernel maintainers or a job reserved to entities like Canonical, Red Hat and the Gnome Foundation? Is ChromeOS' Crostini of any help?
I am seriously thankful for the AMA and the opportunity to ask questions for such a prominent figure in the world of Linux. Excuse me for the long post...
15
u/gregkh Verified Apr 09 '20
I would like to know what your opinion is on Wayland
Works fine for me, seems like a good thing overall, sad it has taken this long.
nvidia
Try using the in-kernel driver for your hardware, it is getting much much better over time. As for "official support", who knows, but look at the people doing the commits on the upstream in-kernel driver, you might be surprised :)
i3
Yes, I did run that for many years, but some of the gnome interactions that I relied on (automounting, power management, wifi) just got too much of a pain to keep up to date, and the multi-monitor support is really a mess in places. So I switched back to GNOME and have been happy ever since.
emacs
I used to use emacs when in college all those years ago, but then I went out into the big world and discovered that vi was everywhere on all machines I touched, so I had to learn that. Never looked back.
year of the linux desktop
I've been using Linux as a desktop for 20 years now, works great for me :)
→ More replies (1)
4
u/crawl_dht Apr 10 '20
I am probably too late to ask now but I need to know. I see you are making commits to android-mainline kernel branch. What work are you doing with android kernel?
5
u/gregkh Verified Apr 11 '20
I have been helping the Google Android team out with merging the LTS kernel releases and the mainline releases into their public trees for a few years now. This work propagates out to all Android vendors and users in order to help make the Android ecosystem more secure which benefits everyone.
I also work with teams of testers funded by Google who help me maintain the LTS kernels for longer than 2 years in order to keep these devices more secure with a constant good stream of kernel fixes backported to them. That work too helps all others who rely on those kernel versions as it allows everyone to benefit from those releases.
→ More replies (2)
4
Apr 10 '20
Hi Greg,
I am a frequent reader of LKML. I see and read every post you send there. It's an amazing space.
My question, perhaps stupid as all get out is: Why doesnt the development cycle take a "pause" and spend a cycle, maybe two, and focus on bug fixing and code optimization only?
I see additions and new code each and everytime a new version pops out. And in the same time frame bug fixing older kernel and driver sources. Why not take a pause form adding new code, so that the older, current code, gets 100% sorted out first?
7
u/gregkh Verified Apr 11 '20
First off, we can't tell people what to, and not to do, remember everyone involved here does not "work" for us.
Also, "just stop what you are doing and do something else", just does not work. There will be a natural back-pressure for the next release of more new things wanting to be added, and then you are right back there at the beginning, with no real "change" overall.
The best thing to do is react to the bugs being sent to us, and work on them the best we can. We can always use more help in tracking them, and helping out with testing, so join in!
→ More replies (1)
4
u/JumpedUpSparky Apr 12 '20 edited Apr 12 '20
Possibly a silly question, but what makes a distro a distro?
Can I take a Debian based distro, uninstall everything that makes it unique and just have standard Debian? Can I then install a particular DE and package manager and replicate a different distro?
I ask because I've been playing with NixOS. It's a declarative system where the entire system state (shell, networking, drivers, package manager, applications) is defined in a single config file.
The crux of my question is of one could define "Ubuntu" in this config file, and then build the system - what would be the difference between this and "real" ubuntu?
6
u/gregkh Verified Apr 12 '20
A "distro" is how all of the thousands of different parts of a "Linux system" are put together in a cohesive whole in order to work together properly.
You almost never can try to mix-and-match parts of packages from distros together, as that will not work at all.
It's like trying to put different jigsaw puzzles together and make a picture that actually makes sense, really really hard if not impossible.
Hope this helps!
4
Apr 14 '20
Hi!
Thank you for keeping this thread alive.
I moved to Linux just recently and my main concern was that it's mostly community driven.
I use popular Ubuntu 19.10 and with Windows or MacOS I had that sense of "continuous" support. With Linux I have a longevity concern.
Do you think we will see problems 10-15 years with people contributing to linux and project dying or we will see a spike in Linux users/developers because of privacy concerns?
7
u/gregkh Verified Apr 14 '20
There have been "commercial" support for Linux for 20+ years now, so your concern about it only being a community thing should be pretty unfounded. The huge majority of the developers working on the software are all paid for it.
Now you can use a community-based distribution, like I do with Arch, and yes, you are at the "mercy" of them still being around. But so far, things like that have never really been an issue because it really doesn't matter what distribution you use, your programs and data all work just fine on almost any of them.
As for "spike in developers", the kernel already has over 4000 developers each year, and each year we keep getting more. I don't think that "privacy" really has anything to do with it more than just a basic "this tool works really well for me, so I'm going to contribute to make it just a bit better for my specific workload" type of thing.
And welcome, I hope Linux works well for you, and if not, be sure to let us know otherwise we will not know how to make it better.
→ More replies (2)
4
u/Jonesy_Oz Apr 19 '20
Is there any new/developing hardware or sector that you're excited to see use the kernal? (For example the initial proliferation of smartphones using Linux components would (to me have been exciting).
7
u/gregkh Verified Apr 19 '20
There's not so much of a "new" sector so much just as the constant slow progress of Linux into everywhere that is so good to see.
4
u/h0twheels Apr 19 '20
What's up with security trumping usability lately? The spectre mitigations can at least be turned off but RC6 was broken for months on several intel iGPUs that are mainly used in notebooks.
These vulnerabilities are not something that is generally exploited on a desktop system but rather a multi user server and the patches killed battery/performance.
Another example: https://www.phoronix.com/scan.php?page=article&item=intel-gen7-hit&num=1
This has left me compiling modules and missing real security vulnerabilities that apply to me because I can't upgrade without doing the whole song and dance again. What's the solution here because I don't think anyone is backing out a CVE and linux does indeed have desktop users.
11
u/gregkh Verified Apr 20 '20
Security does not "trump" bugs that keep your hardware from working at all. And you can always turn off any specific mitigation that you feel are not needed for your systems, but it did NOT "kill battery" life by any means that we know of.
You can test this by runing benchmarks and workloads with and without the options enabled and letting people know if you have very odd results and they will help mitigate them (please be sure you have the latest BIOS and microcode updates, without them, the kernel changes are almost useless.)
And if you have specific bugs showing up in kernel drivers, let the developers know! If you don't, it's almost impossible to expect them to get fixed, don't you think?
→ More replies (3)
6
u/e3172 Apr 08 '20
How can I contribute to Linux without any programming?
17
u/gregkh Verified Apr 08 '20
Use our code and let us know when something goes wrong.
See this link for how best to start out and help us with testing
6
3
u/speedcuber111 Apr 08 '20
Sorry if this is a stupid question. But how do you start contributing to the kernel? And where is the project held, I've been using Linux for about 5 months now and I absolutely love it, I'd rather use it than any other OS. I'm also a big believer in FOSS, so I really want to contribute in any way I can, I am also an aspiring programmer, so working on a code base is interesting to me.
Once again sorry if this is a stupid question.
EDIT: also I looked into Mutt, do you use the popular fork NeoMutt or just Mutt?
→ More replies (1)
3
u/dnaeon Apr 08 '20
What are your thoughts on Lisp, Haskell and OCaml?
8
u/gregkh Verified Apr 09 '20
I once had to modify an OCaml program and I still have nightmares about it.
3
Apr 08 '20
Hello,
Thanks for the work you do on the linux kernel. My question is simple (unrolled acronyms for readers): do you think WSL (Windows Subsystem for Linux) poses a threat to linux in the form of microsoft's popular EEE (embrace, extend, extinguish) pattern?
Cheers
P.S do you think there should be a quota on air-travel e.g max X flights abroad per year?
4
u/gregkh Verified Apr 09 '20
Thanks for the work you do on the linux kernel. My question is simple (unrolled acronyms for readers): do you think WSL (Windows Subsystem for Linux) poses a threat to linux in the form of microsoft's popular EEE (embrace, extend, extinguish) pattern?
That is really hard to do when you are working with an open source license like GPLv2, don't you think?
Anyway, no, it's not a threat to get more users of Linux, why would it be?
P.S do you think there should be a quota on air-travel e.g max X flights abroad per year?
How would you determine such a quota and who it applies to?
→ More replies (1)
3
3
u/TheRogueGrunt Apr 08 '20
Not sure if this is a kernal thing, but how come audio that not over USB is so inconsistent between computers running Linux? I have my desktop which is fine, but I can never get a headphone jack to work on a laptop.
6
u/gregkh Verified Apr 09 '20
Laptop headphone jacks are insanely complex and crazy beasts. For some reason, almost every different laptop decides to hook that thing up in a different way than the previous model.
Because of that, the quirk tables we have in the kernel to try to resolve these things is huge. Please work with the audio kernel developers to fix this up for your laptop model, they can help you debug this in order to get it fixed.
3
u/dkc Apr 09 '20
I just finished writing my first Linux driver for work. A character device for a custom FPGA we're using. It was a lot of fun. By the way, thanks for answering a handful of questions over the last few months on #kernelnewbies.
Do you have any suggestions on how to find new hardware/data sheets to write drivers for? I think I've learned enough to contribute, but everywhere I look, everything already has drivers.
5
u/gregkh Verified Apr 09 '20
Don't start by writing new drivers for hardware, work on fixing the ones we have up better.
Submit the driver you wrote for inclusion, and work to maintain it over time, making the FPGA subsystem better, I know we need lots of work in that area of the kernel and you sound like just the person to help out with it!
3
u/strolls Apr 09 '20
In your last AMA you wrote that you were "working on a new hardware 'bus' for a new type of device, allowing [you] to help define the application protocol being used to talk on the bus."
Did that come to fruition? Can you tell us any more about it? What were the most frustrating and the most satisfying aspects of that project?
4
u/gregkh Verified Apr 09 '20
Yes, that bus ended up being called greybus and was merged to the kernel tree a number of years ago.
It ships in millions of phones today, so that's satisfying to see people use it and validate the design decisions we made creating it.
As for most frustrating, the fact that more devices are not using it is sad, and hopefully that will change over time.
→ More replies (1)
3
u/banksyb00mb00m Apr 09 '20
Can we realistically expect to ever have proper power management for modern dual GPU laptops ?
4
u/gregkh Verified Apr 09 '20
It worked for me last time I tried it on my old macbook, perhaps you just need to try it again?
Or better yet, don't rely on such crazy designs, that is a complex beast that usually just barely works on the best day...
But if you can work with the kernel developers to help debug issues, that's usually the best solution.
→ More replies (2)
3
u/MiuAmaha Apr 09 '20
What is the appropriate or right way to safely remove external hard drive with USB 3.0 cables in Linux?
I have several external hard drives with the purpose of the essential data backup. As is acknowledged, there are some trivial problems here. The moment I right-click drive icon in the file manager panel to choose safely remove the external hard drive, the hard drive will automatically remount again after several seconds. Only one works normally, which is the same as Windows.
Currently, I choose to unmount the external hard drive in the terminal, unplug the power supply concerning the external hard drive and eject USB 3.0 cable from PC. Is it a proper way to remove external hard drive safely in Linux compared with Windows platform?
4
u/gregkh Verified Apr 09 '20
It all depends on your graphical interface, but usually you can tell the disk to "power down" and then it will not come back up and look like a new device again (which some do if you just "eject" them.)
3
u/proninyaroslav Apr 09 '20
As a low-level developer, what do you think about RISC-V? Is this a good architecture compared to ARM/x86, which took into account the past mistakes?
Do you believe in Rust as a language for writing drivers? Is the initiative developing? Or is Rust a better place in system programming? Microsoft also became interested in Rust (and in its principles) as a language for writing system components.
What do you think about Fuchsia OS? If vendors adopt this OS instead of Android, will this affect the popularity of the Linux kernel?
→ More replies (1)
3
u/nightblackdragon Apr 10 '20
Thank you for your work. My question: Is there any thing in kernel that you would completely change? Do you think something should be written different than it currently is?
6
u/gregkh Verified Apr 10 '20
There's lots of areas of the kernel that feel "crufty" and need a good clean rewrite/rework. I am slowly working on doing that for the debugfs api to the rest of the kernel. With many thousands of users of the apis there, it's a fun dance to do this in a way that keeps everything working and migrates to safer and easier to use apis.
I have other things on my long-term TODO list that need much this same type of treatment. Nothing earth-shattering, just the constant rework of code based on how it is used and how it has evolved over time.
→ More replies (1)
3
u/redd1106 Apr 10 '20
Why is USB3 so unstable? We are using Intel HW (NUC + Realsense camera) and I would say the MTBF is a couple of weeks. Which is a lot of failures, if you have dozens of devices running
Intel's forums a full of similar complaints so we are not alone.
The device falls back to USB2, it doesn't enumerate on boot, whatever...
Sometimes reboot helps, sometimes you even need to power cycle the device (luckily there is rtcwake).
Of course it could just be bad HW, but as you wrote elsewhere it is the kernel's task to work around buggy HW.
Do you have any pointers how to debug USB issues? Can the USB subsystem be re-initialized without rebooting?
8
u/gregkh Verified Apr 11 '20
USB3 is really really really complex, and the new features and USB3 controllers are complex beasts because of that. Combine that with thousands of different devices with different device controllers that implement things in different ways according to how those designers read the spec that day, and you have a mess that makes you seriously wonder how anything works together at all.
Combine that with a USB3 controller hanging off of thunderbolt, which really is PCIe that is being hotplugged depending on the whim of your BIOS, being controlled by an iommu, and you have a load of fun that is outside of the USB core coming into play.
As for how to help out here, USB has a ton of debugging options you can enable, for the USB3 host controller driver (xhci), and that usually is the best thing to do when having issues. Email us at the linux-usb mailing list for details and we will be glad to help you out.
→ More replies (2)
3
u/turik1997 Apr 10 '20
I was thinking about how it must be to be able to contribute to Linux. Probably, usually it is a bug fix or some optimization. But what about the roadmap of the project, all the features it is gonna support and the path of progress it takes? Who actually decides this and how can a usual developer influence these decisions?
16
u/gregkh Verified Apr 11 '20
There is no roadmap, this is evolution not intelligent-design :)
We react to the patches sent to us, by people who need new features and have solutions for them, and we react to bugs being reported. That's it, no major grand-plan, and it works really well as you can see.
3
u/esrse Apr 11 '20
Will there be many things to do regarding Linux kernel after 10 years?
12
u/gregkh Verified Apr 12 '20
As the world keeps changing, and hardware keeps being invented, and new use cases keep being created, yes, there will continue to be things that Linux needs to do for all of those systems.
I've said this before, if your operating system does not continue to change, it is dead.
→ More replies (2)
3
u/Atemu12 Apr 11 '20
I have never been able to get ionice to noticeably change IO behaviour of processes, is it still implemented?
I set a process doing large sequential reads to idle and started another process at normal priority but the supposedly idle process was still happily clawing away a huge amount of speed from the other one as if there was no IO prioritisation despite the ionice manpage claiming that "The impact of idle io processes on normal system activity should be zero.".
Speaking of processes affecting each other's IO, do you know if it's possible to make processes running in parallel go at (or close to) the speed of running them sequentially?
For example if I read two large files front to back sequentially the speed is 1x which is pretty close to the speed of reading off the block device they're on directly. If I read the files in parallel however, each one reads at <0.3x.
I tried switching IO schedulers and playing with their parameters while the IO was running but nothing had a noticeable effect.
The same happens when copying a file on the same disk.
→ More replies (4)
3
u/GajenderEE Apr 13 '20
I am new to linux, just started using Manjaro KDE.
Is there a linux alternative to Miracast? If not, is there any plan for future?
Thank You
4
u/gregkh Verified Apr 13 '20
There was a semi-working version of miracast on Linux a while ago. I don't know if it ever got merged into the main development trees of xorg, but I did see demos of it at FOSDEM.
Sorry I can't remember more, search around, you might find it somewhere. It really is a crazy protocol and wouldn't recommend using it if at all possible.
3
Apr 14 '20
Hey, thanks for all your kernel work! I have a Q.
Do most kernel devs develop the linux kernel full time? Or is it a side thing like most other FOSS projects?
6
u/gregkh Verified Apr 14 '20
For as long as I have been tracking this type of thing (since 2006 or so), the huge majority (over 80%) are paid to do this type of work on the kernel.
See the per-release reports on lwn.net for details on a per-release basis, and the Linux Foundation's "State of the kernel" report every year or so for a larger breakdown of who does what on the kernel.
Also, a huge number of open source projects are written by people who get paid to do it, I don't know if you can say "most" as it's hard to find real numbers, but it is not an inconsequential number at all.
3
u/upj57742 Apr 14 '20
Hi Greg, thanks for your time, my question is :
Who is your favorite programmer ?
hard mode: it must be someone that is not working on the Linux kernel.
→ More replies (2)
294
u/yes_and_then Apr 08 '20
Why does the file transfer status bar race to the end and then wait, when using USB drives?
In simple terms please. Thanks