|
|
Log in / Subscribe / Register

Best practices for linux-next

By Jonathan Corbet
December 12, 2025

Maintainers Summit
One of the key components in the kernel's development process is the linux-next repository. Every day, a large number of branches, each containing commits intended for the next kernel development cycle, is pulled into linux-next and integrated. If there are conflicts between branches, the linux-next process will reveal them. In theory, many other types of problems can be found as well. Some developers feel that linux-next does not work as well as it could, though. At the 2025 Maintainers Summit, Mark Brown, who helps to keep linux-next going, led a session on how it could be made to work more effectively.

[Mark Brown] The idea for the session, he said, began when he heard complaints about some types of "odd fixes" not appearing in linux-next before landing in the mainline. Maintainers may manage many branches, and some of those branches are not being pulled into linux-next. Additional problems come about when maintainers cherry-pick commits before sending them to the mainline, making it harder to track those commits as they appeared in linux-next. There is also, he said, one maintainer who refuses to put fixes into linux-next because he does not want them tested next to feature-oriented changes.

He asked the group whether more pressure should be applied to maintainers to put their repositories into linux-next. Nobody seemed to disagree with that idea.

Linus Torvalds had a different complaint: fixes that do get into linux-next, but then are not forwarded on to him for merging into the mainline. There are cases where the kernel has a known bug, there is a fix that is ready, but he does not have it.

Another problem for Torvalds is buggy patches that break linux-next for everybody, interfering with its primary purpose. He has repeatedly asked for problematic repositories to be simply removed from linux-next, and to be notified when that happens.

Steve Rostedt said that he will occasionally rebase his repositories that appear in linux-next, mostly to add tags to commits. That can have an effect similar to cherry-picking, where commits will change their IDs. Torvalds said that habit, too, can cause trouble in linux-next, but Brown said that rebasing is really only a problem if others have built on the repository that has been rebased. The most problematic tree when it comes to cherry-picking, he said, is the DRM (graphics) subsystem, which does extensive cherry-picking of patches. DRM maintainer Dave Airlie answered that the scale of that subsystem requires cherry-picking. All other subsystems have the same problems, he said, but they haven't yet gotten big enough to make that clear. He expressed willingness to have the assembled maintainers develop a better process for DRM, but did not believe that they could do it.

Torvalds repeated that he would like to see consequences when buggy commits break linux-next, that the guilty repository needs to be kicked out — at least temporarily. Once the relevant maintainer has acknowledged and fixed the problem, the repository would be allowed back in. If the problem is not fixed, though, then the repository should be kept out and not pulled during the next merge window.

Avoiding linux-next bugs

Ted Ts'o said that the filesystem developers had often run into problems testing linux-next, caused by bugs introduced by other subsystems. In response, linux-next maintainer Stephen Rothwell set up a process where the filesystem trees are pulled in first, and an fs-next tag is set once that process is is complete, before other repositories are pulled. That creates a sort of limited linux-next containing only filesystem trees and a few others that filesystem subsystems depend on, but without most of the rest of the work being done in the kernel community. Linux-next as a whole is too flaky, Ts'o said, but fs-next is useful for testing.

Arnd Bergmann said that all subsystems are not equal, and that handling the filesystem repositories first makes sense. The cost of mistakes in that area is especially high. Miguel Ojeda suggested a similar process for other higher-level subsystems, merging them into a side branch before merging the result into linux-next. That would create a sort of two-level process, integrating broad areas of the kernel before throwing everything together.

Airlie said that breaking linux-next (and mainline) around the rc1 release is expected, but breaking it every day is expensive. That leads to the wrong people finding problems, he said. Torvalds said that real development teams should be running continuous-integration testing on their own branches and only test linux-next occasionally. It is not reasonable, he said, to expect developers to debug problems introduced by other subsystems. The real problem, he added, is that some repositories clearly are not seeing any testing at all. That often happens with the smaller subsystems, he said, and linux-next is not really helping in this case.

Brown agreed that maintainers should care most about their own repositories, but said that it is still worthwhile to keep an eye on linux-next as a whole; that improves the chances that the culprit behind a problem will fix it before the buggy commit makes it into the mainline. Ojeda says that he has to test linux-next every day to find problems that affect the Rust build.

Brown asked about what tests could be run by linux-next itself to help with Rust problems, and got some ideas, but wondered about which specific configurations should be tested. Torvalds worried that, if some specific configurations are tested, others will only test with those, and he will still get "the weird bugs" that show up with other configurations. Ojeda said that he did not want people testing with canned configurations; rather, they should use their own and see which problems, in particular, appear.

Part of the problem, Airlie said, is that a lot of testing is done in continuous-integration systems, but nobody actually boots their laptop with their new code. So the parts of the system that actually show text on the screen aren't checked, and inevitably break.

Build problems

Jiri Kosina asked how the build problems that Torvalds encounters when pulling repositories happen, given that those repositories should already be pulled into linux-next and build-tested there. Torvalds answered that ordering issues are one source of problems; one repository will implicitly depend on commits in another, and the order in which linux-next pulls the repositories hides the problem. More often, though, Torvalds discovers that basic configurations just haven't been tested. He added that "allmodconfig" builds (which build the entire kernel as loadable modules) cause some code to be disabled, and can thus hide problems. As a result, there are some problems that he only encounters when he builds a kernel with his own personal configuration.

Ts'o expressed a concern that dropping repositories from linux-next would cause a loss of test coverage; it would be necessary, he said, to take that action in a public way. Torvalds said he would like to get an automatic email just before the merge window telling him which repositories have been disabled.

During the merge window, Torvalds said, he typically does about 30 merges each day. Build failures are relatively rare during this time; they will happen maybe two or three times during the merge window, but they are still annoying and unnecessary.

Jakub Kicinski said that he often finds merge conflicts before linux-next does, and wondered if he should send resolutions. Torvalds said that he doesn't look at conflict resolutions done by maintainers, at least not before he does the resolution himself. But having the resolution to check his work afterward can be helpful. He does depend on resolutions from others for conflicts in Rust code, where he is less confident of his own abilities.

At the end of the session, Rostedt asked how long maintainers should keep a bug fix in linux-next before sending it to Torvalds. The answer was that, if it is a bug that affects others, the fix should be sent before the next rc release — for obvious fixes, at least. If a fix is not obvious, though, more time should be taken to be sure that the fix is correct.

Index entries for this article
KernelDevelopment model/linux-next
Kernellinux-next
ConferenceKernel Maintainers Summit/2025


to post comments

On linux-next breakage

Posted Dec 15, 2025 9:39 UTC (Mon) by fratti-co (subscriber, #175548) [Link] (3 responses)

> Torvalds repeated that he would like to see consequences when buggy commits break linux-next, that the guilty repository needs to be kicked out — at least temporarily. Once the relevant maintainer has acknowledged and fixed the problem, the repository would be allowed back in. If the problem is not fixed, though, then the repository should be kept out and not pulled during the next merge window.

I'm with Torvalds here. There seems to be somewhat of an indifference by some subsystem maintainers towards them having broken linux-next, and adding some consequences for their actions would probably help with that. I have come across broken linux-next builds before because someone pulled in their co-workers patch series at v1 without compile-testing it. I've also seen people apply broken code, be told it's broken, and then say they'll fix it "next week" instead of backing out of the change immediately so that next day's linux-next is no longer causing massive amounts of kernel console spam that will make any system logging to anything but memory unhappy.

It's not that I expect production-level quality from linux-next, but it's somewhat annoying when every next tag that contains a change you want to base on also happens to not build or run because some other subsystem decided to make linux-next completely unusable for several days.

On linux-next breakage

Posted Dec 15, 2025 10:04 UTC (Mon) by sfr (subscriber, #7761) [Link] (2 responses)

There are already consequences. I use the version of the offending branch that was in the previous day's
linux-next. And keep doing that until it is fixed. I used to just drop it, but occassionally that had roll on effects
to later merges. It is very unusual for such a breakage to last more that a couple of days, and I can't remember
off the top of my head of such a breakage not being fixed before the merge window opens. I do not publish
a linux-next tree with a known build failure in it. That does not mean that there are no unknown build failures
as it is impossible to build for all configs on all architectures.

I have even, on occasson, reverted to using an old version of a branch when a failure is reported from other's
testing.

On linux-next breakage

Posted Dec 15, 2025 10:20 UTC (Mon) by fratti-co (subscriber, #175548) [Link] (1 responses)

What's the best way to report breakage to linux-next, as opposed to the subsystem maintainer? The build failure I have in mind in particular was likely overlooked because it was on arm64+clang. I don't recall how many days it took to disappear. Specifically, next-20251023 was broken because of the OPP subsystem, but I don't recall which precise commit it was.

On linux-next breakage

Posted Dec 16, 2025 1:37 UTC (Tue) by sfr (subscriber, #7761) [Link]

Email me (or Mark after January 16) and cc linux-next at vger.kernel.org

Does fs-next include dependencies?

Posted Dec 15, 2025 10:15 UTC (Mon) by taladar (subscriber, #68407) [Link] (1 responses)

I assume when you write that filesystem changes are pulled in first that is still after their dependencies? Or are they literally testing their changes with outdated dependencies only to avoid running into bugs in e.g. the memory and block systems?

Does fs-next include dependencies?

Posted Dec 16, 2025 1:44 UTC (Tue) by sfr (subscriber, #7761) [Link]

fs-next is created from just the fs related trees and is meant to be a reasonable base for
doing fs development. We will find conflicts with development in other subsystems when
the fs-next branch is later merged into linux-next itself (or when the other subsystem trees
are merged into linux-next later).

Build breakage in linux-next

Posted Dec 15, 2025 13:32 UTC (Mon) by error27 (subscriber, #8346) [Link] (3 responses)

Hardware companies should really be testing against linux-next. With the new EU CRA, everyone is going to have to upgrade their kernel a couple times. If you test linux-next, that's the earliest place to prevent breakage. I can understand Ted saying linux-next is too unstable for file system testing, but for testing boards it works fine. Everything in linux-next is being actively worked on, but by the time it reaches mainline a month later then the discussion is already stale.

Most of the problems in linux-next are build errors on less used architectures.

It sounds like complaining, but it's just objectively true that the number one cause of build breakage on x86 and arm was Rust. The Rust people should get a bunch of qemu images with common distributions and test for build breakage. Some times it's unavoidable that you have to upgrade your Rust packages but other times it was a kernel issue.

The other annoying thing is when you find a bug and the developer responds "Oops! I will fix it!" And you think they mean they will fix it the next day, but really they mean in a week. They should drop the patch immediately if it can't be fixed that same day.

Build breakage in linux-next

Posted Dec 15, 2025 14:54 UTC (Mon) by pizza (subscriber, #46) [Link] (2 responses)

> Hardware companies should really be testing against linux-next. With the new EU CRA, everyone is going to have to upgrade their kernel a couple times. If you test linux-next, that's the earliest place to prevent breakage.

No, as the article repeatedly states, linux-next is a horrible place for preventing arbitrary breakage, as you don't know if it's your code or someone else's that's responsible, and if something you care about breaks today on -next, tomorrow (or next week) it may just work with no action on your part.

Hardware companies (as in those shipping devices with Linux on it) are generally best off sticking with the latest LTS kernel at the time the product development was ongoing, because that gives them a reasonably static target. If their device lifecycle is longer than the LTS lifecycle, then they may need to rebase their work against a newer LTS kernel every couple of years.

Now if they wish to try to get stuff upstream that's going to require dealing with -next and random breakages that come from that as you independently work to get your various local changes into the appropriate subsystems, but nobody has the resources to rebase everything and then meaningfully QA the entire product every time -next changes. Remember, it's not enough to merely *compile*; you have to actually *boot* and *test* it!

I suppose it's worth distinguishing between "hardware == retail product" and "hardware == a peripheral/component"; Sticking with LTS makes the most sense for the former, but getting stuff upstream (and thus, dealing with -next) is a lot more relevant for the latter.

Build breakage in linux-next

Posted Dec 15, 2025 19:52 UTC (Mon) by error27 (subscriber, #8346) [Link]

I've been doing linux kernel testing on next, mainline, and LTS for the past couple years as part of my work. Bugs are easier to fix when you find them in linux-next.

Obviously, no one develops new drivers against linux-next. Kernel developers who work upstream just download an -rc kernel and work against that. There are people who don't care about upstream and they use LTS kernels, but I think it's going to be more and more difficult to ignore upstream with laws like the CRA. Products based on Android will need to go through several major kernel upgrades during their ten year life time. The more out of tree code, the more complicated each kernel upgrade becomes.

But I wasn't really talking about development, I was talking about hardware which are already supported by upstream and the vendor want to make sure it keeps working. The best tree to test against is linux-next. If that's not possible then you still want to be as close as reasonable to upstream.

Android has a tree which is updated within a couple weeks of when Linus releases a kernel. This is a good model. People think they are saving time by only upgrading once every other year instead of every eight weeks, but it's actually harder. When you upgrade regularly, then that's a smaller upgrade. You learn to be good at it. Also since everyone else is upgrading there is a built in support system if you have questions. But if you upgrade randomly after two years, no one will remember the old API or how it changed.

Build breakage in linux-next

Posted Dec 16, 2025 16:55 UTC (Tue) by broonie (subscriber, #7078) [Link]

It depends a lot what the objective of your testing is - shipping a product on -next is obviously silly, but if what you're doing is trying to ensure that what comes down the pipeline to your production systems is in reasonable shape then -next is a great place to do testing, you'll tend to catch things much closer to when they're introduced and therefore find it a lot easier to get things looked into. There's limits on what you'd want to test but it's valuable to pay attention. Similarly if what you're testing is functionality you use as opposed to functionality you write it doesn't really matter who introduced issues, you just want to find them and fix them.

For example I run testing of -next not so much because it's the thing I directly want to use but more because each merge window it turns into the baseline I'm testing against so if any of the boards or tests I rely on break then I'd much rather catch that while it's not impacting the testing I'm actually trying to do.


Copyright © 2025, 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