11ecf393fSThorsten Leemhuis.. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0) 21ecf393fSThorsten Leemhuis.. See the bottom of this file for additional redistribution information. 31ecf393fSThorsten Leemhuis 41ecf393fSThorsten LeemhuisHandling regressions 51ecf393fSThorsten Leemhuis++++++++++++++++++++ 61ecf393fSThorsten Leemhuis 71ecf393fSThorsten Leemhuis*We don't cause regressions* -- this document describes what this "first rule of 81ecf393fSThorsten LeemhuisLinux kernel development" means in practice for developers. It complements 91ecf393fSThorsten LeemhuisDocumentation/admin-guide/reporting-regressions.rst, which covers the topic from a 101ecf393fSThorsten Leemhuisuser's point of view; if you never read that text, go and at least skim over it 111ecf393fSThorsten Leemhuisbefore continuing here. 121ecf393fSThorsten Leemhuis 131ecf393fSThorsten LeemhuisThe important bits (aka "The TL;DR") 141ecf393fSThorsten Leemhuis==================================== 151ecf393fSThorsten Leemhuis 161ecf393fSThorsten Leemhuis#. Ensure subscribers of the `regression mailing list <https://lore.kernel.org/regressions/>`_ 171ecf393fSThorsten Leemhuis (regressions@lists.linux.dev) quickly become aware of any new regression 181ecf393fSThorsten Leemhuis report: 191ecf393fSThorsten Leemhuis 201ecf393fSThorsten Leemhuis * When receiving a mailed report that did not CC the list, bring it into the 211ecf393fSThorsten Leemhuis loop by immediately sending at least a brief "Reply-all" with the list 221ecf393fSThorsten Leemhuis CCed. 231ecf393fSThorsten Leemhuis 241ecf393fSThorsten Leemhuis * Forward or bounce any reports submitted in bug trackers to the list. 251ecf393fSThorsten Leemhuis 261ecf393fSThorsten Leemhuis#. Make the Linux kernel regression tracking bot "regzbot" track the issue (this 271ecf393fSThorsten Leemhuis is optional, but recommended): 281ecf393fSThorsten Leemhuis 291ecf393fSThorsten Leemhuis * For mailed reports, check if the reporter included a line like ``#regzbot 301ecf393fSThorsten Leemhuis introduced v5.13..v5.14-rc1``. If not, send a reply (with the regressions 311ecf393fSThorsten Leemhuis list in CC) containing a paragraph like the following, which tells regzbot 321ecf393fSThorsten Leemhuis when the issue started to happen:: 331ecf393fSThorsten Leemhuis 341ecf393fSThorsten Leemhuis #regzbot ^introduced 1f2e3d4c5b6a 351ecf393fSThorsten Leemhuis 361ecf393fSThorsten Leemhuis * When forwarding reports from a bug tracker to the regressions list (see 371ecf393fSThorsten Leemhuis above), include a paragraph like the following:: 381ecf393fSThorsten Leemhuis 391ecf393fSThorsten Leemhuis #regzbot introduced: v5.13..v5.14-rc1 401ecf393fSThorsten Leemhuis #regzbot from: Some N. Ice Human <some.human@example.com> 411ecf393fSThorsten Leemhuis #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789 421ecf393fSThorsten Leemhuis 431ecf393fSThorsten Leemhuis#. When submitting fixes for regressions, add "Link:" tags to the patch 441ecf393fSThorsten Leemhuis description pointing to all places where the issue was reported, as 451ecf393fSThorsten Leemhuis mandated by Documentation/process/submitting-patches.rst and 461ecf393fSThorsten Leemhuis :ref:`Documentation/process/5.Posting.rst <development_posting>`. 471ecf393fSThorsten Leemhuis 48d2b40ba2SThorsten Leemhuis#. Try to fix regressions quickly once the culprit has been identified; fixes 49d2b40ba2SThorsten Leemhuis for most regressions should be merged within two weeks, but some need to be 50d2b40ba2SThorsten Leemhuis resolved within two or three days. 51d2b40ba2SThorsten Leemhuis 521ecf393fSThorsten Leemhuis 531ecf393fSThorsten LeemhuisAll the details on Linux kernel regressions relevant for developers 541ecf393fSThorsten Leemhuis=================================================================== 551ecf393fSThorsten Leemhuis 561ecf393fSThorsten Leemhuis 571ecf393fSThorsten LeemhuisThe important basics in more detail 581ecf393fSThorsten Leemhuis----------------------------------- 591ecf393fSThorsten Leemhuis 601ecf393fSThorsten Leemhuis 611ecf393fSThorsten LeemhuisWhat to do when receiving regression reports 621ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 631ecf393fSThorsten Leemhuis 641ecf393fSThorsten LeemhuisEnsure the Linux kernel's regression tracker and others subscribers of the 651ecf393fSThorsten Leemhuis`regression mailing list <https://lore.kernel.org/regressions/>`_ 661ecf393fSThorsten Leemhuis(regressions@lists.linux.dev) become aware of any newly reported regression: 671ecf393fSThorsten Leemhuis 681ecf393fSThorsten Leemhuis * When you receive a report by mail that did not CC the list, immediately bring 691ecf393fSThorsten Leemhuis it into the loop by sending at least a brief "Reply-all" with the list CCed; 701ecf393fSThorsten Leemhuis try to ensure it gets CCed again in case you reply to a reply that omitted 711ecf393fSThorsten Leemhuis the list. 721ecf393fSThorsten Leemhuis 731ecf393fSThorsten Leemhuis * If a report submitted in a bug tracker hits your Inbox, forward or bounce it 741ecf393fSThorsten Leemhuis to the list. Consider checking the list archives beforehand, if the reporter 751ecf393fSThorsten Leemhuis already forwarded the report as instructed by 761ecf393fSThorsten Leemhuis Documentation/admin-guide/reporting-issues.rst. 771ecf393fSThorsten Leemhuis 781ecf393fSThorsten LeemhuisWhen doing either, consider making the Linux kernel regression tracking bot 791ecf393fSThorsten Leemhuis"regzbot" immediately start tracking the issue: 801ecf393fSThorsten Leemhuis 811ecf393fSThorsten Leemhuis * For mailed reports, check if the reporter included a "regzbot command" like 821ecf393fSThorsten Leemhuis ``#regzbot introduced 1f2e3d4c5b6a``. If not, send a reply (with the 831ecf393fSThorsten Leemhuis regressions list in CC) with a paragraph like the following::: 841ecf393fSThorsten Leemhuis 851ecf393fSThorsten Leemhuis #regzbot ^introduced: v5.13..v5.14-rc1 861ecf393fSThorsten Leemhuis 871ecf393fSThorsten Leemhuis This tells regzbot the version range in which the issue started to happen; 881ecf393fSThorsten Leemhuis you can specify a range using commit-ids as well or state a single commit-id 891ecf393fSThorsten Leemhuis in case the reporter bisected the culprit. 901ecf393fSThorsten Leemhuis 911ecf393fSThorsten Leemhuis Note the caret (^) before the "introduced": it tells regzbot to treat the 921ecf393fSThorsten Leemhuis parent mail (the one you reply to) as the initial report for the regression 931ecf393fSThorsten Leemhuis you want to see tracked; that's important, as regzbot will later look out 941ecf393fSThorsten Leemhuis for patches with "Link:" tags pointing to the report in the archives on 951ecf393fSThorsten Leemhuis lore.kernel.org. 961ecf393fSThorsten Leemhuis 971ecf393fSThorsten Leemhuis * When forwarding a regressions reported to a bug tracker, include a paragraph 981ecf393fSThorsten Leemhuis with these regzbot commands:: 991ecf393fSThorsten Leemhuis 1001ecf393fSThorsten Leemhuis #regzbot introduced: 1f2e3d4c5b6a 1011ecf393fSThorsten Leemhuis #regzbot from: Some N. Ice Human <some.human@example.com> 1021ecf393fSThorsten Leemhuis #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789 1031ecf393fSThorsten Leemhuis 1041ecf393fSThorsten Leemhuis Regzbot will then automatically associate patches with the report that 1051ecf393fSThorsten Leemhuis contain "Link:" tags pointing to your mail or the mentioned ticket. 1061ecf393fSThorsten Leemhuis 1071ecf393fSThorsten LeemhuisWhat's important when fixing regressions 1081ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1091ecf393fSThorsten Leemhuis 1101ecf393fSThorsten LeemhuisYou don't need to do anything special when submitting fixes for regression, just 1111ecf393fSThorsten Leemhuisremember to do what Documentation/process/submitting-patches.rst, 1121ecf393fSThorsten Leemhuis:ref:`Documentation/process/5.Posting.rst <development_posting>`, and 1131ecf393fSThorsten LeemhuisDocumentation/process/stable-kernel-rules.rst already explain in more detail: 1141ecf393fSThorsten Leemhuis 1151ecf393fSThorsten Leemhuis * Point to all places where the issue was reported using "Link:" tags:: 1161ecf393fSThorsten Leemhuis 1171ecf393fSThorsten Leemhuis Link: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Helsinki.FI/ 1181ecf393fSThorsten Leemhuis Link: https://bugzilla.kernel.org/show_bug.cgi?id=1234567890 1191ecf393fSThorsten Leemhuis 1201ecf393fSThorsten Leemhuis * Add a "Fixes:" tag to specify the commit causing the regression. 1211ecf393fSThorsten Leemhuis 1221ecf393fSThorsten Leemhuis * If the culprit was merged in an earlier development cycle, explicitly mark 1231ecf393fSThorsten Leemhuis the fix for backporting using the ``Cc: stable@vger.kernel.org`` tag. 1241ecf393fSThorsten Leemhuis 1251ecf393fSThorsten LeemhuisAll this is expected from you and important when it comes to regression, as 1261ecf393fSThorsten Leemhuisthese tags are of great value for everyone (you included) that might be looking 1271ecf393fSThorsten Leemhuisinto the issue weeks, months, or years later. These tags are also crucial for 1281ecf393fSThorsten Leemhuistools and scripts used by other kernel developers or Linux distributions; one of 1291ecf393fSThorsten Leemhuisthese tools is regzbot, which heavily relies on the "Link:" tags to associate 1301ecf393fSThorsten Leemhuisreports for regression with changes resolving them. 1311ecf393fSThorsten Leemhuis 132*eed892daSThorsten LeemhuisExpectations and best practices for fixing regressions 133*eed892daSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 134d2b40ba2SThorsten Leemhuis 135*eed892daSThorsten LeemhuisAs a Linux kernel developer, you are expected to give your best to prevent 136*eed892daSThorsten Leemhuissituations where a regression caused by a recent change of yours leaves users 137*eed892daSThorsten Leemhuisonly these options: 138d2b40ba2SThorsten Leemhuis 139*eed892daSThorsten Leemhuis * Run a kernel with a regression that impacts usage. 140d2b40ba2SThorsten Leemhuis 141*eed892daSThorsten Leemhuis * Switch to an older or newer kernel series. 142d2b40ba2SThorsten Leemhuis 143*eed892daSThorsten Leemhuis * Continue running an outdated and thus potentially insecure kernel for more 144*eed892daSThorsten Leemhuis than three weeks after the regression's culprit was identified. Ideally it 145*eed892daSThorsten Leemhuis should be less than two. And it ought to be just a few days, if the issue is 146*eed892daSThorsten Leemhuis severe or affects many users -- either in general or in prevalent 147*eed892daSThorsten Leemhuis environments. 148d2b40ba2SThorsten Leemhuis 149*eed892daSThorsten LeemhuisHow to realize that in practice depends on various factors. Use the following 150*eed892daSThorsten Leemhuisrules of thumb as a guide. 151d2b40ba2SThorsten Leemhuis 152*eed892daSThorsten LeemhuisIn general: 153d2b40ba2SThorsten Leemhuis 154*eed892daSThorsten Leemhuis * Prioritize work on regressions over all other Linux kernel work, unless the 155*eed892daSThorsten Leemhuis latter concerns a severe issue (e.g. acute security vulnerability, data loss, 156*eed892daSThorsten Leemhuis bricked hardware, ...). 157d2b40ba2SThorsten Leemhuis 158*eed892daSThorsten Leemhuis * Expedite fixing mainline regressions that recently made it into a proper 159*eed892daSThorsten Leemhuis mainline, stable, or longterm release (either directly or via backport). 160d2b40ba2SThorsten Leemhuis 161*eed892daSThorsten Leemhuis * Do not consider regressions from the current cycle as something that can wait 162*eed892daSThorsten Leemhuis till the end of the cycle, as the issue might discourage or prevent users and 163*eed892daSThorsten Leemhuis CI systems from testing mainline now or generally. 164d2b40ba2SThorsten Leemhuis 165*eed892daSThorsten Leemhuis * Work with the required care to avoid additional or bigger damage, even if 166*eed892daSThorsten Leemhuis resolving an issue then might take longer than outlined below. 167d2b40ba2SThorsten Leemhuis 168*eed892daSThorsten LeemhuisOn timing once the culprit of a regression is known: 169d2b40ba2SThorsten Leemhuis 170*eed892daSThorsten Leemhuis * Aim to mainline a fix within two or three days, if the issue is severe or 171*eed892daSThorsten Leemhuis bothering many users -- either in general or in prevalent conditions like a 172*eed892daSThorsten Leemhuis particular hardware environment, distribution, or stable/longterm series. 173d2b40ba2SThorsten Leemhuis 174*eed892daSThorsten Leemhuis * Aim to mainline a fix by Sunday after the next, if the culprit made it 175*eed892daSThorsten Leemhuis into a recent mainline, stable, or longterm release (either directly or via 176*eed892daSThorsten Leemhuis backport); if the culprit became known early during a week and is simple to 177*eed892daSThorsten Leemhuis resolve, try to mainline the fix within the same week. 178d2b40ba2SThorsten Leemhuis 179*eed892daSThorsten Leemhuis * For other regressions, aim to mainline fixes before the hindmost Sunday 180*eed892daSThorsten Leemhuis within the next three weeks. One or two Sundays later are acceptable, if the 181*eed892daSThorsten Leemhuis regression is something people can live with easily for a while -- like a 182*eed892daSThorsten Leemhuis mild performance regression. 183d2b40ba2SThorsten Leemhuis 184*eed892daSThorsten Leemhuis * It's strongly discouraged to delay mainlining regression fixes till the next 185*eed892daSThorsten Leemhuis merge window, except when the fix is extraordinarily risky or when the 186*eed892daSThorsten Leemhuis culprit was mainlined more than a year ago. 187d2b40ba2SThorsten Leemhuis 188*eed892daSThorsten LeemhuisOn procedure: 189*eed892daSThorsten Leemhuis 190*eed892daSThorsten Leemhuis * Always consider reverting the culprit, as it's often the quickest and least 191*eed892daSThorsten Leemhuis dangerous way to fix a regression. Don't worry about mainlining a fixed 192*eed892daSThorsten Leemhuis variant later: that should be straight-forward, as most of the code went 193*eed892daSThorsten Leemhuis through review once already. 194*eed892daSThorsten Leemhuis 195*eed892daSThorsten Leemhuis * Try to resolve any regressions introduced in mainline during the past 196*eed892daSThorsten Leemhuis twelve months before the current development cycle ends: Linus wants such 197*eed892daSThorsten Leemhuis regressions to be handled like those from the current cycle, unless fixing 198*eed892daSThorsten Leemhuis bears unusual risks. 199*eed892daSThorsten Leemhuis 200*eed892daSThorsten Leemhuis * Consider CCing Linus on discussions or patch review, if a regression seems 201*eed892daSThorsten Leemhuis tangly. Do the same in precarious or urgent cases -- especially if the 202*eed892daSThorsten Leemhuis subsystem maintainer might be unavailable. Also CC the stable team, when you 203*eed892daSThorsten Leemhuis know such a regression made it into a mainline, stable, or longterm release. 204*eed892daSThorsten Leemhuis 205*eed892daSThorsten Leemhuis * For urgent regressions, consider asking Linus to pick up the fix straight 206*eed892daSThorsten Leemhuis from the mailing list: he is totally fine with that for uncontroversial 207*eed892daSThorsten Leemhuis fixes. Ideally though such requests should happen in accordance with the 208*eed892daSThorsten Leemhuis subsystem maintainers or come directly from them. 209*eed892daSThorsten Leemhuis 210*eed892daSThorsten Leemhuis * In case you are unsure if a fix is worth the risk applying just days before 211*eed892daSThorsten Leemhuis a new mainline release, send Linus a mail with the usual lists and people in 212*eed892daSThorsten Leemhuis CC; in it, summarize the situation while asking him to consider picking up 213*eed892daSThorsten Leemhuis the fix straight from the list. He then himself can make the call and when 214*eed892daSThorsten Leemhuis needed even postpone the release. Such requests again should ideally happen 215*eed892daSThorsten Leemhuis in accordance with the subsystem maintainers or come directly from them. 216*eed892daSThorsten Leemhuis 217*eed892daSThorsten LeemhuisRegarding stable and longterm kernels: 218*eed892daSThorsten Leemhuis 219*eed892daSThorsten Leemhuis * You are free to leave regressions to the stable team, if they at no point in 220*eed892daSThorsten Leemhuis time occurred with mainline or were fixed there already. 221*eed892daSThorsten Leemhuis 222*eed892daSThorsten Leemhuis * If a regression made it into a proper mainline release during the past 223*eed892daSThorsten Leemhuis twelve months, ensure to tag the fix with "Cc: stable@vger.kernel.org", as a 224*eed892daSThorsten Leemhuis "Fixes:" tag alone does not guarantee a backport. Please add the same tag, 225*eed892daSThorsten Leemhuis in case you know the culprit was backported to stable or longterm kernels. 226*eed892daSThorsten Leemhuis 227*eed892daSThorsten Leemhuis * When receiving reports about regressions in recent stable or longterm kernel 228*eed892daSThorsten Leemhuis series, please evaluate at least briefly if the issue might happen in current 229*eed892daSThorsten Leemhuis mainline as well -- and if that seems likely, take hold of the report. If in 230*eed892daSThorsten Leemhuis doubt, ask the reporter to check mainline. 231*eed892daSThorsten Leemhuis 232*eed892daSThorsten Leemhuis * Whenever you want to swiftly resolve a regression that recently also made it 233*eed892daSThorsten Leemhuis into a proper mainline, stable, or longterm release, fix it quickly in 234*eed892daSThorsten Leemhuis mainline; when appropriate thus involve Linus to fast-track the fix (see 235*eed892daSThorsten Leemhuis above). That's because the stable team normally does neither revert nor fix 236*eed892daSThorsten Leemhuis any changes that cause the same problems in mainline. 237*eed892daSThorsten Leemhuis 238*eed892daSThorsten Leemhuis * In case of urgent regression fixes you might want to ensure prompt 239*eed892daSThorsten Leemhuis backporting by dropping the stable team a note once the fix was mainlined; 240*eed892daSThorsten Leemhuis this is especially advisable during merge windows and shortly thereafter, as 241*eed892daSThorsten Leemhuis the fix otherwise might land at the end of a huge patch queue. 242*eed892daSThorsten Leemhuis 243*eed892daSThorsten LeemhuisOn patch flow: 244*eed892daSThorsten Leemhuis 245*eed892daSThorsten Leemhuis * Developers, when trying to reach the time periods mentioned above, remember 246*eed892daSThorsten Leemhuis to account for the time it takes to get fixes tested, reviewed, and merged by 247*eed892daSThorsten Leemhuis Linus, ideally with them being in linux-next at least briefly. Hence, if a 248*eed892daSThorsten Leemhuis fix is urgent, make it obvious to ensure others handle it appropriately. 249*eed892daSThorsten Leemhuis 250*eed892daSThorsten Leemhuis * Reviewers, you are kindly asked to assist developers in reaching the time 251*eed892daSThorsten Leemhuis periods mentioned above by reviewing regression fixes in a timely manner. 252*eed892daSThorsten Leemhuis 253*eed892daSThorsten Leemhuis * Subsystem maintainers, you likewise are encouraged to expedite the handling 254*eed892daSThorsten Leemhuis of regression fixes. Thus evaluate if skipping linux-next is an option for 255*eed892daSThorsten Leemhuis the particular fix. Also consider sending git pull requests more often than 256*eed892daSThorsten Leemhuis usual when needed. And try to avoid holding onto regression fixes over 257*eed892daSThorsten Leemhuis weekends -- especially when the fix is marked for backporting. 258d2b40ba2SThorsten Leemhuis 2591ecf393fSThorsten Leemhuis 2601ecf393fSThorsten LeemhuisMore aspects regarding regressions developers should be aware of 2611ecf393fSThorsten Leemhuis---------------------------------------------------------------- 2621ecf393fSThorsten Leemhuis 2631ecf393fSThorsten Leemhuis 2641ecf393fSThorsten LeemhuisHow to deal with changes where a risk of regression is known 2651ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2661ecf393fSThorsten Leemhuis 2671ecf393fSThorsten LeemhuisEvaluate how big the risk of regressions is, for example by performing a code 2681ecf393fSThorsten Leemhuissearch in Linux distributions and Git forges. Also consider asking other 2691ecf393fSThorsten Leemhuisdevelopers or projects likely to be affected to evaluate or even test the 2701ecf393fSThorsten Leemhuisproposed change; if problems surface, maybe some solution acceptable for all 2711ecf393fSThorsten Leemhuiscan be found. 2721ecf393fSThorsten Leemhuis 2731ecf393fSThorsten LeemhuisIf the risk of regressions in the end seems to be relatively small, go ahead 2741ecf393fSThorsten Leemhuiswith the change, but let all involved parties know about the risk. Hence, make 2751ecf393fSThorsten Leemhuissure your patch description makes this aspect obvious. Once the change is 2761ecf393fSThorsten Leemhuismerged, tell the Linux kernel's regression tracker and the regressions mailing 2771ecf393fSThorsten Leemhuislist about the risk, so everyone has the change on the radar in case reports 2781ecf393fSThorsten Leemhuistrickle in. Depending on the risk, you also might want to ask the subsystem 2791ecf393fSThorsten Leemhuismaintainer to mention the issue in his mainline pull request. 2801ecf393fSThorsten Leemhuis 2811ecf393fSThorsten LeemhuisWhat else is there to known about regressions? 2821ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2831ecf393fSThorsten Leemhuis 2841ecf393fSThorsten LeemhuisCheck out Documentation/admin-guide/reporting-regressions.rst, it covers a lot 2851ecf393fSThorsten Leemhuisof other aspects you want might want to be aware of: 2861ecf393fSThorsten Leemhuis 2871ecf393fSThorsten Leemhuis * the purpose of the "no regressions rule" 2881ecf393fSThorsten Leemhuis 2891ecf393fSThorsten Leemhuis * what issues actually qualify as regression 2901ecf393fSThorsten Leemhuis 2911ecf393fSThorsten Leemhuis * who's in charge for finding the root cause of a regression 2921ecf393fSThorsten Leemhuis 2931ecf393fSThorsten Leemhuis * how to handle tricky situations, e.g. when a regression is caused by a 2941ecf393fSThorsten Leemhuis security fix or when fixing a regression might cause another one 2951ecf393fSThorsten Leemhuis 2961ecf393fSThorsten LeemhuisWhom to ask for advice when it comes to regressions 2971ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2981ecf393fSThorsten Leemhuis 2991ecf393fSThorsten LeemhuisSend a mail to the regressions mailing list (regressions@lists.linux.dev) while 3001ecf393fSThorsten LeemhuisCCing the Linux kernel's regression tracker (regressions@leemhuis.info); if the 3011ecf393fSThorsten Leemhuisissue might better be dealt with in private, feel free to omit the list. 3021ecf393fSThorsten Leemhuis 3031ecf393fSThorsten Leemhuis 3041ecf393fSThorsten LeemhuisMore about regression tracking and regzbot 3051ecf393fSThorsten Leemhuis------------------------------------------ 3061ecf393fSThorsten Leemhuis 3071ecf393fSThorsten Leemhuis 3081ecf393fSThorsten LeemhuisWhy the Linux kernel has a regression tracker, and why is regzbot used? 3091ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3101ecf393fSThorsten Leemhuis 3111ecf393fSThorsten LeemhuisRules like "no regressions" need someone to ensure they are followed, otherwise 3121ecf393fSThorsten Leemhuisthey are broken either accidentally or on purpose. History has shown this to be 3131ecf393fSThorsten Leemhuistrue for the Linux kernel as well. That's why Thorsten Leemhuis volunteered to 3141ecf393fSThorsten Leemhuiskeep an eye on things as the Linux kernel's regression tracker, who's 3151ecf393fSThorsten Leemhuisoccasionally helped by other people. Neither of them are paid to do this, 3161ecf393fSThorsten Leemhuisthat's why regression tracking is done on a best effort basis. 3171ecf393fSThorsten Leemhuis 3181ecf393fSThorsten LeemhuisEarlier attempts to manually track regressions have shown it's an exhausting and 3191ecf393fSThorsten Leemhuisfrustrating work, which is why they were abandoned after a while. To prevent 3201ecf393fSThorsten Leemhuisthis from happening again, Thorsten developed regzbot to facilitate the work, 3211ecf393fSThorsten Leemhuiswith the long term goal to automate regression tracking as much as possible for 3221ecf393fSThorsten Leemhuiseveryone involved. 3231ecf393fSThorsten Leemhuis 3241ecf393fSThorsten LeemhuisHow does regression tracking work with regzbot? 3251ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3261ecf393fSThorsten Leemhuis 3271ecf393fSThorsten LeemhuisThe bot watches for replies to reports of tracked regressions. Additionally, 3281ecf393fSThorsten Leemhuisit's looking out for posted or committed patches referencing such reports 3291ecf393fSThorsten Leemhuiswith "Link:" tags; replies to such patch postings are tracked as well. 3301ecf393fSThorsten LeemhuisCombined this data provides good insights into the current state of the fixing 3311ecf393fSThorsten Leemhuisprocess. 3321ecf393fSThorsten Leemhuis 3331ecf393fSThorsten LeemhuisRegzbot tries to do its job with as little overhead as possible for both 3341ecf393fSThorsten Leemhuisreporters and developers. In fact, only reporters are burdened with an extra 3351ecf393fSThorsten Leemhuisduty: they need to tell regzbot about the regression report using the ``#regzbot 3361ecf393fSThorsten Leemhuisintroduced`` command outlined above; if they don't do that, someone else can 3371ecf393fSThorsten Leemhuistake care of that using ``#regzbot ^introduced``. 3381ecf393fSThorsten Leemhuis 3391ecf393fSThorsten LeemhuisFor developers there normally is no extra work involved, they just need to make 3401ecf393fSThorsten Leemhuissure to do something that was expected long before regzbot came to light: add 3411ecf393fSThorsten Leemhuis"Link:" tags to the patch description pointing to all reports about the issue 3421ecf393fSThorsten Leemhuisfixed. 3431ecf393fSThorsten Leemhuis 3441ecf393fSThorsten LeemhuisDo I have to use regzbot? 3451ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~ 3461ecf393fSThorsten Leemhuis 3471ecf393fSThorsten LeemhuisIt's in the interest of everyone if you do, as kernel maintainers like Linus 3481ecf393fSThorsten LeemhuisTorvalds partly rely on regzbot's tracking in their work -- for example when 3491ecf393fSThorsten Leemhuisdeciding to release a new version or extend the development phase. For this they 3501ecf393fSThorsten Leemhuisneed to be aware of all unfixed regression; to do that, Linus is known to look 3511ecf393fSThorsten Leemhuisinto the weekly reports sent by regzbot. 3521ecf393fSThorsten Leemhuis 3531ecf393fSThorsten LeemhuisDo I have to tell regzbot about every regression I stumble upon? 3541ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3551ecf393fSThorsten Leemhuis 3561ecf393fSThorsten LeemhuisIdeally yes: we are all humans and easily forget problems when something more 3571ecf393fSThorsten Leemhuisimportant unexpectedly comes up -- for example a bigger problem in the Linux 3581ecf393fSThorsten Leemhuiskernel or something in real life that's keeping us away from keyboards for a 3591ecf393fSThorsten Leemhuiswhile. Hence, it's best to tell regzbot about every regression, except when you 3601ecf393fSThorsten Leemhuisimmediately write a fix and commit it to a tree regularly merged to the affected 3611ecf393fSThorsten Leemhuiskernel series. 3621ecf393fSThorsten Leemhuis 3631ecf393fSThorsten LeemhuisHow to see which regressions regzbot tracks currently? 3641ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3651ecf393fSThorsten Leemhuis 3661ecf393fSThorsten LeemhuisCheck `regzbot's web-interface <https://linux-regtracking.leemhuis.info/regzbot/>`_ 3671ecf393fSThorsten Leemhuisfor the latest info; alternatively, `search for the latest regression report 3681ecf393fSThorsten Leemhuis<https://lore.kernel.org/lkml/?q=%22Linux+regressions+report%22+f%3Aregzbot>`_, 3691ecf393fSThorsten Leemhuiswhich regzbot normally sends out once a week on Sunday evening (UTC), which is a 3701ecf393fSThorsten Leemhuisfew hours before Linus usually publishes new (pre-)releases. 3711ecf393fSThorsten Leemhuis 3721ecf393fSThorsten LeemhuisWhat places is regzbot monitoring? 3731ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3741ecf393fSThorsten Leemhuis 3751ecf393fSThorsten LeemhuisRegzbot is watching the most important Linux mailing lists as well as the git 3761ecf393fSThorsten Leemhuisrepositories of linux-next, mainline, and stable/longterm. 3771ecf393fSThorsten Leemhuis 3781ecf393fSThorsten LeemhuisWhat kind of issues are supposed to be tracked by regzbot? 3791ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3801ecf393fSThorsten Leemhuis 3811ecf393fSThorsten LeemhuisThe bot is meant to track regressions, hence please don't involve regzbot for 3821ecf393fSThorsten Leemhuisregular issues. But it's okay for the Linux kernel's regression tracker if you 3831ecf393fSThorsten Leemhuisuse regzbot to track severe issues, like reports about hangs, corrupted data, 3841ecf393fSThorsten Leemhuisor internal errors (Panic, Oops, BUG(), warning, ...). 3851ecf393fSThorsten Leemhuis 3861ecf393fSThorsten LeemhuisCan I add regressions found by CI systems to regzbot's tracking? 3871ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3881ecf393fSThorsten Leemhuis 3891ecf393fSThorsten LeemhuisFeel free to do so, if the particular regression likely has impact on practical 3901ecf393fSThorsten Leemhuisuse cases and thus might be noticed by users; hence, please don't involve 3911ecf393fSThorsten Leemhuisregzbot for theoretical regressions unlikely to show themselves in real world 3921ecf393fSThorsten Leemhuisusage. 3931ecf393fSThorsten Leemhuis 3941ecf393fSThorsten LeemhuisHow to interact with regzbot? 3951ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3961ecf393fSThorsten Leemhuis 3971ecf393fSThorsten LeemhuisBy using a 'regzbot command' in a direct or indirect reply to the mail with the 3981ecf393fSThorsten Leemhuisregression report. These commands need to be in their own paragraph (IOW: they 3991ecf393fSThorsten Leemhuisneed to be separated from the rest of the mail using blank lines). 4001ecf393fSThorsten Leemhuis 4011ecf393fSThorsten LeemhuisOne such command is ``#regzbot introduced <version or commit>``, which makes 4021ecf393fSThorsten Leemhuisregzbot consider your mail as a regressions report added to the tracking, as 4031ecf393fSThorsten Leemhuisalready described above; ``#regzbot ^introduced <version or commit>`` is another 4041ecf393fSThorsten Leemhuissuch command, which makes regzbot consider the parent mail as a report for a 4051ecf393fSThorsten Leemhuisregression which it starts to track. 4061ecf393fSThorsten Leemhuis 4071ecf393fSThorsten LeemhuisOnce one of those two commands has been utilized, other regzbot commands can be 4081ecf393fSThorsten Leemhuisused in direct or indirect replies to the report. You can write them below one 4091ecf393fSThorsten Leemhuisof the `introduced` commands or in replies to the mail that used one of them 4101ecf393fSThorsten Leemhuisor itself is a reply to that mail: 4111ecf393fSThorsten Leemhuis 4121ecf393fSThorsten Leemhuis * Set or update the title:: 4131ecf393fSThorsten Leemhuis 4141ecf393fSThorsten Leemhuis #regzbot title: foo 4151ecf393fSThorsten Leemhuis 4161ecf393fSThorsten Leemhuis * Monitor a discussion or bugzilla.kernel.org ticket where additions aspects of 4171ecf393fSThorsten Leemhuis the issue or a fix are discussed -- for example the posting of a patch fixing 4181ecf393fSThorsten Leemhuis the regression:: 4191ecf393fSThorsten Leemhuis 4201ecf393fSThorsten Leemhuis #regzbot monitor: https://lore.kernel.org/all/30th.anniversary.repost@klaava.Helsinki.FI/ 4211ecf393fSThorsten Leemhuis 4221ecf393fSThorsten Leemhuis Monitoring only works for lore.kernel.org and bugzilla.kernel.org; regzbot 4231ecf393fSThorsten Leemhuis will consider all messages in that thread or ticket as related to the fixing 4241ecf393fSThorsten Leemhuis process. 4251ecf393fSThorsten Leemhuis 4261ecf393fSThorsten Leemhuis * Point to a place with further details of interest, like a mailing list post 4271ecf393fSThorsten Leemhuis or a ticket in a bug tracker that are slightly related, but about a different 4281ecf393fSThorsten Leemhuis topic:: 4291ecf393fSThorsten Leemhuis 4301ecf393fSThorsten Leemhuis #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=123456789 4311ecf393fSThorsten Leemhuis 4321ecf393fSThorsten Leemhuis * Mark a regression as fixed by a commit that is heading upstream or already 4331ecf393fSThorsten Leemhuis landed:: 4341ecf393fSThorsten Leemhuis 4351ecf393fSThorsten Leemhuis #regzbot fixed-by: 1f2e3d4c5d 4361ecf393fSThorsten Leemhuis 4371ecf393fSThorsten Leemhuis * Mark a regression as a duplicate of another one already tracked by regzbot:: 4381ecf393fSThorsten Leemhuis 4391ecf393fSThorsten Leemhuis #regzbot dup-of: https://lore.kernel.org/all/30th.anniversary.repost@klaava.Helsinki.FI/ 4401ecf393fSThorsten Leemhuis 4411ecf393fSThorsten Leemhuis * Mark a regression as invalid:: 4421ecf393fSThorsten Leemhuis 4431ecf393fSThorsten Leemhuis #regzbot invalid: wasn't a regression, problem has always existed 4441ecf393fSThorsten Leemhuis 4451ecf393fSThorsten LeemhuisIs there more to tell about regzbot and its commands? 4461ecf393fSThorsten Leemhuis~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4471ecf393fSThorsten Leemhuis 4481ecf393fSThorsten LeemhuisMore detailed and up-to-date information about the Linux 4491ecf393fSThorsten Leemhuiskernel's regression tracking bot can be found on its 4501ecf393fSThorsten Leemhuis`project page <https://gitlab.com/knurd42/regzbot>`_, which among others 4511ecf393fSThorsten Leemhuiscontains a `getting started guide <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/getting_started.md>`_ 4521ecf393fSThorsten Leemhuisand `reference documentation <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/reference.md>`_ 4531ecf393fSThorsten Leemhuiswhich both cover more details than the above section. 4541ecf393fSThorsten Leemhuis 4551ecf393fSThorsten LeemhuisQuotes from Linus about regression 4561ecf393fSThorsten Leemhuis---------------------------------- 4571ecf393fSThorsten Leemhuis 4581ecf393fSThorsten LeemhuisFind below a few real life examples of how Linus Torvalds expects regressions to 4591ecf393fSThorsten Leemhuisbe handled: 4601ecf393fSThorsten Leemhuis 4611ecf393fSThorsten Leemhuis * From `2017-10-26 (1/2) 4621ecf393fSThorsten Leemhuis <https://lore.kernel.org/lkml/CA+55aFwiiQYJ+YoLKCXjN_beDVfu38mg=Ggg5LFOcqHE8Qi7Zw@mail.gmail.com/>`_:: 4631ecf393fSThorsten Leemhuis 4641ecf393fSThorsten Leemhuis If you break existing user space setups THAT IS A REGRESSION. 4651ecf393fSThorsten Leemhuis 4661ecf393fSThorsten Leemhuis It's not ok to say "but we'll fix the user space setup". 4671ecf393fSThorsten Leemhuis 4681ecf393fSThorsten Leemhuis Really. NOT OK. 4691ecf393fSThorsten Leemhuis 4701ecf393fSThorsten Leemhuis [...] 4711ecf393fSThorsten Leemhuis 4721ecf393fSThorsten Leemhuis The first rule is: 4731ecf393fSThorsten Leemhuis 4741ecf393fSThorsten Leemhuis - we don't cause regressions 4751ecf393fSThorsten Leemhuis 4761ecf393fSThorsten Leemhuis and the corollary is that when regressions *do* occur, we admit to 4771ecf393fSThorsten Leemhuis them and fix them, instead of blaming user space. 4781ecf393fSThorsten Leemhuis 4791ecf393fSThorsten Leemhuis The fact that you have apparently been denying the regression now for 4801ecf393fSThorsten Leemhuis three weeks means that I will revert, and I will stop pulling apparmor 4811ecf393fSThorsten Leemhuis requests until the people involved understand how kernel development 4821ecf393fSThorsten Leemhuis is done. 4831ecf393fSThorsten Leemhuis 4841ecf393fSThorsten Leemhuis * From `2017-10-26 (2/2) 4851ecf393fSThorsten Leemhuis <https://lore.kernel.org/lkml/CA+55aFxW7NMAMvYhkvz1UPbUTUJewRt6Yb51QAx5RtrWOwjebg@mail.gmail.com/>`_:: 4861ecf393fSThorsten Leemhuis 4871ecf393fSThorsten Leemhuis People should basically always feel like they can update their kernel 4881ecf393fSThorsten Leemhuis and simply not have to worry about it. 4891ecf393fSThorsten Leemhuis 4901ecf393fSThorsten Leemhuis I refuse to introduce "you can only update the kernel if you also 4911ecf393fSThorsten Leemhuis update that other program" kind of limitations. If the kernel used to 4921ecf393fSThorsten Leemhuis work for you, the rule is that it continues to work for you. 4931ecf393fSThorsten Leemhuis 4941ecf393fSThorsten Leemhuis There have been exceptions, but they are few and far between, and they 4951ecf393fSThorsten Leemhuis generally have some major and fundamental reasons for having happened, 4961ecf393fSThorsten Leemhuis that were basically entirely unavoidable, and people _tried_hard_ to 4971ecf393fSThorsten Leemhuis avoid them. Maybe we can't practically support the hardware any more 4981ecf393fSThorsten Leemhuis after it is decades old and nobody uses it with modern kernels any 4991ecf393fSThorsten Leemhuis more. Maybe there's a serious security issue with how we did things, 5001ecf393fSThorsten Leemhuis and people actually depended on that fundamentally broken model. Maybe 5011ecf393fSThorsten Leemhuis there was some fundamental other breakage that just _had_ to have a 5021ecf393fSThorsten Leemhuis flag day for very core and fundamental reasons. 5031ecf393fSThorsten Leemhuis 5041ecf393fSThorsten Leemhuis And notice that this is very much about *breaking* peoples environments. 5051ecf393fSThorsten Leemhuis 5061ecf393fSThorsten Leemhuis Behavioral changes happen, and maybe we don't even support some 5071ecf393fSThorsten Leemhuis feature any more. There's a number of fields in /proc/<pid>/stat that 5081ecf393fSThorsten Leemhuis are printed out as zeroes, simply because they don't even *exist* in 5091ecf393fSThorsten Leemhuis the kernel any more, or because showing them was a mistake (typically 5101ecf393fSThorsten Leemhuis an information leak). But the numbers got replaced by zeroes, so that 5111ecf393fSThorsten Leemhuis the code that used to parse the fields still works. The user might not 5121ecf393fSThorsten Leemhuis see everything they used to see, and so behavior is clearly different, 5131ecf393fSThorsten Leemhuis but things still _work_, even if they might no longer show sensitive 5141ecf393fSThorsten Leemhuis (or no longer relevant) information. 5151ecf393fSThorsten Leemhuis 5161ecf393fSThorsten Leemhuis But if something actually breaks, then the change must get fixed or 5171ecf393fSThorsten Leemhuis reverted. And it gets fixed in the *kernel*. Not by saying "well, fix 5181ecf393fSThorsten Leemhuis your user space then". It was a kernel change that exposed the 5191ecf393fSThorsten Leemhuis problem, it needs to be the kernel that corrects for it, because we 5201ecf393fSThorsten Leemhuis have a "upgrade in place" model. We don't have a "upgrade with new 5211ecf393fSThorsten Leemhuis user space". 5221ecf393fSThorsten Leemhuis 5231ecf393fSThorsten Leemhuis And I seriously will refuse to take code from people who do not 5241ecf393fSThorsten Leemhuis understand and honor this very simple rule. 5251ecf393fSThorsten Leemhuis 5261ecf393fSThorsten Leemhuis This rule is also not going to change. 5271ecf393fSThorsten Leemhuis 5281ecf393fSThorsten Leemhuis And yes, I realize that the kernel is "special" in this respect. I'm 5291ecf393fSThorsten Leemhuis proud of it. 5301ecf393fSThorsten Leemhuis 5311ecf393fSThorsten Leemhuis I have seen, and can point to, lots of projects that go "We need to 5321ecf393fSThorsten Leemhuis break that use case in order to make progress" or "you relied on 5331ecf393fSThorsten Leemhuis undocumented behavior, it sucks to be you" or "there's a better way to 5341ecf393fSThorsten Leemhuis do what you want to do, and you have to change to that new better 5351ecf393fSThorsten Leemhuis way", and I simply don't think that's acceptable outside of very early 5361ecf393fSThorsten Leemhuis alpha releases that have experimental users that know what they signed 5371ecf393fSThorsten Leemhuis up for. The kernel hasn't been in that situation for the last two 5381ecf393fSThorsten Leemhuis decades. 5391ecf393fSThorsten Leemhuis 5401ecf393fSThorsten Leemhuis We do API breakage _inside_ the kernel all the time. We will fix 5411ecf393fSThorsten Leemhuis internal problems by saying "you now need to do XYZ", but then it's 5421ecf393fSThorsten Leemhuis about internal kernel API's, and the people who do that then also 5431ecf393fSThorsten Leemhuis obviously have to fix up all the in-kernel users of that API. Nobody 5441ecf393fSThorsten Leemhuis can say "I now broke the API you used, and now _you_ need to fix it 5451ecf393fSThorsten Leemhuis up". Whoever broke something gets to fix it too. 5461ecf393fSThorsten Leemhuis 5471ecf393fSThorsten Leemhuis And we simply do not break user space. 5481ecf393fSThorsten Leemhuis 5491ecf393fSThorsten Leemhuis * From `2020-05-21 5501ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/CAHk-=wiVi7mSrsMP=fLXQrXK_UimybW=ziLOwSzFTtoXUacWVQ@mail.gmail.com/>`_:: 5511ecf393fSThorsten Leemhuis 5521ecf393fSThorsten Leemhuis The rules about regressions have never been about any kind of 5531ecf393fSThorsten Leemhuis documented behavior, or where the code lives. 5541ecf393fSThorsten Leemhuis 5551ecf393fSThorsten Leemhuis The rules about regressions are always about "breaks user workflow". 5561ecf393fSThorsten Leemhuis 5571ecf393fSThorsten Leemhuis Users are literally the _only_ thing that matters. 5581ecf393fSThorsten Leemhuis 5591ecf393fSThorsten Leemhuis No amount of "you shouldn't have used this" or "that behavior was 5601ecf393fSThorsten Leemhuis undefined, it's your own fault your app broke" or "that used to work 5611ecf393fSThorsten Leemhuis simply because of a kernel bug" is at all relevant. 5621ecf393fSThorsten Leemhuis 5631ecf393fSThorsten Leemhuis Now, reality is never entirely black-and-white. So we've had things 5641ecf393fSThorsten Leemhuis like "serious security issue" etc that just forces us to make changes 5651ecf393fSThorsten Leemhuis that may break user space. But even then the rule is that we don't 5661ecf393fSThorsten Leemhuis really have other options that would allow things to continue. 5671ecf393fSThorsten Leemhuis 5681ecf393fSThorsten Leemhuis And obviously, if users take years to even notice that something 5691ecf393fSThorsten Leemhuis broke, or if we have sane ways to work around the breakage that 5701ecf393fSThorsten Leemhuis doesn't make for too much trouble for users (ie "ok, there are a 5711ecf393fSThorsten Leemhuis handful of users, and they can use a kernel command line to work 5721ecf393fSThorsten Leemhuis around it" kind of things) we've also been a bit less strict. 5731ecf393fSThorsten Leemhuis 5741ecf393fSThorsten Leemhuis But no, "that was documented to be broken" (whether it's because the 5751ecf393fSThorsten Leemhuis code was in staging or because the man-page said something else) is 5761ecf393fSThorsten Leemhuis irrelevant. If staging code is so useful that people end up using it, 5771ecf393fSThorsten Leemhuis that means that it's basically regular kernel code with a flag saying 5781ecf393fSThorsten Leemhuis "please clean this up". 5791ecf393fSThorsten Leemhuis 5801ecf393fSThorsten Leemhuis The other side of the coin is that people who talk about "API 5811ecf393fSThorsten Leemhuis stability" are entirely wrong. API's don't matter either. You can make 5821ecf393fSThorsten Leemhuis any changes to an API you like - as long as nobody notices. 5831ecf393fSThorsten Leemhuis 5841ecf393fSThorsten Leemhuis Again, the regression rule is not about documentation, not about 5851ecf393fSThorsten Leemhuis API's, and not about the phase of the moon. 5861ecf393fSThorsten Leemhuis 5871ecf393fSThorsten Leemhuis It's entirely about "we caused problems for user space that used to work". 5881ecf393fSThorsten Leemhuis 5891ecf393fSThorsten Leemhuis * From `2017-11-05 5901ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/CA+55aFzUvbGjD8nQ-+3oiMBx14c_6zOj2n7KLN3UsJ-qsd4Dcw@mail.gmail.com/>`_:: 5911ecf393fSThorsten Leemhuis 5921ecf393fSThorsten Leemhuis And our regression rule has never been "behavior doesn't change". 5931ecf393fSThorsten Leemhuis That would mean that we could never make any changes at all. 5941ecf393fSThorsten Leemhuis 5951ecf393fSThorsten Leemhuis For example, we do things like add new error handling etc all the 5961ecf393fSThorsten Leemhuis time, which we then sometimes even add tests for in our kselftest 5971ecf393fSThorsten Leemhuis directory. 5981ecf393fSThorsten Leemhuis 5991ecf393fSThorsten Leemhuis So clearly behavior changes all the time and we don't consider that a 6001ecf393fSThorsten Leemhuis regression per se. 6011ecf393fSThorsten Leemhuis 6021ecf393fSThorsten Leemhuis The rule for a regression for the kernel is that some real user 6031ecf393fSThorsten Leemhuis workflow breaks. Not some test. Not a "look, I used to be able to do 6041ecf393fSThorsten Leemhuis X, now I can't". 6051ecf393fSThorsten Leemhuis 6061ecf393fSThorsten Leemhuis * From `2018-08-03 6071ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/CA+55aFwWZX=CXmWDTkDGb36kf12XmTehmQjbiMPCqCRG2hi9kw@mail.gmail.com/>`_:: 6081ecf393fSThorsten Leemhuis 6091ecf393fSThorsten Leemhuis YOU ARE MISSING THE #1 KERNEL RULE. 6101ecf393fSThorsten Leemhuis 6111ecf393fSThorsten Leemhuis We do not regress, and we do not regress exactly because your are 100% wrong. 6121ecf393fSThorsten Leemhuis 6131ecf393fSThorsten Leemhuis And the reason you state for your opinion is in fact exactly *WHY* you 6141ecf393fSThorsten Leemhuis are wrong. 6151ecf393fSThorsten Leemhuis 6161ecf393fSThorsten Leemhuis Your "good reasons" are pure and utter garbage. 6171ecf393fSThorsten Leemhuis 6181ecf393fSThorsten Leemhuis The whole point of "we do not regress" is so that people can upgrade 6191ecf393fSThorsten Leemhuis the kernel and never have to worry about it. 6201ecf393fSThorsten Leemhuis 6211ecf393fSThorsten Leemhuis > Kernel had a bug which has been fixed 6221ecf393fSThorsten Leemhuis 6231ecf393fSThorsten Leemhuis That is *ENTIRELY* immaterial. 6241ecf393fSThorsten Leemhuis 6251ecf393fSThorsten Leemhuis Guys, whether something was buggy or not DOES NOT MATTER. 6261ecf393fSThorsten Leemhuis 6271ecf393fSThorsten Leemhuis Why? 6281ecf393fSThorsten Leemhuis 6291ecf393fSThorsten Leemhuis Bugs happen. That's a fact of life. Arguing that "we had to break 6301ecf393fSThorsten Leemhuis something because we were fixing a bug" is completely insane. We fix 6311ecf393fSThorsten Leemhuis tens of bugs every single day, thinking that "fixing a bug" means that 6321ecf393fSThorsten Leemhuis we can break something is simply NOT TRUE. 6331ecf393fSThorsten Leemhuis 6341ecf393fSThorsten Leemhuis So bugs simply aren't even relevant to the discussion. They happen, 6351ecf393fSThorsten Leemhuis they get found, they get fixed, and it has nothing to do with "we 6361ecf393fSThorsten Leemhuis break users". 6371ecf393fSThorsten Leemhuis 6381ecf393fSThorsten Leemhuis Because the only thing that matters IS THE USER. 6391ecf393fSThorsten Leemhuis 6401ecf393fSThorsten Leemhuis How hard is that to understand? 6411ecf393fSThorsten Leemhuis 6421ecf393fSThorsten Leemhuis Anybody who uses "but it was buggy" as an argument is entirely missing 6431ecf393fSThorsten Leemhuis the point. As far as the USER was concerned, it wasn't buggy - it 6441ecf393fSThorsten Leemhuis worked for him/her. 6451ecf393fSThorsten Leemhuis 6461ecf393fSThorsten Leemhuis Maybe it worked *because* the user had taken the bug into account, 6471ecf393fSThorsten Leemhuis maybe it worked because the user didn't notice - again, it doesn't 6481ecf393fSThorsten Leemhuis matter. It worked for the user. 6491ecf393fSThorsten Leemhuis 6501ecf393fSThorsten Leemhuis Breaking a user workflow for a "bug" is absolutely the WORST reason 6511ecf393fSThorsten Leemhuis for breakage you can imagine. 6521ecf393fSThorsten Leemhuis 6531ecf393fSThorsten Leemhuis It's basically saying "I took something that worked, and I broke it, 6541ecf393fSThorsten Leemhuis but now it's better". Do you not see how f*cking insane that statement 6551ecf393fSThorsten Leemhuis is? 6561ecf393fSThorsten Leemhuis 6571ecf393fSThorsten Leemhuis And without users, your program is not a program, it's a pointless 6581ecf393fSThorsten Leemhuis piece of code that you might as well throw away. 6591ecf393fSThorsten Leemhuis 6601ecf393fSThorsten Leemhuis Seriously. This is *why* the #1 rule for kernel development is "we 6611ecf393fSThorsten Leemhuis don't break users". Because "I fixed a bug" is absolutely NOT AN 6621ecf393fSThorsten Leemhuis ARGUMENT if that bug fix broke a user setup. You actually introduced a 6631ecf393fSThorsten Leemhuis MUCH BIGGER bug by "fixing" something that the user clearly didn't 6641ecf393fSThorsten Leemhuis even care about. 6651ecf393fSThorsten Leemhuis 6661ecf393fSThorsten Leemhuis And dammit, we upgrade the kernel ALL THE TIME without upgrading any 6671ecf393fSThorsten Leemhuis other programs at all. It is absolutely required, because flag-days 6681ecf393fSThorsten Leemhuis and dependencies are horribly bad. 6691ecf393fSThorsten Leemhuis 6701ecf393fSThorsten Leemhuis And it is also required simply because I as a kernel developer do not 6711ecf393fSThorsten Leemhuis upgrade random other tools that I don't even care about as I develop 6721ecf393fSThorsten Leemhuis the kernel, and I want any of my users to feel safe doing the same 6731ecf393fSThorsten Leemhuis time. 6741ecf393fSThorsten Leemhuis 6751ecf393fSThorsten Leemhuis So no. Your rule is COMPLETELY wrong. If you cannot upgrade a kernel 6761ecf393fSThorsten Leemhuis without upgrading some other random binary, then we have a problem. 6771ecf393fSThorsten Leemhuis 6781ecf393fSThorsten Leemhuis * From `2021-06-05 6791ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/CAHk-=wiUVqHN76YUwhkjZzwTdjMMJf_zN4+u7vEJjmEGh3recw@mail.gmail.com/>`_:: 6801ecf393fSThorsten Leemhuis 6811ecf393fSThorsten Leemhuis THERE ARE NO VALID ARGUMENTS FOR REGRESSIONS. 6821ecf393fSThorsten Leemhuis 6831ecf393fSThorsten Leemhuis Honestly, security people need to understand that "not working" is not 6841ecf393fSThorsten Leemhuis a success case of security. It's a failure case. 6851ecf393fSThorsten Leemhuis 6861ecf393fSThorsten Leemhuis Yes, "not working" may be secure. But security in that case is *pointless*. 6871ecf393fSThorsten Leemhuis 6881ecf393fSThorsten Leemhuis * From `2011-05-06 (1/3) 6891ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/BANLkTim9YvResB+PwRp7QTK-a5VNg2PvmQ@mail.gmail.com/>`_:: 6901ecf393fSThorsten Leemhuis 6911ecf393fSThorsten Leemhuis Binary compatibility is more important. 6921ecf393fSThorsten Leemhuis 6931ecf393fSThorsten Leemhuis And if binaries don't use the interface to parse the format (or just 6941ecf393fSThorsten Leemhuis parse it wrongly - see the fairly recent example of adding uuid's to 6951ecf393fSThorsten Leemhuis /proc/self/mountinfo), then it's a regression. 6961ecf393fSThorsten Leemhuis 6971ecf393fSThorsten Leemhuis And regressions get reverted, unless there are security issues or 6981ecf393fSThorsten Leemhuis similar that makes us go "Oh Gods, we really have to break things". 6991ecf393fSThorsten Leemhuis 7001ecf393fSThorsten Leemhuis I don't understand why this simple logic is so hard for some kernel 7011ecf393fSThorsten Leemhuis developers to understand. Reality matters. Your personal wishes matter 7021ecf393fSThorsten Leemhuis NOT AT ALL. 7031ecf393fSThorsten Leemhuis 7041ecf393fSThorsten Leemhuis If you made an interface that can be used without parsing the 7051ecf393fSThorsten Leemhuis interface description, then we're stuck with the interface. Theory 7061ecf393fSThorsten Leemhuis simply doesn't matter. 7071ecf393fSThorsten Leemhuis 7081ecf393fSThorsten Leemhuis You could help fix the tools, and try to avoid the compatibility 7091ecf393fSThorsten Leemhuis issues that way. There aren't that many of them. 7101ecf393fSThorsten Leemhuis 7111ecf393fSThorsten Leemhuis From `2011-05-06 (2/3) 7121ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/BANLkTi=KVXjKR82sqsz4gwjr+E0vtqCmvA@mail.gmail.com/>`_:: 7131ecf393fSThorsten Leemhuis 7141ecf393fSThorsten Leemhuis it's clearly NOT an internal tracepoint. By definition. It's being 7151ecf393fSThorsten Leemhuis used by powertop. 7161ecf393fSThorsten Leemhuis 7171ecf393fSThorsten Leemhuis From `2011-05-06 (3/3) 7181ecf393fSThorsten Leemhuis <https://lore.kernel.org/all/BANLkTinazaXRdGovYL7rRVp+j6HbJ7pzhg@mail.gmail.com/>`_:: 7191ecf393fSThorsten Leemhuis 7201ecf393fSThorsten Leemhuis We have programs that use that ABI and thus it's a regression if they break. 7211ecf393fSThorsten Leemhuis 7221ecf393fSThorsten Leemhuis * From `2012-07-06 <https://lore.kernel.org/all/CA+55aFwnLJ+0sjx92EGREGTWOx84wwKaraSzpTNJwPVV8edw8g@mail.gmail.com/>`_:: 7231ecf393fSThorsten Leemhuis 7241ecf393fSThorsten Leemhuis > Now this got me wondering if Debian _unstable_ actually qualifies as a 7251ecf393fSThorsten Leemhuis > standard distro userspace. 7261ecf393fSThorsten Leemhuis 7271ecf393fSThorsten Leemhuis Oh, if the kernel breaks some standard user space, that counts. Tons 7281ecf393fSThorsten Leemhuis of people run Debian unstable 7291ecf393fSThorsten Leemhuis 7301ecf393fSThorsten Leemhuis * From `2019-09-15 7311ecf393fSThorsten Leemhuis <https://lore.kernel.org/lkml/CAHk-=wiP4K8DRJWsCo=20hn_6054xBamGKF2kPgUzpB5aMaofA@mail.gmail.com/>`_:: 7321ecf393fSThorsten Leemhuis 7331ecf393fSThorsten Leemhuis One _particularly_ last-minute revert is the top-most commit (ignoring 7341ecf393fSThorsten Leemhuis the version change itself) done just before the release, and while 7351ecf393fSThorsten Leemhuis it's very annoying, it's perhaps also instructive. 7361ecf393fSThorsten Leemhuis 7371ecf393fSThorsten Leemhuis What's instructive about it is that I reverted a commit that wasn't 7381ecf393fSThorsten Leemhuis actually buggy. In fact, it was doing exactly what it set out to do, 7391ecf393fSThorsten Leemhuis and did it very well. In fact it did it _so_ well that the much 7401ecf393fSThorsten Leemhuis improved IO patterns it caused then ended up revealing a user-visible 7411ecf393fSThorsten Leemhuis regression due to a real bug in a completely unrelated area. 7421ecf393fSThorsten Leemhuis 7431ecf393fSThorsten Leemhuis The actual details of that regression are not the reason I point that 7441ecf393fSThorsten Leemhuis revert out as instructive, though. It's more that it's an instructive 7451ecf393fSThorsten Leemhuis example of what counts as a regression, and what the whole "no 7461ecf393fSThorsten Leemhuis regressions" kernel rule means. The reverted commit didn't change any 7471ecf393fSThorsten Leemhuis API's, and it didn't introduce any new bugs. But it ended up exposing 7481ecf393fSThorsten Leemhuis another problem, and as such caused a kernel upgrade to fail for a 7491ecf393fSThorsten Leemhuis user. So it got reverted. 7501ecf393fSThorsten Leemhuis 7511ecf393fSThorsten Leemhuis The point here being that we revert based on user-reported _behavior_, 7521ecf393fSThorsten Leemhuis not based on some "it changes the ABI" or "it caused a bug" concept. 7531ecf393fSThorsten Leemhuis The problem was really pre-existing, and it just didn't happen to 7541ecf393fSThorsten Leemhuis trigger before. The better IO patterns introduced by the change just 7551ecf393fSThorsten Leemhuis happened to expose an old bug, and people had grown to depend on the 7561ecf393fSThorsten Leemhuis previously benign behavior of that old issue. 7571ecf393fSThorsten Leemhuis 7581ecf393fSThorsten Leemhuis And never fear, we'll re-introduce the fix that improved on the IO 7591ecf393fSThorsten Leemhuis patterns once we've decided just how to handle the fact that we had a 7601ecf393fSThorsten Leemhuis bad interaction with an interface that people had then just happened 7611ecf393fSThorsten Leemhuis to rely on incidental behavior for before. It's just that we'll have 7621ecf393fSThorsten Leemhuis to hash through how to do that (there are no less than three different 7631ecf393fSThorsten Leemhuis patches by three different developers being discussed, and there might 7641ecf393fSThorsten Leemhuis be more coming...). In the meantime, I reverted the thing that exposed 7651ecf393fSThorsten Leemhuis the problem to users for this release, even if I hope it will be 7661ecf393fSThorsten Leemhuis re-introduced (perhaps even backported as a stable patch) once we have 7671ecf393fSThorsten Leemhuis consensus about the issue it exposed. 7681ecf393fSThorsten Leemhuis 7691ecf393fSThorsten Leemhuis Take-away from the whole thing: it's not about whether you change the 7701ecf393fSThorsten Leemhuis kernel-userspace ABI, or fix a bug, or about whether the old code 7711ecf393fSThorsten Leemhuis "should never have worked in the first place". It's about whether 7721ecf393fSThorsten Leemhuis something breaks existing users' workflow. 7731ecf393fSThorsten Leemhuis 7741ecf393fSThorsten Leemhuis Anyway, that was my little aside on the whole regression thing. Since 7751ecf393fSThorsten Leemhuis it's that "first rule of kernel programming", I felt it is perhaps 7761ecf393fSThorsten Leemhuis worth just bringing it up every once in a while 7771ecf393fSThorsten Leemhuis 7781ecf393fSThorsten Leemhuis.. 7791ecf393fSThorsten Leemhuis end-of-content 7801ecf393fSThorsten Leemhuis.. 7811ecf393fSThorsten Leemhuis This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top 7821ecf393fSThorsten Leemhuis of the file. If you want to distribute this text under CC-BY-4.0 only, 7831ecf393fSThorsten Leemhuis please use "The Linux kernel developers" for author attribution and link 7841ecf393fSThorsten Leemhuis this as source: 7851ecf393fSThorsten Leemhuis https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/handling-regressions.rst 7861ecf393fSThorsten Leemhuis.. 7871ecf393fSThorsten Leemhuis Note: Only the content of this RST file as found in the Linux kernel sources 7881ecf393fSThorsten Leemhuis is available under CC-BY-4.0, as versions of this text that were processed 7891ecf393fSThorsten Leemhuis (for example by the kernel's build system) might contain content taken from 7901ecf393fSThorsten Leemhuis files which use a more restrictive license. 791