From nobody Sun Jun 28 02:48:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9E43C433FE for ; Wed, 16 Feb 2022 07:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbiBPHgY (ORCPT ); Wed, 16 Feb 2022 02:36:24 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:40278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiBPHgR (ORCPT ); Wed, 16 Feb 2022 02:36:17 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D685DD5DDC; Tue, 15 Feb 2022 23:36:01 -0800 (PST) Received: from ip4d144895.dynamic.kabel-deutschland.de ([77.20.72.149] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1nKEA4-00083j-Vi; Wed, 16 Feb 2022 07:51:37 +0100 From: Thorsten Leemhuis To: linux-doc@vger.kernel.org, Linus Torvalds , Greg Kroah-Hartman Cc: workflows@vger.kernel.org, Linux Kernel Mailing List , Jonathan Corbet , Randy Dunlap , regressions@lists.linux.dev, Lukas Bulwahn Subject: [PATCH v5 1/3] docs: add two documents about regression handling Date: Wed, 16 Feb 2022 07:51:33 +0100 Message-Id: <34e56d3588f22d7e0b4d635ef9c9c3b33ca4ac04.1644994117.git.linux@leemhuis.info> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1644996961;b07ce526; X-HE-SMSGID: 1nKEA4-00083j-Vi Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Create two documents explaining various aspects around regression handling and tracking; one is aimed at users, the other targets developers. The texts among others describes the first rule of Linux kernel development and what it means in practice. They also explain what a regression actually is and how to report one properly. Both texts additionally provide a brief introduction to the bot the kernel's regression tracker uses to facilitate the work, but mention the use is optional. To sum things up, provide a few quotes from Linus in the document for developers to show how serious we take regressions. Signed-off-by: Thorsten Leemhuis --- Documentation/admin-guide/index.rst | 1 + .../admin-guide/reporting-regressions.rst | 439 ++++++++++++ .../process/handling-regressions.rst | 659 ++++++++++++++++++ Documentation/process/index.rst | 1 + MAINTAINERS | 2 + 5 files changed, 1102 insertions(+) create mode 100644 Documentation/admin-guide/reporting-regressions.rst create mode 100644 Documentation/process/handling-regressions.rst diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guid= e/index.rst index 1bedab498104..5bfafcbb9562 100644 --- a/Documentation/admin-guide/index.rst +++ b/Documentation/admin-guide/index.rst @@ -35,6 +35,7 @@ problems and bugs in particular. :maxdepth: 1 =20 reporting-issues + reporting-regressions security-bugs bug-hunting bug-bisect diff --git a/Documentation/admin-guide/reporting-regressions.rst b/Document= ation/admin-guide/reporting-regressions.rst new file mode 100644 index 000000000000..6fbd24ceb3bf --- /dev/null +++ b/Documentation/admin-guide/reporting-regressions.rst @@ -0,0 +1,439 @@ +.. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0) +.. [see the bottom of this file for redistribution information] + +Reporting regressions ++++++++++++++++++++++ + +"*We don't cause regressions*" is the first rule of Linux kernel developme= nt; +Linux founder and lead developer Linus Torvalds established it himself and +ensures it's obeyed. + +This document describes what the rule means for users and how the Linux ke= rnel's +development model ensures to address all reported regressions; aspects rel= evant +for kernel developers are left to Documentation/process/handling-regressio= ns.rst. + + +The important bits (aka "TL;DR") +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D + +#. 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 co= mpiled + using a similar configuration; the detailed explanations below describe= s this + and other fine print in more detail. + +#. Report your issue as outlined in Documentation/admin-guide/reporting-is= sues.rst, + it already covers all aspects important for regressions and repeated + below for convenience. Two of them are important: start your report's s= ubject + with "[REGRESSION]" and CC or forward it to `the regression mailing list + `_ (regressions@lists.linux.dev). + +#. Optional, but recommended: when sending or forwarding your report, make= the + Linux kernel regression tracking bot "regzbot" track the issue by speci= fying + when the regression started like this:: + + #regzbot introduced v5.13..v5.14-rc1 + + +All the details on Linux kernel regressions relevant for users +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +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 w= ith +one Linux kernel works worse or not at all with a newer version compiled u= sing a +similar configuration. The "no regressions rule" forbids this to take plac= e; if +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 someho= w. +It's also a regression if a perfectly working application suddenly shows e= rratic +behavior with a newer kernel version; such issues can be caused by changes= in +procfs, sysfs, or one of the many other interfaces Linux provides to userl= and +software. But keep in mind, as mentioned earlier: 5.14 in this example nee= ds to +be built from a configuration similar to the one from 5.13. This can be ac= hieved +using ``make olddefconfig``, as explained in more detail below. + +Note the "practical use case" in the first sentence of this section: devel= opers +despite the "no regressions" rule are free to change any aspect of the ker= nel +and even APIs or ABIs to userland, as long as no existing application or u= se +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 interf= aces +like the module API, which some externally developed drivers use to hook i= nto +the kernel. + +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 outlined there are especially rele= vant +for regressions: + + * When checking for existing reports to join, also search the `archives o= f the + Linux regressions mailing list `_= and + `regzbot's web-interface `_. + + * Start your report's subject with "[REGRESSION]". + + * In your report, clearly mention the last kernel version that worked fin= e and + the first broken one. Ideally try to find the exact change causing the + regression using a bisection, as explained below in more detail. + + * Remember to let the Linux regressions mailing list + (regressions@lists.linux.dev) 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 submit= ted + report by mail to the regressions list while CCing the maintainer and= the + mailing list for the subsystem in question. + + If it's a regression within a stable or longterm series (e.g. + v5.15.3..v5.15.5), remember to CC the `Linux stable mailing list + `_ (stable@vger.kernel.org). + + In case you performed a successful bisection, add everyone to the CC the + culprit's commit message mentions in lines starting with "Signed-off-by:= ". + +When CCing for forwarding your report to the list, consider directly telli= ng the +aforementioned Linux kernel regression tracking bot about your report. To = do +that, include a paragraph like this in your mail:: + + #regzbot introduced: v5.13..v5.14-rc1 + +Regzbot will then consider your mail a report for a regression introduced = in the +specified version range. In above case Linux v5.13 still worked fine and L= inux +v5.14-rc1 was the first version where you encountered the issue. If you +performed a bisection to find the commit that caused the regression, speci= fy the +culprit's commit-id 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. B= ut the +regression tracker is just one human which sometimes has to rest or occasi= onally +might even enjoy some time away from computers (as crazy as that might sou= nd). +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 `_ an= d the +weekly regression reports sent by regzbot. Such delays can result in Linus +Torvalds being unaware of important regressions when deciding between "con= tinue +development or call this finished and release the final?". + +Are really all regressions fixed? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Nearly all of them are, as long as the change causing the regression (the +"culprit commit") is reliably identified. Some regressions can be fixed wi= thout +this, but often it's required. + +Who needs to find the root cause of a regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Developers of the affected code area should try to locate the culprit on t= heir +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 develop= er'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 u= p to +the reporter to locate the culprit commit; sometimes users might even need= to +run additional tests afterwards to pinpoint the exact root cause. Develope= rs +should offer advice and reasonably help where they can, to make this proce= ss +relatively easy and achievable for typical users. + +How can I find the culprit? +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Perform a bisection, as roughly outlined in +Documentation/admin-guide/reporting-issues.rst and described in more detai= l by +Documentation/admin-guide/bug-bisect.rst. It might sound like a lot of wor= k, 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 o= ther +affected users to narrow down the search range together. + +Who can I ask for advice when it comes to regressions? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Send a mail to the regressions mailing list (regressions@lists.linux.dev) = while +CCing the Linux kernel's regression tracker (regressions@leemhuis.info); i= f the +issue might better be dealt with in private, feel free to omit the list. + + +Additional details about regressions +------------------------------------ + + +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 L= inux +series that are either abandoned or more than one and a half years old. Th= at's +in everybody's interest, as `those series might have known bugs, security +issues, or other problematic aspects already fixed in later versions +`_. +Additionally, the kernel developers want to make it simple and appealing f= or +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. + +Is the "no regressions" rule really adhered in practice? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's taken really seriously, as can be seen by many mailing list posts from +Linux creator and lead developer Linus Torvalds, some of which are quoted = in +Documentation/process/handling-regressions.rst. + +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 warran= ting +an exception. + +Who ensures the "no regressions" is actually followed? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The subsystem maintainers should take care of that, which are watched and +supported by the tree maintainers -- e.g. Linus Torvalds for mainline and +Greg Kroah-Hartman et al. for various stable/longterm series. + +All of them are helped by people trying to ensure no regression report fal= ls +through the cracks. One of them is Thorsten Leemhuis, who's currently acti= ng as +the Linux kernel's "regressions tracker"; to facilitate this work he relie= s on +regzbot, the Linux kernel regression tracking bot. That's why you want to = bring +your report on the radar of these people by CCing or forwarding each repor= t to +the regressions mailing list, ideally with a "regzbot command" in your mai= l to +get it tracked immediately. + +Is it a regression, if the issue can be avoided by updating some software? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Almost always: yes. If a developer tells you otherwise, ask the regression +tracker for advice as outlined above. + +Is it a regression, if a newer kernel works slower or consumes more energy? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Yes, 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 external kernel module breaks when updating Linu= x? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~ + +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 security fixes? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In extremely rare situations security issues can't be fixed without causing +regressions; those fixes are given way, as they are the lesser evil in the= end. +Luckily this middling almost always can be avoided, as key developers for = the +affected area and often Linus Torvalds himself try very hard to fix securi= ty +issues without causing regressions. + +If you nevertheless face such a case, check the mailing list archives if p= eople +tried their best to avoid the regression. If not, report it; if in doubt, = ask +for advice as outlined above. + +What happens if fixing a regression is impossible without causing another? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Sadly these things happen, but luckily not very often; if they occur, expe= rt +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 as= k for +advice if in doubt. + +A quick note while at it: these situations could be avoided, if people wou= ld +regularly give mainline pre-releases (say v5.15-rc1 or -rc3) from each +development 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, bu= t 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 regressio= n thus +solved, if someone finds and reports it before 5.15 is released. A few day= s or +weeks later this solution can become impossible, as some software might ha= ve +started to rely on aspects introduced by one of the follow-up changes: rev= erting +all changes would then cause a regression for users of said software and t= hus is +out of the question. + +Is it a regression, if some feature I relied on was removed months ago? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is, but often it's hard to fix such regressions due to the aspects outl= ined +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 regularl= y test +mainline pre-releases. + +Does the "no regression" rule apply if I seem to be the only affected pers= on? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~ + +It does, but only for practical usage: the Linux developers want to be fre= e 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 l= atter +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 lettings things pass. 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 `_, +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" r= ule, +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 stagi= ng +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 c= ause +regressions, but make them optional and disable them in the kernel's defau= lt +configuration. This trick allows progress, as the "no regressions" rule +otherwise would lead to stagnation. + +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, wh= ile +everyone else can enable it without running into trouble. + +How to create a configuration similar to the one of an older kernel? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Start your machine with 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 fea= tures +that might cause regressions. + +Can I report a regression I found with pre-compiled vanilla kernels? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You need to ensure the newer kernel was compiled with a similar configurat= ion +file as the older one (see above), as those that built them might have ena= bled +some known-to-be incompatible feature for the newer kernel. If in doubt, r= eport +the matter to the kernel's provider and ask for advice. + + +More about regression tracking with "regzbot" +--------------------------------------------- + +What is regression tracking and why should I care about it? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Rules like "no regressions" need someone to ensure they are followed, othe= rwise +they are broken either accidentally or on purpose. History has shown this = to be +true for Linux kernel development as well. That's why Thorsten Leemhuis, t= he +Linux Kernel's regression tracker, and some people try to ensure all regre= ssion +are fixed by keeping an eye on them until they are resolved. Neither of th= em are +paid for this, that's why the work is done on a best effort basis. + +Why and how are Linux kernel regressions tracked using a bot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Tracking regressions completely manually has proven to be quite hard due t= o the +distributed and loosely structured nature of Linux kernel development proc= ess. +That's why the Linux kernel's regression tracker developed regzbot to faci= litate +the work, with the long term goal to automate regression tracking as much = as +possible for everyone involved. + +Regzbot works by watching for replies to reports of tracked regressions. +Additionally, it's looking out for posted or committed patches referencing= such +reports with "Link:" tags; replies to such patch postings are tracked as w= ell. +Combined this data provides good insights into the current state of the fi= xing +process. + +How to see which regressions regzbot tracks currently? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Check out `regzbot's web-interface `_. + +What kind of issues are supposed to be tracked by regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The bot is meant to track regressions, hence please don't involve regzbot = for +regular issues. But it's okay for the Linux kernel's regression tracker if= you +involve regzbot to track severe issues, like reports about hangs, corrupted +data, or internal errors (Panic, Oops, BUG(), warning, ...). + +How to change aspects of a tracked regression? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By using a 'regzbot command' in a direct or indirect reply to the mail wit= h the +report. The easiest way to do that: find the report in your "Sent" folder = or the +mailing list archive and reply to it using your mailer's "Reply-all" funct= ion. +In that mail, use one of the following commands in a stand-alone paragraph= (IOW: +use blank lines to separate one or multiple of these commands from the res= t of +the mail's text). + + * Update when the regression started to happen, for example after perform= ing a + bisection:: + + #regzbot introduced: 1f2e3d4c5d + + * Set or update the title:: + + #regzbot title: foo + + * Monitor a discussion or bugzilla.kernel.org ticket where additions aspe= cts of + the issue or a fix are discussed::: + + #regzbot monitor: https://lore.kernel.org/r/30th.anniversary.repost= @klaava.Helsinki.FI/ + #regzbot monitor: https://bugzilla.kernel.org/show_bug.cgi?id=3D123= 456789 + + * Point to a place with further details of interest, like a mailing list = post + or a ticket in a bug tracker that are slightly related, but about a dif= ferent + topic:: + + #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=3D123456= 789 + + * Mark a regression as invalid:: + + #regzbot invalid: wasn't a regression, problem has always existed + +Regzbot supports a few other commands primarily used by developers or peop= le +tracking regressions. They and more details about the aforementioned regzb= ot +commands can be found in the `getting started guide +`_= and +the `reference documentation `_ +for regzbot. + +.. + end-of-content +.. + This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top + of the file. 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/plai= n/Documentation/admin-guide/reporting-regressions.rst +.. + Note: Only the content of this RST file as found in the Linux kernel so= urces + is available under CC-BY-4.0, as versions of this text that were proces= sed + (for example by the kernel's build system) might contain content taken = from + files which use a more restrictive license. diff --git a/Documentation/process/handling-regressions.rst b/Documentation= /process/handling-regressions.rst new file mode 100644 index 000000000000..e1102a3207e3 --- /dev/null +++ b/Documentation/process/handling-regressions.rst @@ -0,0 +1,659 @@ +.. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0) +.. See the bottom of this file for additional redistribution information. + +Handling regressions +++++++++++++++++++++ + +*We don't cause regressions* -- this document describes what this "first r= ule of +Linux kernel development" means in practice for developers. It complements +Documentation/admin-guide/reporting-regressions.rst, which covers the topi= c from a +user's point of view; if you never read that text, go and at least skim ov= er it +before continuing here. + +The important bits (aka "The TL;DR") +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +#. Ensure subscribers of the `regression mailing list `_ + (regressions@lists.linux.dev) quickly become aware of any new regression + report: + + * When receiving a mailed report that did not CC the list, bring it in= to the + loop by immediately sending at least a brief "Reply-all" with the li= st + CCed. + + * Forward or bounce any reports submitted in bug trackers to the list. + +#. Make the Linux kernel regression tracking bot "regzbot" track the issue= (this + is optional, but recommended): + + * For mailed reports, check if the reporter included a line like ``#re= gzbot + introduced v5.13..v5.14-rc1``. If not, send a reply (with the regres= sions + list in CC) containing a paragraph like the following, which tells r= egzbot + when the issue started to happen:: + + #regzbot ^introduced 1f2e3d4c5b6a + + * When forwarding reports from a bug tracker to the regressions list (= see + above), include a paragraph like the following:: + + #regzbot introduced: v5.13..v5.14-rc1 + #regzbot from: Some N. Ice Human + #regzbot monitor: http://some.bugtracker.example.com/ticket?id=3D12= 3456789 + +#. When submitting fixes for regressions, add "Link:" tags to the patch + description pointing to all places where the issue was reported, as + mandated by Documentation/process/submitting-patches.rst and + :ref:`Documentation/process/5.Posting.rst `. + + +All the details on Linux kernel regressions relevant for developers +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + + +The important basics in more detail +----------------------------------- + + +What to do when receiving regression reports +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Ensure the Linux kernel's regression tracker and others subscribers of the +`regression mailing list `_ +(regressions@lists.linux.dev) become aware of any newly reported regressio= n: + + * When you receive a report by mail that did not CC the list, immediately= bring + it into the loop by sending at least a brief "Reply-all" with the list = CCed; + try to ensure it gets CCed again in case you reply to a reply that omit= ted + the list. + + * If a report submitted in a bug tracker hits your Inbox, forward or boun= ce it + to the list. Consider checking the list archives beforehand, if the rep= orter + already forwarded the report as instructed by + Documentation/admin-guide/reporting-issues.rst. + +When doing either, consider making the Linux kernel regression tracking bot +"regzbot" immediately start tracking the issue: + + * For mailed reports, check if the reporter included a "regzbot command" = like + ``#regzbot introduced 1f2e3d4c5b6a``. If not, send a reply (with the + regressions list in CC) with a paragraph like the following::: + + #regzbot ^introduced: v5.13..v5.14-rc1 + + This tells regzbot the version range in which the issue started to happ= en; + you can specify a range using commit-ids as well or state a single comm= it-id + in case the reporter bisected the culprit. + + Note the caret (^) before the "introduced": it tells regzbot to treat t= he + parent mail (the one you reply to) as the initial report for the regres= sion + you want to see tracked; that's important, as regzbot will later look o= ut + for patches with "Link:" tags pointing to the report in the archives on + lore.kernel.org. + + * When forwarding a regressions reported to a bug tracker, include a para= graph + with these regzbot commands:: + + #regzbot introduced: 1f2e3d4c5b6a + #regzbot from: Some N. Ice Human + #regzbot monitor: http://some.bugtracker.example.com/ticket?id=3D12= 3456789 + + Regzbot will then automatically associate patches with the report that + contain "Link:" tags pointing to your mail or the mentioned ticket. + +What's important when fixing regressions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You don't need to do anything special when submitting fixes for regression= , just +remember to do what Documentation/process/submitting-patches.rst, +:ref:`Documentation/process/5.Posting.rst `, and +Documentation/process/stable-kernel-rules.rst already explain in more deta= il: + + * Point to all places where the issue was reported using "Link:" tags:: + + Link: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Hels= inki.FI/ + Link: https://bugzilla.kernel.org/show_bug.cgi?id=3D1234567890 + + * Add a "Fixes:" tag to specify the commit causing the regression. + + * If the culprit was merged in an earlier development cycle, explicitly m= ark + the fix for backporting using the ``Cc: stable@vger.kernel.org`` tag. + +All this is expected from you and important when it comes to regression, as +these tags are of great value for everyone (you included) that might be lo= oking +into the issue weeks, months, or years later. These tags are also crucial = for +tools and scripts used by other kernel developers or Linux distributions; = one of +these tools is regzbot, which heavily relies on the "Link:" tags to associ= ate +reports for regression with changes resolving them. + + +More aspects regarding regressions developers should be aware of +---------------------------------------------------------------- + + +How to deal with changes where a risk of regression is known +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Evaluate how big the risk of regressions is, for example by performing a c= ode +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 solution acceptable for a= ll +can be found. + +If the risk of regressions in the end seems to be relatively small, go ahe= ad +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 mai= ling +list about the risk, so everyone has the change on the radar in case repor= ts +trickle in. Depending on the risk, you also might want to ask the subsystem +maintainer to mention the issue in his mainline pull request. + +What else is there to known about regressions? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Check out Documentation/admin-guide/reporting-regressions.rst, it covers a= lot +of other aspects you want might want to be aware of: + + * the purpose of the "no regressions rule" + + * what issues actually qualify as regression + + * who's in charge for finding the root cause of a regression + + * how to handle tricky situations, e.g. when a regression is caused by a + security fix or when fixing a regression might cause another one + +Whom to ask for advice when it comes to regressions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Send a mail to the regressions mailing list (regressions@lists.linux.dev) = while +CCing the Linux kernel's regression tracker (regressions@leemhuis.info); i= f the +issue might better be dealt with in private, feel free to omit the list. + + +More about regression tracking and regzbot +------------------------------------------ + + +Why the Linux kernel has a regression tracker, and why is regzbot used? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Rules like "no regressions" need someone to ensure they are followed, othe= rwise +they are broken either accidentally or on purpose. History has shown this = to be +true for the Linux kernel as well. That's why Thorsten Leemhuis volunteere= d to +keep an eye on things as the Linux kernel's regression tracker, who's +occasionally helped by other people. Neither of them are paid to do this, +that's why regression tracking is done on a best effort basis. + +Earlier attempts to manually track regressions have shown it's an exhausti= ng and +frustrating work, which is why they were abandoned after a while. To preve= nt +this from happening again, Thorsten developed regzbot to facilitate the wo= rk, +with the long term goal to automate regression tracking as much as possibl= e for +everyone involved. + +How does regression tracking work with regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The bot watches for replies to reports of tracked regressions. Additionall= y, +it's looking out for posted or committed patches referencing such reports +with "Link:" tags; replies to such patch postings are tracked as well. +Combined this data provides good insights into the current state of the fi= xing +process. + +Regzbot tries to do its job with as little overhead as possible for both +reporters and developers. In fact, only reporters are burdened with an ext= ra +duty: they need to tell regzbot about the regression report using the ``#r= egzbot +introduced`` command outlined above; if they don't do that, someone else c= an +take care of that using ``#regzbot ^introduced``. + +For developers there normally is no extra work involved, they just need to= make +sure to do something that was expected long before regzbot came to light: = add +"Link:" tags to the patch description pointing to all reports about the is= sue +fixed. + +Do I have to use regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's in the interest of everyone if you do, as kernel maintainers like Lin= us +Torvalds partly rely on regzbot's tracking in their work -- for example wh= en +deciding to release a new version or extend the development phase. For thi= s 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? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Ideally yes: we are all humans and easily forget problems when something m= ore +important unexpectedly comes up -- for example a bigger problem in the Lin= ux +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 whe= n you +immediately write a fix and commit it to a tree regularly merged to the af= fected +kernel series. + +How to see which regressions regzbot tracks currently? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Check `regzbot's web-interface `_ +for the latest info; alternatively, `search for the latest regression repo= rt +`_, +which regzbot normally sends out once a week on Sunday evening (UTC), whic= h is a +few hours before Linus usually publishes new (pre-)releases. + +What places is regzbot monitoring? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Regzbot is watching the most important Linux mailing lists as well as the = git +repositories of linux-next, mainline, and stable/longterm. + +What kind of issues are supposed to be tracked by regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The bot is meant to track regressions, hence please don't involve regzbot = for +regular issues. But it's okay for the Linux kernel's regression tracker if= you +use regzbot to track severe issues, like reports about hangs, corrupted da= ta, +or internal errors (Panic, Oops, BUG(), warning, ...). + +Can I add regressions found by CI systems to regzbot's tracking? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Feel free to do so, if the particular regression likely has impact on prac= tical +use cases and thus might be noticed by users; hence, please don't involve +regzbot for theoretical regressions unlikely to show themselves in real wo= rld +usage. + +How to interact with regzbot? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By using a 'regzbot command' in a direct or indirect reply to the mail wit= h the +regression report. These commands need to be in their own paragraph (IOW: = they +need to be separated from the rest of the mail using blank lines). + +One such command is ``#regzbot introduced ``, which mak= es +regzbot consider your mail as a regressions report added to the tracking, = as +already described above; ``#regzbot ^introduced `` is a= nother +such command, which makes regzbot consider the parent mail as a report for= a +regression which it starts to track. + +Once one of those two commands has been utilized, other regzbot commands c= an be +used in direct or indirect replies to the report. You can write them below= one +of the `introduced` commands or in replies to the mail that used one of th= em +or itself is a reply to that mail: + + * Set or update the title:: + + #regzbot title: foo + + * Monitor a discussion or bugzilla.kernel.org ticket where additions aspe= cts of + the issue or a fix are discussed -- for example the posting of a patch = fixing + the regression:: + + #regzbot monitor: https://lore.kernel.org/all/30th.anniversary.repo= st@klaava.Helsinki.FI/ + + Monitoring only works for lore.kernel.org and bugzilla.kernel.org; regz= bot + will consider all messages in that thread or ticket as related to the f= ixing + process. + + * Point to a place with further details of interest, like a mailing list = post + or a ticket in a bug tracker that are slightly related, but about a dif= ferent + topic:: + + #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=3D123456= 789 + + * Mark a regression as fixed by a commit that is heading upstream or alre= ady + landed:: + + #regzbot fixed-by: 1f2e3d4c5d + + * Mark a regression as a duplicate of another one already tracked by regz= bot:: + + #regzbot dup-of: https://lore.kernel.org/all/30th.anniversary.repos= t@klaava.Helsinki.FI/ + + * Mark a regression as invalid:: + + #regzbot invalid: wasn't a regression, problem has always existed + +Is there more to tell about regzbot and its commands? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +More detailed and up-to-date information about the Linux +kernel's regression tracking bot can be found on its +`project page `_, which among others +contains a `getting started guide `_ +and `reference documentation `_ +which both cover more details than the above section. + +Quotes from Linus about regression +---------------------------------- + +Find below a few real life examples of how Linus Torvalds expects regressi= ons to +be handled: + + * From `2017-10-26 (1/2) + `_:: + + If you break existing user space setups THAT IS A REGRESSION. + + It's not ok to say "but we'll fix the user space setup". + + Really. NOT OK. + + [...] + + The first rule is: + + - we don't cause regressions + + and the corollary is that when regressions *do* occur, we admit to + them and fix them, instead of blaming user space. + + The fact that you have apparently been denying the regression now f= or + three weeks means that I will revert, and I will stop pulling appar= mor + requests until the people involved understand how kernel development + is done. + + * From `2017-10-26 (2/2) + `_:: + + People should basically always feel like they can update their kern= el + and simply not have to worry about it. + + I refuse to introduce "you can only update the kernel if you also + update that other program" kind of limitations. If the kernel used = to + work for you, the rule is that it continues to work for you. + + There have been exceptions, but they are few and far between, and t= hey + generally have some major and fundamental reasons for having happen= ed, + that were basically entirely unavoidable, and people _tried_hard_ to + avoid them. Maybe we can't practically support the hardware any more + after it is decades old and nobody uses it with modern kernels any + more. Maybe there's a serious security issue with how we did things, + and people actually depended on that fundamentally broken model. Ma= ybe + there was some fundamental other breakage that just _had_ to have a + flag day for very core and fundamental reasons. + + And notice that this is very much about *breaking* peoples environm= ents. + + Behavioral changes happen, and maybe we don't even support some + feature any more. There's a number of fields in /proc//stat th= at + are printed out as zeroes, simply because they don't even *exist* in + the kernel any more, or because showing them was a mistake (typical= ly + an information leak). But the numbers got replaced by zeroes, so th= at + the code that used to parse the fields still works. The user might = not + see everything they used to see, and so behavior is clearly differe= nt, + but things still _work_, even if they might no longer show sensitive + (or no longer relevant) information. + + But if something actually breaks, then the change must get fixed or + reverted. And it gets fixed in the *kernel*. Not by saying "well, f= ix + your user space then". It was a kernel change that exposed the + problem, it needs to be the kernel that corrects for it, because we + have a "upgrade in place" model. We don't have a "upgrade with new + user space". + + And I seriously will refuse to take code from people who do not + understand and honor this very simple rule. + + This rule is also not going to change. + + And yes, I realize that the kernel is "special" in this respect. I'm + proud of it. + + I have seen, and can point to, lots of projects that go "We need to + break that use case in order to make progress" or "you relied on + undocumented behavior, it sucks to be you" or "there's a better way= to + do what you want to do, and you have to change to that new better + way", and I simply don't think that's acceptable outside of very ea= rly + alpha releases that have experimental users that know what they sig= ned + up for. The kernel hasn't been in that situation for the last two + decades. + + We do API breakage _inside_ the kernel all the time. We will fix + internal problems by saying "you now need to do XYZ", but then it's + about internal kernel API's, and the people who do that then also + obviously have to fix up all the in-kernel users of that API. Nobody + can say "I now broke the API you used, and now _you_ need to fix it + up". Whoever broke something gets to fix it too. + + And we simply do not break user space. + + * From `2020-05-21 + `_:: + + The rules about regressions have never been about any kind of + documented behavior, or where the code lives. + + The rules about regressions are always about "breaks user workflow". + + Users are literally the _only_ thing that matters. + + No amount of "you shouldn't have used this" or "that behavior was + undefined, it's your own fault your app broke" or "that used to work + simply because of a kernel bug" is at all relevant. + + Now, reality is never entirely black-and-white. So we've had things + like "serious security issue" etc that just forces us to make chang= es + that may break user space. But even then the rule is that we don't + really have other options that would allow things to continue. + + And obviously, if users take years to even notice that something + broke, or if we have sane ways to work around the breakage that + doesn't make for too much trouble for users (ie "ok, there are a + handful of users, and they can use a kernel command line to work + around it" kind of things) we've also been a bit less strict. + + But no, "that was documented to be broken" (whether it's because the + code was in staging or because the man-page said something else) is + irrelevant. If staging code is so useful that people end up using i= t, + that means that it's basically regular kernel code with a flag sayi= ng + "please clean this up". + + The other side of the coin is that people who talk about "API + stability" are entirely wrong. API's don't matter either. You can m= ake + any changes to an API you like - as long as nobody notices. + + Again, the regression rule is not about documentation, not about + API's, and not about the phase of the moon. + + It's entirely about "we caused problems for user space that used to= work". + + * From `2017-11-05 + `_:: + + And our regression rule has never been "behavior doesn't change". + That would mean that we could never make any changes at all. + + For example, we do things like add new error handling etc all the + time, which we then sometimes even add tests for in our kselftest + directory. + + So clearly behavior changes all the time and we don't consider that= a + regression per se. + + The rule for a regression for the kernel is that some real user + workflow breaks. Not some test. Not a "look, I used to be able to do + X, now I can't". + + * From `2018-08-03 + `_:: + + YOU ARE MISSING THE #1 KERNEL RULE. + + We do not regress, and we do not regress exactly because your are 1= 00% wrong. + + And the reason you state for your opinion is in fact exactly *WHY* = you + are wrong. + + Your "good reasons" are pure and utter garbage. + + The whole point of "we do not regress" is so that people can upgrade + the kernel and never have to worry about it. + + > Kernel had a bug which has been fixed + + That is *ENTIRELY* immaterial. + + Guys, whether something was buggy or not DOES NOT MATTER. + + Why? + + Bugs happen. That's a fact of life. Arguing that "we had to break + something because we were fixing a bug" is completely insane. We fix + tens of bugs every single day, thinking that "fixing a bug" means t= hat + we can break something is simply NOT TRUE. + + So bugs simply aren't even relevant to the discussion. They happen, + they get found, they get fixed, and it has nothing to do with "we + break users". + + Because the only thing that matters IS THE USER. + + How hard is that to understand? + + Anybody who uses "but it was buggy" as an argument is entirely miss= ing + the point. As far as the USER was concerned, it wasn't buggy - it + worked for him/her. + + Maybe it worked *because* the user had taken the bug into account, + maybe it worked because the user didn't notice - again, it doesn't + matter. It worked for the user. + + Breaking a user workflow for a "bug" is absolutely the WORST reason + for breakage you can imagine. + + It's basically saying "I took something that worked, and I broke it, + but now it's better". Do you not see how f*cking insane that statem= ent + is? + + And without users, your program is not a program, it's a pointless + piece of code that you might as well throw away. + + Seriously. This is *why* the #1 rule for kernel development is "we + don't break users". Because "I fixed a bug" is absolutely NOT AN + ARGUMENT if that bug fix broke a user setup. You actually introduce= d a + MUCH BIGGER bug by "fixing" something that the user clearly didn't + even care about. + + And dammit, we upgrade the kernel ALL THE TIME without upgrading any + other programs at all. It is absolutely required, because flag-days + and dependencies are horribly bad. + + And it is also required simply because I as a kernel developer do n= ot + upgrade random other tools that I don't even care about as I develop + the kernel, and I want any of my users to feel safe doing the same + time. + + So no. Your rule is COMPLETELY wrong. If you cannot upgrade a kernel + without upgrading some other random binary, then we have a problem. + + * From `2021-06-05 + `_:: + + THERE ARE NO VALID ARGUMENTS FOR REGRESSIONS. + + Honestly, security people need to understand that "not working" is = not + a success case of security. It's a failure case. + + Yes, "not working" may be secure. But security in that case is *poi= ntless*. + + * From `2011-05-06 (1/3) + `_:: + + Binary compatibility is more important. + + And if binaries don't use the interface to parse the format (or just + parse it wrongly - see the fairly recent example of adding uuid's to + /proc/self/mountinfo), then it's a regression. + + And regressions get reverted, unless there are security issues or + similar that makes us go "Oh Gods, we really have to break things". + + I don't understand why this simple logic is so hard for some kernel + developers to understand. Reality matters. Your personal wishes mat= ter + NOT AT ALL. + + If you made an interface that can be used without parsing the + interface description, then we're stuck with the interface. Theory + simply doesn't matter. + + You could help fix the tools, and try to avoid the compatibility + issues that way. There aren't that many of them. + + From `2011-05-06 (2/3) + `_:: + + it's clearly NOT an internal tracepoint. By definition. It's being + used by powertop. + + From `2011-05-06 (3/3) + `_:: + + We have programs that use that ABI and thus it's a regression if th= ey break. + + * From `2012-07-06 `_:: + + > Now this got me wondering if Debian _unstable_ actually qualifies= as a + > standard distro userspace. + + Oh, if the kernel breaks some standard user space, that counts. Tons + of people run Debian unstable + + * From `2019-09-15 + `_:: + + One _particularly_ last-minute revert is the top-most commit (ignor= ing + the version change itself) done just before the release, and while + it's very annoying, it's perhaps also instructive. + + What's instructive about it is that I reverted a commit that wasn't + actually buggy. In fact, it was doing exactly what it set out to do, + and did it very well. In fact it did it _so_ well that the much + improved IO patterns it caused then ended up revealing a user-visib= le + regression due to a real bug in a completely unrelated area. + + The actual details of that regression are not the reason I point th= at + revert out as instructive, though. It's more that it's an instructi= ve + example of what counts as a regression, and what the whole "no + regressions" kernel rule means. The reverted commit didn't change a= ny + API's, and it didn't introduce any new bugs. But it ended up exposi= ng + another problem, and as such caused a kernel upgrade to fail for a + user. So it got reverted. + + The point here being that we revert based on user-reported _behavio= r_, + not based on some "it changes the ABI" or "it caused a bug" concept. + The problem was really pre-existing, and it just didn't happen to + trigger before. The better IO patterns introduced by the change just + happened to expose an old bug, and people had grown to depend on the + previously benign behavior of that old issue. + + And never fear, we'll re-introduce the fix that improved on the IO + patterns once we've decided just how to handle the fact that we had= a + bad interaction with an interface that people had then just happened + to rely on incidental behavior for before. It's just that we'll have + to hash through how to do that (there are no less than three differ= ent + patches by three different developers being discussed, and there mi= ght + be more coming...). In the meantime, I reverted the thing that expo= sed + the problem to users for this release, even if I hope it will be + re-introduced (perhaps even backported as a stable patch) once we h= ave + consensus about the issue it exposed. + + Take-away from the whole thing: it's not about whether you change t= he + kernel-userspace ABI, or fix a bug, or about whether the old code + "should never have worked in the first place". It's about whether + something breaks existing users' workflow. + + Anyway, that was my little aside on the whole regression thing. Si= nce + it's that "first rule of kernel programming", I felt it is perhaps + worth just bringing it up every once in a while + +.. + end-of-content +.. + This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top + of the file. 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/plai= n/Documentation/process/handling-regressions.rst +.. + Note: Only the content of this RST file as found in the Linux kernel so= urces + is available under CC-BY-4.0, as versions of this text that were proces= sed + (for example by the kernel's build system) might contain content taken = from + files which use a more restrictive license. diff --git a/Documentation/process/index.rst b/Documentation/process/index.= rst index 9f1b88492bb3..428e39074f61 100644 --- a/Documentation/process/index.rst +++ b/Documentation/process/index.rst @@ -25,6 +25,7 @@ Below are the essential guides that every developer shoul= d read. code-of-conduct-interpretation development-process submitting-patches + handling-regressions programming-language coding-style maintainer-handbooks diff --git a/MAINTAINERS b/MAINTAINERS index ea3e6c914384..6c62f7e0dc9d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -10438,6 +10438,8 @@ KERNEL REGRESSIONS M: Thorsten Leemhuis L: regressions@lists.linux.dev S: Supported +F: Documentation/admin-guide/reporting-regressions.rst +F: Documentation/process/handling-regressions.rst =20 KERNEL SELFTEST FRAMEWORK M: Shuah Khan --=20 2.35.1 From nobody Sun Jun 28 02:48:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA9C9C433EF for ; Wed, 16 Feb 2022 07:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230184AbiBPHgP (ORCPT ); Wed, 16 Feb 2022 02:36:15 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:39672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiBPHgL (ORCPT ); Wed, 16 Feb 2022 02:36:11 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53DEA205D3; Tue, 15 Feb 2022 23:35:58 -0800 (PST) Received: from ip4d144895.dynamic.kabel-deutschland.de ([77.20.72.149] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1nKEA5-00083j-G7; Wed, 16 Feb 2022 07:51:37 +0100 From: Thorsten Leemhuis To: linux-doc@vger.kernel.org, Linus Torvalds , Greg Kroah-Hartman Cc: workflows@vger.kernel.org, Linux Kernel Mailing List , Jonathan Corbet , Randy Dunlap , regressions@lists.linux.dev, Lukas Bulwahn Subject: [PATCH v5 2/3] docs: *-regressions.rst: explain how quickly issues should be handled Date: Wed, 16 Feb 2022 07:51:34 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1644996958;9ea4acf0; X-HE-SMSGID: 1nKEA5-00083j-G7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a section with a few rules of thumb about how quickly developers should address regressions to Documentation/process/handling-regressions.rst; additionally, add a short paragraph about this to the companion document Documentation/admin-guide/reporting-regressions.rst as well. The rules of thumb were written after studying the quotes from Linus found in handling-regressions.rst 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 currently and what those practices might mean for users running into a regression on a small or big kernel update. 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". Some might see this as pretty high bar, but on the other hand something like that is needed to not leave users out in the cold for too long -- which can quickly happen when updating to the latest stable series, as the previous one is normally stamped "End of Life" about three or four weeks after a new mainline release. This makes a lot of users switch during this timeframe. Any of them thus 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 the users might require drivers or features only introduced after the latest longterm series branched of. In the end this lead to the aforementioned "Aim to fix regression within one week" part. It's also the reason for the "Try to resolve any regressions introduced in the current development cycle before its end.". Signed-off-by: Thorsten Leemhuis CC: Linus Torvalds Acked-by: Greg Kroah-Hartman Reviewed-by: Lukas Bulwahn --- Hi! A lot of developers are doing a good job in fixing regressions in a reasonable time span, 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 new versions was released and a new 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 after a merge window ended. Asking developers to speed things up rarely helped, as people have different opinions 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 documents on regressions, which are found in patch 1/3; I also CCed Linus on this patch and hope he states his opinion or even ACKs 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. Ciao, Thorsten --- .../admin-guide/reporting-regressions.rst | 12 +++ .../process/handling-regressions.rst | 87 +++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/Documentation/admin-guide/reporting-regressions.rst b/Document= ation/admin-guide/reporting-regressions.rst index 6fbd24ceb3bf..d8adccdae23f 100644 --- a/Documentation/admin-guide/reporting-regressions.rst +++ b/Documentation/admin-guide/reporting-regressions.rst @@ -214,6 +214,18 @@ your report on the radar of these people by CCing or f= orwarding each report to the regressions mailing list, ideally with a "regzbot command" in your mai= l to get it tracked immediately. =20 +How quickly are regressions normally fixed? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Developers should fix any reported regression as quickly as possible, to p= rovide +affected users with a solution in a timely manner and prevent more users f= rom +running into the issue; nevertheless developers need to take enough time a= nd +care to ensure regression fixes do not cause additional damage. + +The answer thus depends on various factors like the impact of a regression= , its +age, or the Linux series in which it occurs. In the end though, most regre= ssions +should be fixed within two weeks. + Is it a regression, if the issue can be avoided by updating some software? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 diff --git a/Documentation/process/handling-regressions.rst b/Documentation= /process/handling-regressions.rst index e1102a3207e3..abb741b1aeee 100644 --- a/Documentation/process/handling-regressions.rst +++ b/Documentation/process/handling-regressions.rst @@ -45,6 +45,10 @@ The important bits (aka "The TL;DR") mandated by Documentation/process/submitting-patches.rst and :ref:`Documentation/process/5.Posting.rst `. =20 +#. Try to fix regressions quickly once the culprit has been identified; fi= xes + for most regressions should be merged within two weeks, but some need t= o be + resolved within two or three days. + =20 All the details on Linux kernel regressions relevant for developers =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -125,6 +129,89 @@ tools and scripts used by other kernel developers or L= inux distributions; one of these tools is regzbot, which heavily relies on the "Link:" tags to associ= ate reports for regression with changes resolving them. =20 +Prioritize work on fixing regressions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You should fix any reported regression as quickly as possible, to provide +affected users with a solution in a timely manner and prevent more users f= rom +running into the issue; nevertheless developers need to take enough time a= nd +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 runnin= g an +outdated and thus potentially insecure kernel version for more than two we= eks +after a regression's culprit was identified", and "downgrade to a still +supported kernel series that lack required features". + +How to realize this depends a lot on the situation. Here are a few rules of +thumb for you, in order or importance: + + * Prioritize work on handling regression reports and fixing regression ov= er all + other Linux kernel work, unless the latter concerns acute security issu= es 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. + + * Developers should handle regressions in all supported kernel series, bu= t are + free to delegate the work to the stable team, if the issue probably at = no + point in time occurred with mainline. + + * Try to resolve any regressions introduced in the current development be= fore + 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 c= all + and postpone the release if necessary, for example if multiple such cha= nges + show up in his inbox. + + * Address regressions in stable, longterm, or proper mainline releases wi= th + more urgency than regressions in mainline pre-releases. That changes af= ter + 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 ver= sion. + + * 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 t= he + kernel series in question on all or certain architectures. Note, this + includes mainline, as issues like compile errors otherwise might preven= t many + testers or continuous integration systems from testing the series. + + * Aim to fix regressions within one week after the culprit was identified= , if + the issue was introduced in either: + + * a recent stable/longterm release + + * the development cycle of the latest proper mainline release + + In the latter case (say Linux v5.14), try to address regressions even + quicker, if the stable series for the predecessor (v5.13) will be aband= oned + 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 anyo= ne + from running Linux (unless it's an issue in the current development cyc= le, + 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 cha= nge + 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 lon= gterm + kernel series. + +Note: The aforementioned time frames for resolving regressions are meant to +include getting the fix tested, reviewed, and merged into mainline, ideall= y with +the fix being in linux-next at least briefly. This leads to delays you nee= d to +account for. + +Subsystem maintainers are expected to assist in reaching those periods by = doing +timely reviews and quick handling of accepted patches. They thus might hav= e 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 fixe= s 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 serie= s. + =20 More aspects regarding regressions developers should be aware of ---------------------------------------------------------------- --=20 2.35.1 From nobody Sun Jun 28 02:48:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBCAAC4332F for ; Wed, 16 Feb 2022 07:36:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230223AbiBPHhJ (ORCPT ); Wed, 16 Feb 2022 02:37:09 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:43862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbiBPHhH (ORCPT ); Wed, 16 Feb 2022 02:37:07 -0500 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8587F172884; Tue, 15 Feb 2022 23:36:17 -0800 (PST) Received: from ip4d144895.dynamic.kabel-deutschland.de ([77.20.72.149] helo=truhe.fritz.box); authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1nKEA6-00083j-Mr; Wed, 16 Feb 2022 07:51:38 +0100 From: Thorsten Leemhuis To: linux-doc@vger.kernel.org, Linus Torvalds , Greg Kroah-Hartman Cc: workflows@vger.kernel.org, Linux Kernel Mailing List , Jonathan Corbet , Randy Dunlap , regressions@lists.linux.dev, Lukas Bulwahn Subject: [PATCH v5 3/3] docs: reporting-issues.rst: link new document about regressions Date: Wed, 16 Feb 2022 07:51:35 +0100 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de;linux@leemhuis.info;1644996977;2c8732e0; X-HE-SMSGID: 1nKEA6-00083j-Mr Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Make Documentation/admin-guide/reporting-issues.rst point to the newly created document about regressions (Documentation/admin-guide/regressions-regressions.rst). This allows to shorten a few explanations the new document describes better and in more detail. While at it move the copyright hint to the end of the file and remove quotes around links to other places in the documentation. Both issues came up during the review of the new documents about regressions. Signed-off-by: Thorsten Leemhuis --- .../admin-guide/reporting-issues.rst | 73 +++++++++---------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/Documentation/admin-guide/reporting-issues.rst b/Documentation= /admin-guide/reporting-issues.rst index d7ac13f789cc..ec62151fe672 100644 --- a/Documentation/admin-guide/reporting-issues.rst +++ b/Documentation/admin-guide/reporting-issues.rst @@ -1,14 +1,5 @@ .. 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 'T= he - Linux kernel developers' for author attribution and link this as source: - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plai= n/Documentation/admin-guide/reporting-issues.rst -.. - Note: Only the content of this RST file as found in the Linux kernel so= urces - is available under CC-BY-4.0, as versions of this text that were proces= sed - (for example by the kernel's build system) might contain content taken = from - files which use a more restrictive license. - +.. See the bottom of this file for additional redistribution information. =20 Reporting issues ++++++++++++++++ @@ -395,22 +386,16 @@ fixed as soon as possible, hence there are 'issues of= high priority' that get handled slightly differently in the reporting process. Three type of cases qualify: regressions, security issues, and really severe problems. =20 -You deal with a 'regression' if something that worked with an older versio= n of -the Linux kernel does not work with a newer one or somehow works worse wit= h it. -It thus is a regression when a WiFi driver that did a fine job with Linux = 5.7 -somehow misbehaves with 5.8 or doesn't work at all. It's also a regression= if -an application shows erratic behavior with a newer kernel, which might hap= pen -due to incompatible changes in the interface between the kernel and the -userland (like procfs and sysfs). Significantly reduced performance or -increased power consumption also qualify as regression. But keep in mind: = the -new kernel needs to be built with a configuration that is similar to the o= ne -from the old kernel (see below how to achieve that). That's because the ke= rnel -developers sometimes can not avoid incompatibilities when implementing new -features; but to avoid regressions such features have to be enabled explic= itly -during build time configuration. +You deal with a regression if some application or practical use case runni= ng +fine with one Linux kernel works worse or not at all with a newer version +compiled using a similar configuration. The document +Documentation/admin-guide/reporting-regressions.rst explains this in more +detail. It also provides a good deal of other information about regression= s you +might want to be aware of; it for example explains how to add your issue t= o the +list of tracked regressions, to ensure it won't fall through the cracks. =20 What qualifies as security issue is left to your judgment. Consider reading -'Documentation/admin-guide/security-bugs.rst' before proceeding, as it +Documentation/admin-guide/security-bugs.rst before proceeding, as it provides additional details how to best handle security issues. =20 An issue is a 'really severe problem' when something totally unacceptably = bad @@ -517,7 +502,7 @@ line starting with 'CPU:'. It should end with 'Not tain= ted' if the kernel was not tainted when it noticed the problem; it was tainted if you see 'Tainte= d:' followed by a few spaces and some letters. =20 -If your kernel is tainted, study 'Documentation/admin-guide/tainted-kernel= s.rst' +If your kernel is tainted, study Documentation/admin-guide/tainted-kernels= .rst to find out why. Try to eliminate the reason. Often it's caused by one the= se three things: =20 @@ -1043,7 +1028,7 @@ down the culprit, as maintainers often won't have the= time or setup at hand to reproduce it themselves. =20 To find the change there is a process called 'bisection' which the document -'Documentation/admin-guide/bug-bisect.rst' describes in detail. That proce= ss +Documentation/admin-guide/bug-bisect.rst describes in detail. That process will often require you to build about ten to twenty kernel images, trying = to reproduce the issue with each of them before building the next. Yes, that = takes some time, but don't worry, it works a lot quicker than most people assume. @@ -1073,10 +1058,11 @@ When dealing with regressions make sure the issue y= ou face is really caused by the kernel and not by something else, as outlined above already. =20 In the whole process keep in mind: an issue only qualifies as regression i= f the -older and the newer kernel got built with a similar configuration. The bes= t way -to archive this: copy the configuration file (``.config``) from the old wo= rking -kernel freshly to each newer kernel version you try. Afterwards run ``make -olddefconfig`` to adjust it for the needs of the new version. +older and the newer kernel got built with a similar configuration. This ca= n be +achieved by using ``make olddefconfig``, as explained in more detail by +Documentation/admin-guide/reporting-regressions.rst; that document also +provides a good deal of other information about regressions you might want= to be +aware of. =20 =20 Write and send the report @@ -1283,7 +1269,7 @@ them when sending the report by mail. If you filed it= in a bug tracker, forward the report's text to these addresses; but on top of it put a small note wh= ere you mention that you filed it with a link to the ticket. =20 -See 'Documentation/admin-guide/security-bugs.rst' for more information. +See Documentation/admin-guide/security-bugs.rst for more information. =20 =20 Duties after the report went out @@ -1571,7 +1557,7 @@ Once your report is out your might get asked to do a = proper one, as it allows to pinpoint the exact change that causes the issue (which then can easily get reverted to fix the issue quickly). Hence consider to do a proper bisection right away if time permits. See the section 'Special care for regressions'= and -the document 'Documentation/admin-guide/bug-bisect.rst' for details how to +the document Documentation/admin-guide/bug-bisect.rst for details how to perform one. In case of a successful bisection add the author of the culpr= it to the recipients; also CC everyone in the signed-off-by chain, which you fin= d at the end of its commit message. @@ -1594,7 +1580,7 @@ Some fixes are too complex Even small and seemingly obvious code-changes sometimes introduce new and totally unexpected problems. The maintainers of the stable and longterm ke= rnels are very aware of that and thus only apply changes to these kernels that a= re -within rules outlined in 'Documentation/process/stable-kernel-rules.rst'. +within rules outlined in Documentation/process/stable-kernel-rules.rst. =20 Complex or risky changes for example do not qualify and thus only get appl= ied to mainline. Other fixes are easy to get backported to the newest stable a= nd @@ -1756,10 +1742,23 @@ art will lay some groundwork to improve the situati= on over time. =20 =20 .. - This text is maintained by Thorsten Leemhuis . If = you - spot a typo or small mistake, feel free to let him know directly and he= 'll - fix it. You are free to do the same in a mostly informal way if you want - to contribute changes to the text, but for copyright reasons please CC + end-of-content +.. + This document is maintained by Thorsten Leemhuis .= If + you spot a typo or small mistake, feel free to let him know directly and + he'll fix it. You are free to do the same in a mostly informal way if y= ou + want to contribute changes to the text, but for copyright reasons pleas= e CC linux-doc@vger.kernel.org and "sign-off" your contribution as Documentation/process/submitting-patches.rst outlines in the section "S= ign your work - the Developer's Certificate of Origin". +.. + This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top + of the file. 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/plai= n/Documentation/admin-guide/reporting-issues.rst +.. + Note: Only the content of this RST file as found in the Linux kernel so= urces + is available under CC-BY-4.0, as versions of this text that were proces= sed + (for example by the kernel's build system) might contain content taken = from + files which use a more restrictive license. --=20 2.35.1