|
|
Subscribe / Log in / New account

The trouble with upstreaming

By Jonathan Corbet
September 27, 2021

Maintainers summit
The kernel development community loudly encourages developers to get their code into the upstream kernel. The actual experience of merging code into the mainline is often difficult, though, to the point that some developers (and their employers) simply give up on the idea. The 2021 Kernel Maintainers Summit spent some time discussing the ways in which the community makes things harder for developers without coming up with a lot of ways to make things better.

Upstreaming agony

Ted Ts'o started off the session by referring to a Kernel Summit talk held earlier in the week where a couple of Chrome OS developers reviewed their efforts to get closer to the mainline. He referred specifically to slide 10, titled "Upstreaming agony", from the presentation slide deck. That slide talks about how some maintainers are far more responsive than others, how some require massive unrelated changes, and more; "oh sure we can apply this two liner… *after* you rewrite the subsystem". This variability, Ts'o said, can be off-putting for new developers and can be the reason why many developers choose not to participate in the kernel community at all. What, he asked, can be done to improve this situation?

Linus Torvalds answered that there have been similar discussions at many maintainer gatherings; part of the problem is just that not all people are the same, but it is also true that subsystems are different from each other. The memory-management subsystem affects everything, he said, and will thus be harder to change than some random driver. We do have pain points, and some maintainers do make things too hard, but he doesn't see a productive way forward to solve the problem. "Naming and shaming" of problematic maintainers might help, he suggested.

Dave Airlie mentioned some of the the problems that vendors experience; bringing up a new system-on-chip (SoC) can involve upstreaming dozens of drivers, each of which has a different path — involving different acceptance criteria — into the mainline. That does not make things easy. Arnd Bergmann responded that, for Arm-based SoCs, there is a workaround to this problem in the form of his arm-soc tree. Drivers can go in via that path.

I could not resist the urge to point out that, in previous discussions on this topic, the group had decided to create a maintainer's handbook with subsystem profiles where each subsystem's quirks can be documented. The maintainers handbook exists now, but the section for subsystem profiles is nearly empty. So we still have almost no documentation to help patch submitters work with specific subsystems. Torvalds suggested going the other way, whereby developers would document their problems working with specific subsystems. Maintainers don't think about these things, he said, but patch submitters have no choice.

I expressed my lack of enthusiasm for the task of handling patches that add criticism of other maintainers.

Chris Mason reminded the group of the discussion at the end of the previous session, which touched on developers who are happier working within their companies than with the upstream community. Even people seen as core developers can feel that way. Getting code upstream is an uncertain process, Mason said; it makes the patches better, but at the cost of making life harder for developers. It would be good to find ways to add more certainty to the process. At the Monday discussion on folios, developer Matthew Wilcox said that he did not know which tests to run to show the performance impact of his work. When such a long-time core developer doesn't know that, we have done something wrong, Mason said.

Torvalds answered that, when it comes to memory management, there are no benchmarks, just "thousands of different things" that developers run. He mentioned the Phoronix benchmarks, saying that they have found a "ridiculous" number of problems. The benchmarks are not great, but what is great is that there is a person who follows up and is tracking performance over time. He gets annoyed at the syzbot tests, he said, because they are run on massive Intel machines that will show a performance regression just because a cache line moved. For performance testing, that is not hugely helpful. [Note that Torvalds said "syzbot", but it seems likely he meant to refer to the Intel 0day tests].

Al Viro added that a report of a regression is interesting, but even more interesting is the standard deviation of the results. He has seen many claims of improvement that, once one looks at the data, turn out to be "basically noise". Torvalds noted that the syzbot tests do at least provide the standard deviation with their results.

Thomas Gleixner said that the community can document formal criteria, but it's much harder to document expectations with regard to code design. The fact that there are different criteria in different areas makes that harder. And, in any case, people don't listen to that sort of guidance and just "cram things into corners". Mason asked if the tone of some of the guidance given to developers might make things harder; sometimes they can feel like they are getting beaten up all the way through the review process. Gleixner replied that he mostly asks questions, and he spends time explaining issues to inexperienced developers. He gives up, though, when dealing with ten-year veterans who won't listen. Mark Brown added that the community has discussed tone many times before; it often comes down to differences in culture.

At the close of this mostly inconclusive session, Ts'o brought back the point that many developers want to work outside of the community because it is easier. It is not always clear how to fix that; many areas that developers can work on affect a huge variety of users. It is easy to make a patch that works well for one workload but which trashes others. In large companies, developers are rewarded for solving that company's problems; the rewards for contributing back to the community and improving the kernel for everybody are harder to find. We would do well, he said, to find ways to point out and reward developers who have made the kernel generally better.

A common problem, he continued, is the case of the first developer for a new hardware feature being asked to make a new framework that works in the general case. The user interrupts patch set is currently experiencing that, he said; this is new Intel feature, but developers are asking how it will work for other architectures. That is a hard question to answer when other CPU manufactures haven't said whether or how they will make that feature available. We need to go easier on the first developer to a new area, he said.

At that point the room fell silent and the discussion moved on to the next topic.

Index entries for this article
ConferenceKernel Maintainers Summit/2021


to post comments

The trouble with upstreaming

Posted Sep 28, 2021 4:28 UTC (Tue) by alison (subscriber, #63752) [Link]

I'm glad to see kind words about Phoronix. While the contrast between LWN and Phoronix could not be starker in oh so many ways, it's true that both are essentially community-supported resources which we could not easily replace. When one takes the time to look past the noise at Phoronix, there's lots of useful information there about the BSDs as well as Linux.

"different acceptance criteria"

Posted Sep 28, 2021 19:43 UTC (Tue) by bnorris (subscriber, #92090) [Link] (1 responses)

> bringing up a new system-on-chip (SoC) can involve upstreaming dozens of drivers, each of which has a different path — involving different acceptance criteria — into the mainline. That does not make things easy. Arnd Bergmann responded that, for Arm-based SoCs, there is a workaround to this problem in the form of his arm-soc tree. Drivers can go in via that path.

Is that really true? I thought arm-soc was not for bypassing subsystem maintainers, when drivers already have a dedicated subsystem and maintainer. It may accept drivers when that makes sense (e.g., as part of bringing together additions to various subsystems, and DTS bits, and ...), but I thought it typically required subsystem maintainer ACK for that to happen.

Which means it doesn't solve the problem of "different acceptance criteria."

But I may be misunderstanding the current arm-soc practice or the claims being made.

"different acceptance criteria"

Posted Oct 2, 2021 23:16 UTC (Sat) by olof (subscriber, #11729) [Link]

Not having been in the room and heard the discussion firsthand: The SoC tree is not there to route around other maintainers, but we can help where there's no responsive maintainer that's engaging for some random aspect of new HW enablement. We do expect acks or reviews from external maintainers when code touches on their parts of the kernel.

The trouble with upstreaming

Posted Sep 29, 2021 16:06 UTC (Wed) by jsbarnes (guest, #4096) [Link]

It's (upstreaming) definitely not an easy problem to solve, but to reiterate from the talk, I think there are a few relatively easy things we can do to make it less onerous on contributors, namely:
- having clear communication on patches, i.e. actionable and reasonable (not yak shaving) feedback, clear acceptance criteria, good responsiveness to keep things moving
- clear tests & metrics; each subsystem should have some kind of test suite that contributors can run to ensure basic functionality, and/or a clear set of benchmarks to use to evaluate various aspects and make sure we don't regress
- enabling experimentation; this is a hard one, but ties into comments from the maintainer summit from Linus about trying things out and dropping them with lower overhead

This will probably all have to happen on a subsystem by subsystem basis, with maintainers leading the way. I have high hopes but low expectations here. :p


Copyright © 2021, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds