docs: add a text about regressions to the Linux kernel's documentation
Subsystems (3)
Thorsten Leemhuis
maintainerv3 cover docs: add a text about regressions to the Linux kernel's documentation
'We don't cause regressions' might be the first rule of Linux kernel development, but it and other aspects of regressions nevertheless are hardly described in the Linux kernel's documentation. The following two patches change this by creating a document dedicated to the topic.
The second patch could easily be folded into the first one, but was kept separate, as it might be a bit controversial. This also allows the patch description to explain some backgrounds for this part of the document. Additionally, ACKs and Reviewed-by tags can be collected separately this way.
v3 (this mail):
- drop RFC tag
- heavily reshuffled and slightly adjusted the text in the sections "The important bits for people fixing regressions" and "How to add a regression to regzbot's tracking somebody else reported?" to make them easier to grasp
- a few small fixes and improvements
- add ACK for the series from Greg (now for real)
v2/RFC (https://lore.kernel.org/linux-doc/[email protected]/):
- a lot of small fixes, most are for spelling mistakes and grammar errors/problems pointed out in the review feedback I got so far
- add ACK for the series from Greg
v1/RFC (https://lore.kernel.org/linux-doc/[email protected]/):
- initial version
---
Hi! Merge window is over, so I'd like to move on with this. Dropped the RFC tag; I had a small hope Linus would take a look at this (especially the second patch) before I remove it; well, didn't work out, but Greg ACKed it, which is good enough reason to move on with this. :-D
Ciao, Thorsten
Thorsten Leemhuis (2):
docs: add a document about regression handling
docs: regressions.rst: rules of thumb for handling regressions
Documentation/admin-guide/index.rst | 1 + Documentation/admin-guide/regressions.rst | 992 ++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 994 insertions(+) create mode 100644 Documentation/admin-guide/regressions.rst
base-commit: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
Signature · 1 line
2.31.1
Thorsten Leemhuis
maintainerPATCH v3 1/2 docs: add a document about regression handling
Create a document explaining various aspects around regression handling and tracking both for users and developers. Among others describe the first rule of Linux kernel development and what it means in practice. Also explain what a regression actually is and how to report one properly. The text additionally provides a brief introduction to the bot the kernel's regression tracker uses to facilitate his work. To sum things up, provide a few quotes from Linus to show how serious he takes regressions.
--- Documentation/admin-guide/index.rst | 1 + Documentation/admin-guide/regressions.rst | 911 ++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 913 insertions(+) create mode 100644 Documentation/admin-guide/regressions.rst
Documentation/admin-guide/index.rst +1 -0
@@ -36,6 +36,7 @@ problems and bugs in particular. reporting-issues security-bugs + regressions bug-hunting bug-bisect tainted-kernels
Documentation/admin-guide/regressions.rst new file +911 -0
911 lines not on this page · raw message
MAINTAINERS +1 -0
@@ -10438,6 +10438,7 @@ KERNEL REGRESSIONS M: Thorsten Leemhuis <[email protected]> L: [email protected] S: Supported +F: Documentation/admin-guide/regressions.rst KERNEL SELFTEST FRAMEWORK M: Shuah Khan <[email protected]>
Signature · 1 line
2.31.1
Jonathan Corbet
maintainerRe: [PATCH v3 1/2] docs: add a document about regression handling
Quoted 36 lines · Thorsten Leemhuis
Create a document explaining various aspects around regression handling and tracking both for users and developers. Among others describe the first rule of Linux kernel development and what it means in practice. Also explain what a regression actually is and how to report one properly. The text additionally provides a brief introduction to the bot the kernel's regression tracker uses to facilitate his work. To sum things up, provide a few quotes from Linus to show how serious he takes regressions.
Signed-off-by Thorsten Leemhuis <[email protected]>--- Documentation/admin-guide/index.rst | 1 + Documentation/admin-guide/regressions.rst | 911 ++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 913 insertions(+) create mode 100644 Documentation/admin-guide/regressions.rstDocumentation/admin-guide/index.rst +1
-0@@ -36,6 +36,7 @@ problems and bugs in particular. reporting-issues security-bugs + regressions bug-hunting bug-bisect tainted-kernelsDocumentation/admin-guide/regressions.rst new file +0
-0
Documentation/admin-guide/regressions.rst line 10
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0@@ -0,0 +1,911 @@ +.. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0) +.. + If you want to distribute this text under CC-BY-4.0 only, please use 'The + Linux kernel developers' for author attribution and link this as source: + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/admin-guide/regressions.rst +.. + Note: Only the content of this RST file as found in the Linux kernel sources + is available under CC-BY-4.0, as versions of this text that were processed + (for example by the kernel's build system) might contain content taken from + files which use a more restrictive license.
I wonder if we could put this boilerplate at the bottom, with a single "see the bottom for redistribution information" line here? Most readers won't care about this stuff and shouldn't have to slog through it to get to what they want to read.
Documentation/admin-guide/regressions.rst line 20
Quoted 8 lines
Documentation/admin-guide/regressions.rst new file +8
-0+Regressions ++++++++++++ + +The first rule of Linux kernel development: '*We don't cause regressions*'. +Linux founder and lead developer Linus Torvalds strictly enforces the rule +himself. This document describes what it means in practice and how the Linux +kernel's development model ensures all reported regressions are addressed. +The text covers aspects relevant for both users and developers.
So that last line makes me a bit nervous; I've really been trying to get us to organize our documentation for the readers. So, without having read what follows in depth yet, I wonder if we don't really want two different documents: a developer document (which maybe belongs in Documentation/process) and a user document?
Documentation/admin-guide/regressions.rst line 28
Quoted 7 lines
Documentation/admin-guide/regressions.rst new file +7
-0+The important bits for people affected by regressions +===================================================== + +It's a regression if something running fine with one Linux kernel works worse or +not at all with a newer version. Note, the newer kernel has to be compiled using +a similar configuration -- for this and other fine print, check out below +section "What is a 'regression' and what is the 'no regressions rule'?".
Can we be consistent with either single or double quotes? I'd suggest "double quotes" but won't make a fuss about that.
Documentation/admin-guide/regressions.rst line 31
Quoted 2 lines
Documentation/admin-guide/regressions.rst new file +2
-0+Report your regression as outlined in +`Documentation/admin-guide/reporting-issues.rst`, it already covers all aspects
No need to quote the file name.
Documentation/admin-guide/regressions.rst line 33
Quoted 2 lines
Documentation/admin-guide/regressions.rst new file +2
-0+important for regressions. Below section "How do I report a regression?" +highlights them for convenience.
The "How do I report a regression?" section, below, highlights...
Documentation/admin-guide/regressions.rst line 36
Quoted 2 lines
Documentation/admin-guide/regressions.rst new file +2
-0+The most important aspect: CC or forward the report to `the regression mailing +list <https://lore.kernel.org/regressions/>`_ ([email protected]).
Is that really *the* most important thing? :)
Quoted 12 lines
Documentation/admin-guide/regressions.rst new file +12
-0+When doing so, consider mentioning the version range where the regression +started using a paragraph like this:: + + #regzbot introduced v5.13..v5.14-rc1 + +The Linux kernel regression tracking bot 'regzbot' will then start to track the +issue. This is in your interest, as it brings the report on the radar of people +ensuring all regressions are acted upon in a timely manner. + +The important bits for people fixing regressions +================================================ +
Documentation/admin-guide/regressions.rst line 58
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+When submitting fixes for regressions, add "Link:" tags pointing to all places +where the issue was reported, as tools like the Linux kernel regression bot +'regzbot' heavily rely on them. These pointers are also of great value when +looking into the issue months or years later, that's why +`Documentation/process/submitting-patches.rst` and +:ref:`Documentation/process/5.Posting.rst <development_posting>` mandate their +use:: + + Link: https://lore.kernel.org/r/[email protected]/ + Link: https://bugzilla.kernel.org/show_bug.cgi?id=1234567890
What is this literal block here for?
Documentation/admin-guide/regressions.rst line 62
Quoted 3 lines
Documentation/admin-guide/regressions.rst new file +3
-0+Let the Linux kernel's regression tracker and all other subscribers of the +`regression mailing list <https://lore.kernel.org/regressions/>`_ +([email protected]) quickly know about newly reported regressions:
You've already linked this above, not sure it's needed again.
Quoted 29 lines
Documentation/admin-guide/regressions.rst new file +29
-0+ * When you receive a mailed report that did not CC the list, immediately send + at least a brief "Reply-all" which get the list into the loop; also ensure + it's CCed on all future replies. + + * If you get a report from a bug tracker, forward or bounce the report to the + list, unless the reporter did that already as outlined by + `Documentation/admin-guide/reporting-issues.rst`. + +Ensure regzbot tracks the issue (this is optional, but recommended): + + * For mailed reports, check if the reporter included a 'regzbot command' like + the ``#regzbot introduced v5.13..v5.14-rc1`` described above. If not, send a + reply (with the regressions list in CC) with a paragraph like the following, + which brings regzbot into the loop by specifying the version range or commit + when the issue started to happen:: + + #regzbot ^introduced 1f2e3d4c5b6a + + * When receiving a report from a bug tracker and forwarding it to the + regressions list (see above), include a paragraph like the following, which + brings regzbot into the loop by specifying the version range or commit when + the issue started to happen:: + + #regzbot introduced: v5.13..v5.14-rc1 + #regzbot from: Some N. Ice Human <[email protected]> + #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789 + +All the details on handling Linux kernel regressions +====================================================
Documentation/admin-guide/regressions.rst line 102
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+ +The important basics +-------------------- + +What is a 'regression' and what is the 'no regressions rule'? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's a regression if some application or practical use case running fine with +one Linux kernel works worse or not at all with a newer version compiled using a +similar configuration. The 'no regressions rule' forbids this to take place; if
So this is something you already said above. This document is quite long, we're asking a lot for people to read through the whole thing. Repeating yourself and making it longer may not help that cause.
Quoted 60 lines
Documentation/admin-guide/regressions.rst new file +60
-0+it happens by accident, developers that caused it are expected to quickly fix +the issue. + +It thus is a regression when a WiFi driver from Linux 5.13 works fine, but with +5.14 doesn't work at all, works significantly slower, or misbehaves somehow. +It's also a regression if a perfectly working application suddenly shows erratic +behavior with a newer kernel version, which can be caused by changes in procfs, +sysfs, or one of the many other interfaces Linux provides to userland software. +But keep in mind, as mentioned earlier: 5.14 in this example needs to be built +from a configuration similar to the one from 5.13. This can be achieved using +``make olddefconfig``, as explained in more detail below. + +Note the 'practical use case' in the first sentence of this section: developers +despite the 'no regressions' rule are free to change any aspect of the kernel +and even APIs or ABIs to userland, as long as no existing application or use +case breaks. + +Also be aware the 'no regressions' rule covers only interfaces the kernel +provides to the userland. It thus does not apply to kernel-internal interfaces +like the module API, which some externally developed drivers use to hook into +the kernel. + +What is the goal of the 'no regressions rule'? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Users should feel safe when updating kernel versions and not have to worry +something might break. This is in the interest of the kernel developers to make +updating attractive: they don't want users to stay on stable or longterm Linux +series that are either abandoned or more than one and a half year old. That's in +everybody's interest, as `those series might have known bugs, security issues, +or other problematic aspects already fixed in later versions +<http://www.kroah.com/log/blog/2018/08/24/what-stable-kernel-should-i-use/>`_. +Additionally, the kernel developers want to make it simple and appealing for +users to test the latest pre-release or regular release. That's also in +everybody's interest, as it's a lot easier to track down and fix problems, if +they are reported shortly after being introduced. + + +How hard is the rule enforced? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Extraordinarily strict, as can be seen by many mailing list posts from Linux +creator and lead developer Linus Torvalds, some of which are quoted at the end +of this document. + +Exceptions to this rule are extremely rare; in the past developers almost always +turned out to be wrong when they assumed a particular situation was warranting +an exception. + +How is the rule enforced? +~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's the duty of the subsystem maintainers, which are watched and supported by +Linus Torvalds for mainline or stable/longterm tree maintainers like Greg +Kroah-Hartman. All of them are supported by Thorsten Leemhuis: he's acting as +'regressions tracker' for the Linux kernel and trying to ensure all regression +reports are acted upon in a timely manner. + +The distributed and slightly unstructured nature of the Linux kernel's +development makes tracking regressions hard. That's why Thorsten relies on the
Documentation/admin-guide/regressions.rst line 172
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+help of his Linux kernel regression tracking robot 'regzbot'. It watches mailing +lists and git trees to semi-automatically associate regression reports with +patch submissions and commits fixing the issue, as this provides all necessary +insights into the fixing progress. + +Note, the regression tracker can only ensure no regression falls through the +cracks, if someone tells him or his bot about every regression found. That's why +each report needs to be CCed or forwarded to the regressions mailing list +(ideally with a 'regzbot command' in the mail), as explained in the next +section.
So this isn't really enforcement information, it's tracking, which is different... If you really want to talk about enforcement, you might mention that offending patches can be reverted if they are not fixed in a timely manner.
Quoted 36 lines
Documentation/admin-guide/regressions.rst new file +36
-0+How do I report a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Just report the issue as outlined in +`Documentation/admin-guide/reporting-issues.rst`, it already describes the +important points. The following aspects described there are especially relevant +for regressions: + + * When checking for existing reports to join, first check the `archives of the + Linux regressions mailing list <https://lore.kernel.org/regressions/>`_ and + `regzbot's web-interface <https://linux-regtracking.leemhuis.info/regzbot/>`_. + + * In your report, mention the last kernel version that worked fine and the + first broken one. Even better: try to find the commit causing the regression + using a bisection. + + * Remember to let the Linux regressions mailing list + ([email protected]) know about your report: + + * If you report the regression by mail, CC the regressions list. + + * If you report your regression to some bug tracker, forward the filed report + by mail to the regressions list while CCing the maintainer and the mailing + list for the subsystem in question. + +Additionally, you in both cases should directly tell the aforementioned Linux +kernel regression tracking bot about your report. To do that, include a +paragraph like this in your report to tell the bot when the regression started +to happen:: + + #regzbot introduced: v5.13..v5.14-rc1 + +In this example, v5.13 was the last version that worked, while v5.14-rc1 was the +first broken one. The smaller the range, the better, as that makes it easier to +find out what's wrong and who's responsible. That's why you ideally should +perform a bisection to find the commit causing the regression (the 'culprit').
Documentation/admin-guide/regressions.rst line 219
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+If you did, specify it instead:: + + #regzbot introduced: 1f2e3d4c5d + +Placing such a 'regzbot command' is in your interest, as it will ensure the +report won't fall through the cracks unnoticed. If you omit this, the Linux +kernel's regressions tracker will take care of telling regzbot about your +regression, as long as you send a copy to the regressions mailing lists. But the +regression tracker is just one human which sometimes has to rest or occasionally +might even enjoy some time away from computers (as crazy as that might sound).
Naw, we don't allow that, sorry :)
Quoted 42 lines
Documentation/admin-guide/regressions.rst new file +42
-0+Relying on this person thus will result in an unnecessary delay before the +regressions becomes mentioned `on the list of tracked and unresolved Linux +kernel regressions <https://linux-regtracking.leemhuis.info/regzbot/>`_ and the +weekly regression reports sent by regzbot. Such delays can result in Linus +Torvalds being unaware of important regressions when deciding between 'continue +development or call this finished and release the final?'. + +How to add a regression to regzbot's tracking somebody else reported? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It depends on the report: + + * If the regression was reported by mail, reply using your mailers 'Reply-all' + function with the regressions mailing list ([email protected]) in + CC. In your reply, include a paragraph with a regzbot command like this:: + + #regzbot ^introduced: v5.13..v5.14-rc1 + + The caret (^) before the 'introduced' tells regzbot to treat the parent mail + (the one you reply to) as the initial report for the regression you want to + see tracked; regzbot then will automatically associate any patches with this + regression that point to the report using 'Link:' tags. + + * If the regressions was reported to a bug tracker, forward it to the + regressions list and include a paragraph with these regzbot commands:: + + #regzbot introduced: v5.13..v5.14-rc1 + #regzbot from: Some N. Ice Human <[email protected]> + #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789 + + Regzbot will automatically associate patches with the report that use 'Link:' + tags pointing to your mail or the mentioned ticket. + +In both cases you can specify a commit-id instead of a version range, as the +previous section outlines in more detail. + +In case you are having trouble, simply forward the report or a pointer to it +without further ado to Thorsten Leemhuis ([email protected]), he then +will handle things. + +Are really all regressions fixed? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation/admin-guide/regressions.rst line 271
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+ +Nearly all of them are, as long as the change causing the regression (the +'culprit commit') is reliably identified. Some regressions can be fixed without +this, but often it's required. + +Who needs to find the commit causing a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's the reporter's duty to find the culprit, but developers of the affected +subsystem should offer advice and reasonably help where they can.
Is it really our policy that *reporters* need to find the offending commit? That's certainly not my view of things, anyway?
Quoted 12 lines
Documentation/admin-guide/regressions.rst new file +12
-0+How can I find the change causing a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Perform a bisection, as roughly outlined in `Documentation/admin-guide/reporting-issues.rst` +and described in more detail by `Documentation/admin-guide/bug-bisect.rst`. +It might sound like a lot of work, but in many cases finds the culprit +relatively quickly. If it's hard or time-consuming to reliably reproduce the +issue, consider teaming up with others affected by the problem to narrow down +the search range together. + +Who can I ask for advice when it comes to regressions? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation/admin-guide/regressions.rst line 294
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+ +Send a mail to the regressions mailing list ([email protected]) while +CCing the Linux kernel's regression tracker ([email protected]); if the +issue might better be dealt with in private, feel free to omit the list. + + +More details about regressions relevant for reporters +----------------------------------------------------- + +Does a regression need to be fixed, if it can be avoided by updating some other software?
It would be nice to keep to 80 columns if possible. These long section headings aren't great for readability.
Quoted 100 lines
Documentation/admin-guide/regressions.rst new file +100
-0+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Almost always: yes. If a developer tells you otherwise, ask the regression +tracker for advice as outlined above. + +Does it qualify as a regression if a newer kernel works slower or makes the system consume more energy? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It does, but the difference has to be significant. A five percent slow-down in a +micro-benchmark thus is unlikely to qualify as regression, unless it also +influences the results of a broad benchmark by more than one percent. If in +doubt, ask for advice. + +Is it a regression, if an externally developed kernel module is incompatible with a newer kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +No, as the 'no regression' rule is about interfaces and services the Linux +kernel provides to the userland. It thus does not cover building or running +externally developed kernel modules, as they run in kernel-space and hook into +the kernel using internal interfaces occasionally changed. + +How are regressions handled that are caused by a fix for security vulnerability? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In extremely rare situations security issues can't be fixed without causing +regressions; those are given way, as they are the lesser evil in the end. +Luckily this almost always can be avoided, as key developers for the affected +area and often Linus Torvalds himself try very hard to fix security issues +without causing regressions. + +If you nevertheless face such a case, check the mailing list archives if people +tried their best to avoid the regression; if in doubt, ask for advice as +outlined above. + +What happens if fixing a regression is impossible without causing another regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sadly these things happen, but luckily not very often; if they occur, expert +developers of the affected code area should look into the issue to find a fix +that avoids regressions or at least their impact. If you run into such a +situation, do what was outlined already for regressions caused by security +fixes: check earlier discussions if people already tried their best and ask for +advice if in doubt. + +A quick note while at it: these situations could be avoided, if people would +regularly give mainline pre-releases (say v5.15-rc1 or -rc3) from each cycle a +test run. This is best explained by imagining a change integrated between Linux +v5.14 and v5.15-rc1 which causes a regression, but at the same time is a hard +requirement for some other improvement applied for 5.15-rc1. All these changes +often can simply be reverted and the regression thus solved, if someone finds +and reports it before 5.15 is released. A few days or weeks later this solution +can become impossible, as some software might have started to rely on aspects +introduced by one of the follow-up changes: reverting all changes would then +cause a regression for users of said software and thus is out of the question. + +A feature I relied on was removed months ago, but I only noticed now. Does that qualify as regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It does, but often it's hard to fix them due to the aspects outlined in the +previous section. It hence needs to be dealt with on a case-by-case basis. This +is another reason why it's in everybody's interest to regularly test mainline +pre-releases. + +Does the 'no regression' rule apply if I seem to be the only person in the world that is affected by a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It does, but only for practical usage: the Linux developers want to be free to +remove support for hardware only to be found in attics and museums anymore. + +Note, sometimes regressions can't be avoided to make progress -- and the latter +is needed to prevent Linux from stagnation. Hence, if only very few users seem +to be affected by a regression, it for the greater good might be in their and +everyone else's interest to not insist on the rule. Especially if there is an +easy way to circumvent the regression somehow, for example by updating some +software or using a kernel parameter created just for this purpose. + +Does the regression rule apply for code in the staging tree as well? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Not according to the `help text for the configuration option covering all +staging code <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/Kconfig>`_, +which since its early days states:: + + Please note that these drivers are under heavy development, may or + may not work, and may contain userspace interfaces that most likely + will be changed in the near future. + +The staging developers nevertheless often adhere to the 'no regressions' rule, +but sometimes bend it to make progress. That's for example why some users had to +deal with (often negligible) regressions when a WiFi driver from the staging +tree was replaced by a totally different one written from scratch. + +Why do later versions have to be 'compiled with a similar configuration'? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Because the Linux kernel developers sometimes integrate changes known to cause +regressions, but make them optional and disable them in the kernel's default +configuration. This trick allows progress, as the 'no regressions' rule +otherwise would lead to stagnation. +
Documentation/admin-guide/regressions.rst line 404
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+Consider for example a new security feature blocking access to some kernel +interfaces often abused by malware, which at the same time are required to run a +few rarely used applications. The outlined approach makes both camps happy: +people using these applications can leave the new security feature off, while +everyone else can enable it without running into trouble. + +How to create a configuration similar to the one of an older kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Start a known-good kernel and configure the newer Linux version with ``make
Start *with* a ... ?
Quoted 49 lines
Documentation/admin-guide/regressions.rst new file +49
-0+olddefconfig``. This makes the kernel's build scripts pick up the configuration +file (the `.config` file) from the running kernel as base for the new one you +are about to compile; afterwards they set all new configuration options to their +default value, which should disable new features that might cause regressions. + +Can I report a regression to the upstream developers I found in a pre-compiled vanilla kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You need to ensure the newer kernel was compiled with a similar configuration +file as the older one (see above), as the one that built them might have enabled +some known-to-be incompatible feature for the newer kernel. If in a doubt, +report this problem to the kernel's provider and ask for advice. + + +More details about regressions relevant for developers +------------------------------------------------------ + +What should I do, if I suspect a change I'm working on might cause regressions? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Evaluate how big the risk of regressions is, for example by performing a code +search in Linux distributions and Git forges. Also consider asking other +developers or projects likely to be affected to evaluate or even test the +proposed change; if problems surface, maybe some middle ground acceptable for +all can be found. + +If the risk of regressions in the end seems to be relatively small, go ahead +with the change, but let all involved parties know about the risk. Hence, make +sure your patch description makes this aspect obvious. Once the change is +merged, tell the Linux kernel's regression tracker and the regressions mailing +list about the risk, so everyone has the change on the radar in case reports +trickle in. Depending on the risk, you also might want to ask the subsystem +maintainer to mention the issue in his mainline pull request. + + +Everything developers need to know about regression tracking +------------------------------------------------------------ + +Do I have to use regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's in the interest of everyone if you do, as kernel maintainers like Linus +Torvalds partly rely on regzbot's tracking in their work -- for example when +deciding to release a new version or extend the development phase. For this they +need to be aware of all unfixed regression; to do that, Linus is known to look +into the weekly reports sent by regzbot. + +Do I have to tell regzbot about every regression I stumble upon? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Documentation/admin-guide/regressions.rst line 463
Quoted 10 lines
Documentation/admin-guide/regressions.rst new file +10
-0+ +Ideally yes: we are all humans and easily forget problems when something more +important unexpectedly comes up -- for example a bigger problem in the Linux +kernel or something in real life that's keeping us away from keyboards for a +while. Hence, it's best to tell regzbot about every regression, except when you +immediately write a fix and commit it to a tree regularly merged to the affected +kernel series. + +Why does the Linux kernel need a regression tracker, and why does he utilize regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s/he/it/ (or "why is regzbot used?")
Quoted 4 lines
Documentation/admin-guide/regressions.rst new file +4
-0+Rules like 'no regressions' need someone to enforce them, otherwise they are +broken either accidentally or on purpose. History has shown that this is true +for the Linux kernel as well. That's why Thorsten volunteered to keep an eye on +things.
[...]
MAINTAINERS KERNEL REGRESSIONS · line 10444
Quoted 12 lines
MAINTAINERS +1
-0@@ -10438,6 +10438,7 @@ KERNEL REGRESSIONS M: Thorsten Leemhuis <[email protected]> L: [email protected] S: Supported +F: Documentation/admin-guide/regressions.rst KERNEL SELFTEST FRAMEWORK M: Shuah Khan <[email protected]>
OK, now that I'm at the end, I would like to suggest splitting this material up. Few people will make it through that whole thing... It seems to me that we need is:
- How to report and track a regression (admin guide probably)
- Regression sermon for developers including Linus quotes (process)
- Reference guide for regzbot directives (process or tools)
That should get each of them to a manageable length where readers will be able to get to the information they are looking for at the time. I would think this would mostly be a matter of hacking out pieces from the above and putting them in the proper place.
See what I'm getting at? Does that make sense to you?
Thanks,
jon
Thorsten Leemhuis
maintainerRe: [PATCH v3 1/2] docs: add a document about regression handling
Quoted 11 lines · Jonathan Corbet
Quoted 9 lines · Thorsten Leemhuis
Create a document explaining various aspects around regression handling and tracking both for users and developers. Among others describe the first rule of Linux kernel development and what it means in practice. Also explain what a regression actually is and how to report one properly. The text additionally provides a brief introduction to the bot the kernel's regression tracker uses to facilitate his work. To sum things up, provide a few quotes from Linus to show how serious he takes regressions.
Quoted 1 line
[...]
Many thx for your feedback, much appreciated. I trimmed the reply to not mention all the places where I fixed things as suggested.
Quoted 9 lines
Documentation/admin-guide/regressions.rst line 10
Quoted 4 lines
Documentation/admin-guide/regressions.rst new file +4
-0+ Note: Only the content of this RST file as found in the Linux kernel sources + is available under CC-BY-4.0, as versions of this text that were processed + (for example by the kernel's build system) might contain content taken from + files which use a more restrictive license.I wonder if we could put this boilerplate at the bottom, with a single "see the bottom for redistribution information" line here? Most readers won't care about this stuff and shouldn't have to slog through it to get to what they want to read.
Totally fine with me. When I touch reporting-issues.rst the next time I'll move it downwards as well.
Quoted 6 lines
Quoted 6 lines
Documentation/admin-guide/regressions.rst new file +6
-0+Regressions ++++++++++++ + +The first rule of Linux kernel development: '*We don't cause regressions*'. +Linux founder and lead developer Linus Torvalds strictly enforces the rule +himself. This document describes what it means in practice and how the Linux
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 20
Quoted 2 lines
Documentation/admin-guide/regressions.rst new file +2
-0+kernel's development model ensures all reported regressions are addressed. +The text covers aspects relevant for both users and developers.So that last line makes me a bit nervous; I've really been trying to get us to organize our documentation for the readers. So, without having read what follows in depth yet, I wonder if we don't really want two different documents: a developer document (which maybe belongs in
Documentation/process) and a user document?
Fun fact: I also got nervous when I added that sentence, as it lead to a similar thought in my head already. :-/ After some internal debate I decided that quite a few things overlap and continued to keep it in one document, but after the text grew somewhat more I guess I have to agree. More on this below.
Quoted 9 lines
Documentation/admin-guide/regressions.rst line 28
Quoted 7 lines
Documentation/admin-guide/regressions.rst new file +7
-0+The important bits for people affected by regressions +===================================================== + +It's a regression if something running fine with one Linux kernel works worse or +not at all with a newer version. Note, the newer kernel has to be compiled using +a similar configuration -- for this and other fine print, check out below +section "What is a 'regression' and what is the 'no regressions rule'?".Can we be consistent with either single or double quotes? I'd suggest "double quotes" but won't make a fuss about that.
Changed to "double quotes" everywhere in the text. But just to make sure I get things right: in this particular case this will result in
...section "What is a "regression" and what is the "no regressions rule"?".
This looks a bit strange to me. Something in me really would like to quote the section's header in single quotes, but I guess grammar rules do not allow that, so whatever. :-D
Quoted 3 lines
Quoted 2 lines
+Report your regression as outlined in +
Documentation/admin-guide/reporting-issues.rst, it already covers all aspectsNo need to quote the file name.
Okay, I thought I had seen some commit or instructions that it's better to use them in this case, but my brain must have imagined it.
Quoted 4 lines
Quoted 4 lines
Documentation/admin-guide/regressions.rst new file +4
-0+When submitting fixes for regressions, add "Link:" tags pointing to all places +where the issue was reported, as tools like the Linux kernel regression bot +'regzbot' heavily rely on them. These pointers are also of great value when +looking into the issue months or years later, that's why
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 58
Quoted 6 lines
+
Documentation/process/submitting-patches.rstand +:ref:Documentation/process/5.Posting.rst <development_posting>mandate theirDocumentation/admin-guide/regressions.rst new file +4
-0+use:: + + Link: https://lore.kernel.org/r/[email protected]/ + Link: https://bugzilla.kernel.org/show_bug.cgi?id=1234567890What is this literal block here for?
It's meant as an example. Should I simply add a ", e.g. like this" after the "use"?
Quoted 4 lines
Documentation/admin-guide/regressions.rst line 62
Quoted 3 lines
Documentation/admin-guide/regressions.rst new file +3
-0+Let the Linux kernel's regression tracker and all other subscribers of the +`regression mailing list <https://lore.kernel.org/regressions/>`_ +([email protected]) quickly know about newly reported regressions:You've already linked this above, not sure it's needed again.
When I started this document I didn't mean it to be read from top to bottom and repeated some things. But with the split this will likely change somewhat.
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 102
Quoted 6 lines
Documentation/admin-guide/regressions.rst new file +6
-0+What is a 'regression' and what is the 'no regressions rule'? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's a regression if some application or practical use case running fine with +one Linux kernel works worse or not at all with a newer version compiled using a +similar configuration. The 'no regressions rule' forbids this to take place; ifSo this is something you already said above.
That above was more like a "TLDR", guess I'll call it that after splitting things up.
Quoted 18 lines
Quoted 18 lines
Documentation/admin-guide/regressions.rst new file +18
-0+How is the rule enforced? +~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's the duty of the subsystem maintainers, which are watched and supported by +Linus Torvalds for mainline or stable/longterm tree maintainers like Greg +Kroah-Hartman. All of them are supported by Thorsten Leemhuis: he's acting as +'regressions tracker' for the Linux kernel and trying to ensure all regression +reports are acted upon in a timely manner. + +The distributed and slightly unstructured nature of the Linux kernel's +development makes tracking regressions hard. That's why Thorsten relies on the +help of his Linux kernel regression tracking robot 'regzbot'. It watches mailing +lists and git trees to semi-automatically associate regression reports with +patch submissions and commits fixing the issue, as this provides all necessary +insights into the fixing progress. + +Note, the regression tracker can only ensure no regression falls through the +cracks, if someone tells him or his bot about every regression found. That's why
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 172
Quoted 3 lines
Documentation/admin-guide/regressions.rst new file +3
-0+each report needs to be CCed or forwarded to the regressions mailing list +(ideally with a 'regzbot command' in the mail), as explained in the next +section.So this isn't really enforcement information, it's tracking, which is different... If you really want to talk about enforcement, you might mention that offending patches can be reverted if they are not fixed in a timely manner.
Well, I'd say tracking is part of enforcing, but whatever, I see your point and will address it in the next version.
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 219
Quoted 6 lines
Documentation/admin-guide/regressions.rst new file +6
-0+Placing such a 'regzbot command' is in your interest, as it will ensure the +report won't fall through the cracks unnoticed. If you omit this, the Linux +kernel's regressions tracker will take care of telling regzbot about your +regression, as long as you send a copy to the regressions mailing lists. But the +regression tracker is just one human which sometimes has to rest or occasionally +might even enjoy some time away from computers (as crazy as that might sound).Naw, we don't allow that, sorry :)
:-D
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 271
Quoted 5 lines
Documentation/admin-guide/regressions.rst new file +5
-0+Who needs to find the commit causing a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's the reporter's duty to find the culprit, but developers of the affected +subsystem should offer advice and reasonably help where they can.Is it really our policy that *reporters* need to find the offending commit? That's certainly not my view of things, anyway?
Well, do we have something on that written down somewhere or a few quotes from Linus that might help to clarify things?
Anyway: I was not totally happy with it either, as I found the first part of the sentence to strong, and the second to soft. But I had trouble finding something better, maybe a native speaker could help out here. Maybe something along these lines?
``` The developers of the affected code area should try their best to identify what's causing the regression. But that might be impossible with reasonable effort, as quite a few regressions only occur in a particular environment (Linux distro, hardware, configuration, ...). That's why in the end it's often up to the reporter to locate the culprit; to make this easy, developers should offer advice and reasonably help where they can. ```
As that's what things boil down to in practice, don't they?
Quoted 7 lines
Documentation/admin-guide/regressions.rst line 294
Quoted 4 lines
Documentation/admin-guide/regressions.rst new file +4
-0+More details about regressions relevant for reporters +----------------------------------------------------- + +Does a regression need to be fixed, if it can be avoided by updating some other software?It would be nice to keep to 80 columns if possible. These long section headings aren't great for readability.
I know and already tried to keep them shorter, but I sometimes simply failed to do so. Thing is: more descriptive section IMHO make is easier to skim over the document and just read the sections one is interested in (kinda FAQ style). And that was my goal, as I don't expect many people to read the text from top to bottom in these interesting times. That's why I think the benefits outweigh the downsides in times where we even allow code to exceed the old 80 character limit when it makes sense.
I'll give it another shot to make them shorter, but I can't promise I'll manage -- as as you wrote "It would be *nice* to keep" I for now assume that's okay.
Quoted 5 lines
Documentation/admin-guide/regressions.rst line 404
Quoted 4 lines
Documentation/admin-guide/regressions.rst new file +4
-0+How to create a configuration similar to the one of an older kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Start a known-good kernel and configure the newer Linux version with ``makeStart *with* a ... ?
Hmmm. I went for "Start *your machine with* a" to make it really obvious what to start.
Quoted 8 lines
OK, now that I'm at the end, I would like to suggest splitting this material up. Few people will make it through that whole thing... It seems to me that we need is:
- How to report and track a regression (admin guide probably)
- Regression sermon for developers including Linus quotes (process)
- Reference guide for regzbot directives (process or tools)
Quoted 6 lines
That should get each of them to a manageable length where readers will be able to get to the information they are looking for at the time. I would think this would mostly be a matter of hacking out pieces from the above and putting them in the proper place.
See what I'm getting at? Does that make sense to you?
Sure, I as mentioned earlier, I had thought about this already.
But I'll try to avoid a separate document for regzbot as see how this works out. I fear splitting this off is a bad idea, as reporters otherwise need to look into too many documents for one task, as they already need to deal with reporting-issue.rst as well.
Thx again!
Ciao, Thorsten
Randy Dunlap
reviewerRe: [PATCH v3 1/2] docs: add a document about regression handling
Quoted 9 lines · Thorsten Leemhuis
Quoted 9 lines
Documentation/admin-guide/regressions.rst line 28
Quoted 7 lines
Documentation/admin-guide/regressions.rst new file +7
-0+The important bits for people affected by regressions +===================================================== + +It's a regression if something running fine with one Linux kernel works worse or +not at all with a newer version. Note, the newer kernel has to be compiled using +a similar configuration -- for this and other fine print, check out below +section "What is a 'regression' and what is the 'no regressions rule'?".Can we be consistent with either single or double quotes? I'd suggest "double quotes" but won't make a fuss about that.
Quoted 9 lines
Changed to "double quotes" everywhere in the text. But just to make sure I get things right: in this particular case this will result in
...section "What is a "regression" and what is the "no regressions rule"?".
This looks a bit strange to me. Something in me really would like to quote the section's header in single quotes, but I guess grammar rules do not allow that, so whatever. :-D
I think that it was correct with the mixed quotes. Using all double quotes here is confusing.
Signature · 1 line
~Randy
Thorsten Leemhuis
maintainerRe: [PATCH v3 1/2] docs: add a document about regression handling
In reply to Thorsten LeemhuisQuoted 9 lines · Thorsten Leemhuis
Quoted 7 lines · Jonathan Corbet
Quoted 4 lines · Thorsten Leemhuis
Documentation/admin-guide/regressions.rst new file +4
-0+ Note: Only the content of this RST file as found in the Linux kernel sources + is available under CC-BY-4.0, as versions of this text that were processed + (for example by the kernel's build system) might contain content taken from + files which use a more restrictive license.
Quoted 7 lines
Quoted 4 lines
I wonder if we could put this boilerplate at the bottom, with a single "see the bottom for redistribution information" line here? Most readers won't care about this stuff and shouldn't have to slog through it to get to what they want to read.
Totally fine with me. When I touch
reporting-issues.rstthe next time I'll move it downwards as well.
V4 will do that, as I added a patch to point from reporting-issues.rst to one of the two new documents.
Quoted 10 lines
Quoted 9 lines
Documentation/admin-guide/regressions.rst line 28
Quoted 7 lines
Documentation/admin-guide/regressions.rst new file +7
-0+The important bits for people affected by regressions +===================================================== + +It's a regression if something running fine with one Linux kernel works worse or +not at all with a newer version. Note, the newer kernel has to be compiled using +a similar configuration -- for this and other fine print, check out below +section "What is a 'regression' and what is the 'no regressions rule'?".Can we be consistent with either single or double quotes? I'd suggest "double quotes" but won't make a fuss about that.
Quoted 8 lines
Changed to "double quotes" everywhere in the text. But just to make sure I get things right: in this particular case this will result in
...section "What is a "regression" and what is the "no regressions rule"?".
This looks a bit strange to me. Something in me really would like to quote the section's header in single quotes, but I guess grammar rules do not allow that, so whatever. :-D
I changed something and now simply don't mentioned the section names to avoid this problem. After the split that's not strictly needed afaics.
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
+Report your regression as outlined in +
Documentation/admin-guide/reporting-issues.rst, it already covers all aspectsNo need to quote the file name.
Okay, I thought I had seen some commit or instructions that it's better to use them in this case, but my brain must have imagined it.
I noticed I quoted internal references in reporting-issues.rst quite often. IMHO it improves readability sometimes (it depends a lot on the title of the target document), as can be seen in this example:
``` If your kernel is tainted, study 'Documentation/admin-guide/tainted-kernels.rst' to find out why. [...] To find the change there is a process called 'bisection' which the document 'Documentation/admin-guide/bug-bisect.rst' describes in detail. ```
after processing to HTML looks like this:
``` If your kernel is tainted, study 'Tainted kernels' to find out why. [...] To find the change there is a process called ‘bisection’ which the document ‘Bisecting a bug’ describes in detail. ```
Sure, "Tainted kernels" and "Bisecting a bug" are links and hence displayed differently by the browser, but I think the quotes help. But YMMV.
I sooner or later hope to improve and fix a few things in reporting-issues.rst anyway. Let me know if I should take the opportunity to remove the single quotes then.
Quoted 8 lines
Quoted 8 lines
Documentation/admin-guide/regressions.rst line 271
Quoted 5 lines
Documentation/admin-guide/regressions.rst new file +5
-0+Who needs to find the commit causing a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's the reporter's duty to find the culprit, but developers of the affected +subsystem should offer advice and reasonably help where they can.Is it really our policy that *reporters* need to find the offending commit? That's certainly not my view of things, anyway?
BTW, I noticed reporting-issues.rst covers it like this:
Normally it's up to the reporter to track down the culprit, as maintainers often won't have the time or setup at hand to reproduce it themselves.
Quoted 7 lines
Well, do we have something on that written down somewhere or a few quotes from Linus that might help to clarify things?
Anyway: I was not totally happy with it either, as I found the first part of the sentence to strong, and the second to soft. But I had trouble finding something better, maybe a native speaker could help out here. Maybe something along these lines?
I plan to go with this now:
``` Who needs to find the root cause of a regression? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Developers of the affected code area should try to locate the culprit on their own. But for them that's often impossible to do with reasonable effort, as quite a lot of issues only occur in a particular environment outside the developer's reach -- for example, a specific hardware platform, firmware, Linux distro, system's configuration, or application. That's why in the end it's often up to the reporter to locate the culprit commit; sometimes users might even need to run additional tests afterwards to pinpoint the exact root cause. Developers should offer advice and reasonably help where they can, to make this process relatively easy and achievable for typical users. ```
Ciao, Thorsten
Re: [PATCH v3 1/2] docs: add a document about regression handling
In reply to Thorsten LeemhuisHi Thorsten,
Documentation/admin-guide/regressions.rst line 408
Quoted 8 lines · Thorsten Leemhuis
Documentation/admin-guide/regressions.rst new file +8
-0+How to create a configuration similar to the one of an older kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Start a known-good kernel and configure the newer Linux version with ``make +olddefconfig``. This makes the kernel's build scripts pick up the configuration +file (the `.config` file) from the running kernel as base for the new one you +are about to compile; afterwards they set all new configuration options to their +default value, which should disable new features that might cause regressions.
Doing so may actually cause mutations to appear in your .config when going back and forth (i.e. when bisecting), interfering with the bisection process.
To avoid that, I usually start bisecting with
"cp .config <src>/arch/<arch>/configs/bisect_defconfig", and use "make bisect_defconfig" in every bisection step. That way all steps are reproducible, and unaffected by config mutations.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Thorsten Leemhuis
maintainerRe: [PATCH v3 1/2] docs: add a document about regression handling
Hi! I noticed I forgot to reply here:
Quoted 13 lines · Geert Uytterhoeven
Documentation/admin-guide/regressions.rst line 408
Quoted 8 lines · Thorsten Leemhuis
Documentation/admin-guide/regressions.rst new file +8
-0+How to create a configuration similar to the one of an older kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Start a known-good kernel and configure the newer Linux version with ``make +olddefconfig``. This makes the kernel's build scripts pick up the configuration +file (the `.config` file) from the running kernel as base for the new one you +are about to compile; afterwards they set all new configuration options to their +default value, which should disable new features that might cause regressions.Doing so may actually cause mutations to appear in your .config when going back and forth (i.e. when bisecting), interfering with the bisection process.
Good point, I knew about this, but hadn't thought of this when writing the text.
Quoted 4 lines
To avoid that, I usually start bisecting with
"cp .config <src>/arch/<arch>/configs/bisect_defconfig", and use "makebisect_defconfig" in every bisection step. That way all steps are reproducible, and unaffected by config mutations.
That's a really cool trick, thx for mentioning it. But I think it's not needed in the text about regressions and instead better be mentioned in Documentation/admin-guide/bug-bisect.rst. I hope to sooner or later improve (rewrite?) that document anyway and will make sure to keep it in mind for that time.
I wonder if there is a way to make this work without messing in the source tree? Took a quick look at the sources. It seems to me that it's possible to "cp .config ~/working.config" and then using "make KBUILD_DEFCONFIG=~/working.config defconfig" at every bisection step. It seems to do the trick as well -- but I only tried briefly, so maybe I might have missed something.
Ciao, Thorsten
Thorsten Leemhuis
maintainerPATCH v3 2/2 docs: regressions.rst: rules of thumb for handling regressions
In reply to Thorsten LeemhuisAdd a section with a few rules of thumb about how quickly regressions should be fixed. They are written after studying the quotes from Linus found in the modified document and especially influenced by statements like "Users are literally the _only_ thing that matters" and "without users, your program is not a program, it's a pointless piece of code that you might as well throw away". The author interpreted those in perspective to how the various Linux kernel series are maintained and what those practices might mean for users running into a regression when updating.
That for example lead to the paragraph starting with "Aim to get fixes for regressions mainlined within one week after identifying the culprit, if the regression was introduced in a stable/longterm release or the devel cycle for the latest mainline release". This is a pretty high bar, but on the other hand needed to not leave users out in the cold for to long. This can quickly happen, as the previous stable series is normally stamped "End of Life" about three or four weeks after a new mainline release, which makes a lot of users switch during this timeframe. Any of them risk running into regressions not promptly fixed; even worse, once the previous stable series is EOLed for real, users that face a regression might be left with only three options:
(1) continue running an outdated and thus potentially insecure kernel version from an abandoned stable series
(2) run the kernel with the regression
(3) downgrade to an earlier longterm series still supported
This is better avoided, as (1) puts users and their data in danger, (2) will only be possible if it's a minor regression that doesn't interfere with booting or serious usage, and (3) might be regression itself or impossible on the particular machine, as some users will require drivers or features only introduced after the latest longterm series took of.
In the end this lead to the "Aim to fix regression within one week" part. It also is the reason for the "Try to resolve any regressions introduced in the current development cycle before its end.".
---
Hi! A lot of developers are doing a good job in fixing regressions, but I noticed it sometimes takes many weeks to get even simple fixes for regressions merged. Most of the time this is due to one of these factors:
* it takes a long time to get the fix ready, as some developers apparently don't prioritize work on fixing regressions
* fully developed fixes linger in git trees of maintainers for weeks, sometimes even without the fix being in linux-next
This afaics is especially a problem for regressions introduced in mainline, but only found after a recent release or a stable kernel series derived from it. Sometimes fixes for these regressions are even left lying around for weeks until the next merge window, which contributes to a huge pile of fixes getting backported to stable and longterm releases during or shortly after merge windows. Asking developers to speed things up rarely helped, as people have different options on how fast regression fixes need to be developed and merged upstream.
That's why it would be a great help to my work as regression tracker if we had some rough written down guidelines for handling regressions, as proposed by the patch below. I'm well aware that the text sets a pretty high bar. That's because I approached the problem primarily from the point of a user, as can be seen by the patch description.
The text added by this patch likely will lead to some discussions, that's why I submit it separately from the rest of the new document on regressions, which is found in patch 1/2; I also CCed Linus on this patch and hope they state his opinion or ACK is. In the end I can easily tone this down or write something totally different: that's totally fine for me, I'm mainly interested in having some expectations roughly documented to get everyone on the same page.
--- Documentation/admin-guide/regressions.rst | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+)
Documentation/admin-guide/regressions.rst +81 -0
@@ -46,6 +46,10 @@ ensuring all regressions are acted upon in a timely manner. The important bits for people fixing regressions ================================================ +Try to fix regressions quickly once the culprit has been identified; fixes for +most regressions should be merged within two weeks, but some need to be +addressed within two or three days. + When submitting fixes for regressions, add "Link:" tags pointing to all places where the issue was reported, as tools like the Linux kernel regression bot 'regzbot' heavily rely on them. These pointers are also of great value when
@@ -257,6 +261,83 @@ In case you are having trouble, simply forward the report or a pointer to it without further ado to Thorsten Leemhuis ([email protected]), he then will handle things. +How quickly should regressions be fixed? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Developers should fix any reported regression as quickly as possible, to provide +affected users with a solution in a timely manner and prevent more users from +running into the issue; nevertheless developers need to take enough time and +care to ensure regression fixes do not cause additional damage. + +In the end though, developers should give their best to prevent users from +running into situations where a regression leaves them only three options: 'run +a kernel with a regression that seriously impacts usage', 'continue running an +outdated and thus potentially insecure kernel version for more than two weeks +after a regression's culprit was identified', and 'downgrade to a still +supported kernel series that's missing required features'. + +How to realize this depends a lot on the situation. Here are a few rules of +thumb for developers, in order or importance: + + * Prioritize work on handling regression reports and fixing regression over all + other Linux kernel work, unless the latter concerns acute security issues or + bugs causing data loss or damage. + + * Always consider reverting the culprit commits and reapplying them later + together with necessary fixes, as this might be the least dangerous and + quickest way to fix a regression. + + * Try to resolve any regressions introduced in the current development before + its end. If you fear a fix might be too risky to apply only days before a new + mainline release, let Linus decide: submit the fix separately to him as soon + as possible with the explanation of the situation. He then can make a call + and postpone the release if necessary, for example if multiple such changes + show up in his inbox. + + * Address regressions in stable, longterm, or proper mainline releases with + more urgency than regressions in mainline pre-releases. That changes after + the release of the fifth pre-release, aka '-rc5': mainline then becomes as + important, to ensure all the improvements and fixes are ideally tested + together for at least one week before Linus releases a new mainline version. + + * Fix regressions within two or three days, if they are critical for some + reason -- for example, if the issue is likely to affect many users of the + kernel series in question on all or certain architectures. This thus includes + fixes for compile errors in mainline, as they otherwise might prevent + testers and continuous integration systems from doing their work. + + * Aim to merge regression fixes into mainline within one week after the culprit + was identified, if the regression was introduced in a stable/longterm release + or the development cycle for the latest mainline release (say v5.14). If + possible, try to address the issue even quicker, if the previous stable + series (v5.13.y) will be abandoned soon or already was stamped 'End-of-Life' + (EOL) -- this usually happens about three to four weeks after a new mainline + release. + + * Try to fix all other regressions within two weeks after the culprit was + found. Two or three additional weeks are acceptable for performance + regressions and other issues which are annoying, but don't prevent anyone + from running Linux (unless it's an issue in the current development cycle, + as those should ideally be addressed before the release). A few weeks in + total are acceptable if a regression can only be fixed with a risky change + and at the same time is affecting only a few users; as much time is + also okay if the regression is already present in the second newest longterm + kernel series. + +Note: The aforementioned time frames for resolving regressions are meant to +include getting the fix tested, reviewed, and merged into mainline, ideally with +the fix being in linux-next for two days. + +Developers thus need to get their fixes finished earlier, as each of these steps +takes additional time. + +Subsystem maintainers are expected to assist in reaching those periods by doing +timely reviews and quick handling of accepted patches. They thus might have to +send git-pull requests earlier or more often than usual; depending on the fix, +it might even be acceptable to skip testing in linux-next. Especially fixes for +regressions in stable and longterm kernels need to be handled quickly, as fixes +need to be merged in mainline before they can be backported to older series. + Are really all regressions fixed? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
2.31.1