handling-regressions.rst 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. .. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0)
  2. .. See the bottom of this file for additional redistribution information.
  3. Handling regressions
  4. ++++++++++++++++++++
  5. *We don't cause regressions* -- this document describes what this "first rule of
  6. Linux kernel development" means in practice for developers. It complements
  7. Documentation/admin-guide/reporting-regressions.rst, which covers the topic from a
  8. user's point of view; if you never read that text, go and at least skim over it
  9. before continuing here.
  10. The important bits (aka "The TL;DR")
  11. ====================================
  12. #. Ensure subscribers of the `regression mailing list <https://lore.kernel.org/regressions/>`_
  13. (regressions@lists.linux.dev) quickly become aware of any new regression
  14. report:
  15. * When receiving a mailed report that did not CC the list, bring it into the
  16. loop by immediately sending at least a brief "Reply-all" with the list
  17. CCed.
  18. * Forward or bounce any reports submitted in bug trackers to the list.
  19. #. Make the Linux kernel regression tracking bot "regzbot" track the issue (this
  20. is optional, but recommended):
  21. * For mailed reports, check if the reporter included a line like ``#regzbot
  22. introduced: v5.13..v5.14-rc1``. If not, send a reply (with the regressions
  23. list in CC) containing a paragraph like the following, which tells regzbot
  24. when the issue started to happen::
  25. #regzbot ^introduced: 1f2e3d4c5b6a
  26. * When forwarding reports from a bug tracker to the regressions list (see
  27. above), include a paragraph like the following::
  28. #regzbot introduced: v5.13..v5.14-rc1
  29. #regzbot from: Some N. Ice Human <some.human@example.com>
  30. #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789
  31. #. When submitting fixes for regressions, add "Closes:" tags to the patch
  32. description pointing to all places where the issue was reported, as
  33. mandated by Documentation/process/submitting-patches.rst and
  34. :ref:`Documentation/process/5.Posting.rst <development_posting>`. If you are
  35. only fixing part of the issue that caused the regression, you may use
  36. "Link:" tags instead. regzbot currently makes no distinction between the
  37. two.
  38. #. Try to fix regressions quickly once the culprit has been identified; fixes
  39. for most regressions should be merged within two weeks, but some need to be
  40. resolved within two or three days.
  41. All the details on Linux kernel regressions relevant for developers
  42. ===================================================================
  43. The important basics in more detail
  44. -----------------------------------
  45. What to do when receiving regression reports
  46. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  47. Ensure the Linux kernel's regression tracker and others subscribers of the
  48. `regression mailing list <https://lore.kernel.org/regressions/>`_
  49. (regressions@lists.linux.dev) become aware of any newly reported regression:
  50. * When you receive a report by mail that did not CC the list, immediately bring
  51. it into the loop by sending at least a brief "Reply-all" with the list CCed;
  52. try to ensure it gets CCed again in case you reply to a reply that omitted
  53. the list.
  54. * If a report submitted in a bug tracker hits your Inbox, forward or bounce it
  55. to the list. Consider checking the list archives beforehand, if the reporter
  56. already forwarded the report as instructed by
  57. Documentation/admin-guide/reporting-issues.rst.
  58. When doing either, consider making the Linux kernel regression tracking bot
  59. "regzbot" immediately start tracking the issue:
  60. * For mailed reports, check if the reporter included a "regzbot command" like
  61. ``#regzbot introduced: 1f2e3d4c5b6a``. If not, send a reply (with the
  62. regressions list in CC) with a paragraph like the following:::
  63. #regzbot ^introduced: v5.13..v5.14-rc1
  64. This tells regzbot the version range in which the issue started to happen;
  65. you can specify a range using commit-ids as well or state a single commit-id
  66. in case the reporter bisected the culprit.
  67. Note the caret (^) before the "introduced": it tells regzbot to treat the
  68. parent mail (the one you reply to) as the initial report for the regression
  69. you want to see tracked; that's important, as regzbot will later look out
  70. for patches with "Closes:" tags pointing to the report in the archives on
  71. lore.kernel.org.
  72. * When forwarding a regression reported to a bug tracker, include a paragraph
  73. with these regzbot commands::
  74. #regzbot introduced: 1f2e3d4c5b6a
  75. #regzbot from: Some N. Ice Human <some.human@example.com>
  76. #regzbot monitor: http://some.bugtracker.example.com/ticket?id=123456789
  77. Regzbot will then automatically associate patches with the report that
  78. contain "Closes:" tags pointing to your mail or the mentioned ticket.
  79. What's important when fixing regressions
  80. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. You don't need to do anything special when submitting fixes for regression, just
  82. remember to do what Documentation/process/submitting-patches.rst,
  83. :ref:`Documentation/process/5.Posting.rst <development_posting>`, and
  84. Documentation/process/stable-kernel-rules.rst already explain in more detail:
  85. * Point to all places where the issue was reported using "Closes:" tags::
  86. Closes: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Helsinki.FI/
  87. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=1234567890
  88. If you are only fixing part of the issue, you may use "Link:" instead as
  89. described in the first document mentioned above. regzbot currently treats
  90. both of these equivalently and considers the linked reports as resolved.
  91. * Add a "Fixes:" tag to specify the commit causing the regression.
  92. * If the culprit was merged in an earlier development cycle, explicitly mark
  93. the fix for backporting using the ``Cc: stable@vger.kernel.org`` tag.
  94. All this is expected from you and important when it comes to regression, as
  95. these tags are of great value for everyone (you included) that might be looking
  96. into the issue weeks, months, or years later. These tags are also crucial for
  97. tools and scripts used by other kernel developers or Linux distributions; one of
  98. these tools is regzbot, which heavily relies on the "Closes:" tags to associate
  99. reports for regression with changes resolving them.
  100. Expectations and best practices for fixing regressions
  101. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. As a Linux kernel developer, you are expected to give your best to prevent
  103. situations where a regression caused by a recent change of yours leaves users
  104. only these options:
  105. * Run a kernel with a regression that impacts usage.
  106. * Switch to an older or newer kernel series.
  107. * Continue running an outdated and thus potentially insecure kernel for more
  108. than three weeks after the regression's culprit was identified. Ideally it
  109. should be less than two. And it ought to be just a few days, if the issue is
  110. severe or affects many users -- either in general or in prevalent
  111. environments.
  112. How to realize that in practice depends on various factors. Use the following
  113. rules of thumb as a guide.
  114. In general:
  115. * Prioritize work on regressions over all other Linux kernel work, unless the
  116. latter concerns a severe issue (e.g. acute security vulnerability, data loss,
  117. bricked hardware, ...).
  118. * Expedite fixing mainline regressions that recently made it into a proper
  119. mainline, stable, or longterm release (either directly or via backport).
  120. * Do not consider regressions from the current cycle as something that can wait
  121. till the end of the cycle, as the issue might discourage or prevent users and
  122. CI systems from testing mainline now or generally.
  123. * Work with the required care to avoid additional or bigger damage, even if
  124. resolving an issue then might take longer than outlined below.
  125. On timing once the culprit of a regression is known:
  126. * Aim to mainline a fix within two or three days, if the issue is severe or
  127. bothering many users -- either in general or in prevalent conditions like a
  128. particular hardware environment, distribution, or stable/longterm series.
  129. * Aim to mainline a fix by Sunday after the next, if the culprit made it
  130. into a recent mainline, stable, or longterm release (either directly or via
  131. backport); if the culprit became known early during a week and is simple to
  132. resolve, try to mainline the fix within the same week.
  133. * For other regressions, aim to mainline fixes before the hindmost Sunday
  134. within the next three weeks. One or two Sundays later are acceptable, if the
  135. regression is something people can live with easily for a while -- like a
  136. mild performance regression.
  137. * It's strongly discouraged to delay mainlining regression fixes till the next
  138. merge window, except when the fix is extraordinarily risky or when the
  139. culprit was mainlined more than a year ago.
  140. On procedure:
  141. * Always consider reverting the culprit, as it's often the quickest and least
  142. dangerous way to fix a regression. Don't worry about mainlining a fixed
  143. variant later: that should be straight-forward, as most of the code went
  144. through review once already.
  145. * Try to resolve any regressions introduced in mainline during the past
  146. twelve months before the current development cycle ends: Linus wants such
  147. regressions to be handled like those from the current cycle, unless fixing
  148. bears unusual risks.
  149. * Consider CCing Linus on discussions or patch review, if a regression seems
  150. tangly. Do the same in precarious or urgent cases -- especially if the
  151. subsystem maintainer might be unavailable. Also CC the stable team, when you
  152. know such a regression made it into a mainline, stable, or longterm release.
  153. * For urgent regressions, consider asking Linus to pick up the fix straight
  154. from the mailing list: he is totally fine with that for uncontroversial
  155. fixes. Ideally though such requests should happen in accordance with the
  156. subsystem maintainers or come directly from them.
  157. * In case you are unsure if a fix is worth the risk applying just days before
  158. a new mainline release, send Linus a mail with the usual lists and people in
  159. CC; in it, summarize the situation while asking him to consider picking up
  160. the fix straight from the list. He then himself can make the call and when
  161. needed even postpone the release. Such requests again should ideally happen
  162. in accordance with the subsystem maintainers or come directly from them.
  163. Regarding stable and longterm kernels:
  164. * You are free to leave regressions to the stable team, if they at no point in
  165. time occurred with mainline or were fixed there already.
  166. * If a regression made it into a proper mainline release during the past
  167. twelve months, ensure to tag the fix with "Cc: stable@vger.kernel.org", as a
  168. "Fixes:" tag alone does not guarantee a backport. Please add the same tag,
  169. in case you know the culprit was backported to stable or longterm kernels.
  170. * When receiving reports about regressions in recent stable or longterm kernel
  171. series, please evaluate at least briefly if the issue might happen in current
  172. mainline as well -- and if that seems likely, take hold of the report. If in
  173. doubt, ask the reporter to check mainline.
  174. * Whenever you want to swiftly resolve a regression that recently also made it
  175. into a proper mainline, stable, or longterm release, fix it quickly in
  176. mainline; when appropriate thus involve Linus to fast-track the fix (see
  177. above). That's because the stable team normally does neither revert nor fix
  178. any changes that cause the same problems in mainline.
  179. * In case of urgent regression fixes you might want to ensure prompt
  180. backporting by dropping the stable team a note once the fix was mainlined;
  181. this is especially advisable during merge windows and shortly thereafter, as
  182. the fix otherwise might land at the end of a huge patch queue.
  183. On patch flow:
  184. * Developers, when trying to reach the time periods mentioned above, remember
  185. to account for the time it takes to get fixes tested, reviewed, and merged by
  186. Linus, ideally with them being in linux-next at least briefly. Hence, if a
  187. fix is urgent, make it obvious to ensure others handle it appropriately.
  188. * Reviewers, you are kindly asked to assist developers in reaching the time
  189. periods mentioned above by reviewing regression fixes in a timely manner.
  190. * Subsystem maintainers, you likewise are encouraged to expedite the handling
  191. of regression fixes. Thus evaluate if skipping linux-next is an option for
  192. the particular fix. Also consider sending git pull requests more often than
  193. usual when needed. And try to avoid holding onto regression fixes over
  194. weekends -- especially when the fix is marked for backporting.
  195. More aspects regarding regressions developers should be aware of
  196. ----------------------------------------------------------------
  197. How to deal with changes where a risk of regression is known
  198. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  199. Evaluate how big the risk of regressions is, for example by performing a code
  200. search in Linux distributions and Git forges. Also consider asking other
  201. developers or projects likely to be affected to evaluate or even test the
  202. proposed change; if problems surface, maybe some solution acceptable for all
  203. can be found.
  204. If the risk of regressions in the end seems to be relatively small, go ahead
  205. with the change, but let all involved parties know about the risk. Hence, make
  206. sure your patch description makes this aspect obvious. Once the change is
  207. merged, tell the Linux kernel's regression tracker and the regressions mailing
  208. list about the risk, so everyone has the change on the radar in case reports
  209. trickle in. Depending on the risk, you also might want to ask the subsystem
  210. maintainer to mention the issue in his mainline pull request.
  211. What else is there to known about regressions?
  212. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213. Check out Documentation/admin-guide/reporting-regressions.rst, it covers a lot
  214. of other aspects you want might want to be aware of:
  215. * the purpose of the "no regressions" rule
  216. * what issues actually qualify as regression
  217. * who's in charge for finding the root cause of a regression
  218. * how to handle tricky situations, e.g. when a regression is caused by a
  219. security fix or when fixing a regression might cause another one
  220. Whom to ask for advice when it comes to regressions
  221. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  222. Send a mail to the regressions mailing list (regressions@lists.linux.dev) while
  223. CCing the Linux kernel's regression tracker (regressions@leemhuis.info); if the
  224. issue might better be dealt with in private, feel free to omit the list.
  225. More about regression tracking and regzbot
  226. ------------------------------------------
  227. Why the Linux kernel has a regression tracker, and why is regzbot used?
  228. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  229. Rules like "no regressions" need someone to ensure they are followed, otherwise
  230. they are broken either accidentally or on purpose. History has shown this to be
  231. true for the Linux kernel as well. That's why Thorsten Leemhuis volunteered to
  232. keep an eye on things as the Linux kernel's regression tracker, who's
  233. occasionally helped by other people. Neither of them are paid to do this,
  234. that's why regression tracking is done on a best effort basis.
  235. Earlier attempts to manually track regressions have shown it's an exhausting and
  236. frustrating work, which is why they were abandoned after a while. To prevent
  237. this from happening again, Thorsten developed regzbot to facilitate the work,
  238. with the long term goal to automate regression tracking as much as possible for
  239. everyone involved.
  240. How does regression tracking work with regzbot?
  241. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  242. The bot watches for replies to reports of tracked regressions. Additionally,
  243. it's looking out for posted or committed patches referencing such reports
  244. with "Closes:" tags; replies to such patch postings are tracked as well.
  245. Combined this data provides good insights into the current state of the fixing
  246. process.
  247. Regzbot tries to do its job with as little overhead as possible for both
  248. reporters and developers. In fact, only reporters are burdened with an extra
  249. duty: they need to tell regzbot about the regression report using the ``#regzbot
  250. introduced`` command outlined above; if they don't do that, someone else can
  251. take care of that using ``#regzbot ^introduced``.
  252. For developers there normally is no extra work involved, they just need to make
  253. sure to do something that was expected long before regzbot came to light: add
  254. links to the patch description pointing to all reports about the issue fixed.
  255. Do I have to use regzbot?
  256. ~~~~~~~~~~~~~~~~~~~~~~~~~
  257. It's in the interest of everyone if you do, as kernel maintainers like Linus
  258. Torvalds partly rely on regzbot's tracking in their work -- for example when
  259. deciding to release a new version or extend the development phase. For this they
  260. need to be aware of all unfixed regression; to do that, Linus is known to look
  261. into the weekly reports sent by regzbot.
  262. Do I have to tell regzbot about every regression I stumble upon?
  263. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  264. Ideally yes: we are all humans and easily forget problems when something more
  265. important unexpectedly comes up -- for example a bigger problem in the Linux
  266. kernel or something in real life that's keeping us away from keyboards for a
  267. while. Hence, it's best to tell regzbot about every regression, except when you
  268. immediately write a fix and commit it to a tree regularly merged to the affected
  269. kernel series.
  270. How to see which regressions regzbot tracks currently?
  271. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  272. Check `regzbot's web-interface <https://linux-regtracking.leemhuis.info/regzbot/>`_
  273. for the latest info; alternatively, `search for the latest regression report
  274. <https://lore.kernel.org/lkml/?q=%22Linux+regressions+report%22+f%3Aregzbot>`_,
  275. which regzbot normally sends out once a week on Sunday evening (UTC), which is a
  276. few hours before Linus usually publishes new (pre-)releases.
  277. What places is regzbot monitoring?
  278. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  279. Regzbot is watching the most important Linux mailing lists as well as the git
  280. repositories of linux-next, mainline, and stable/longterm.
  281. What kind of issues are supposed to be tracked by regzbot?
  282. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. The bot is meant to track regressions, hence please don't involve regzbot for
  284. regular issues. But it's okay for the Linux kernel's regression tracker if you
  285. use regzbot to track severe issues, like reports about hangs, corrupted data,
  286. or internal errors (Panic, Oops, BUG(), warning, ...).
  287. Can I add regressions found by CI systems to regzbot's tracking?
  288. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  289. Feel free to do so, if the particular regression likely has impact on practical
  290. use cases and thus might be noticed by users; hence, please don't involve
  291. regzbot for theoretical regressions unlikely to show themselves in real world
  292. usage.
  293. How to interact with regzbot?
  294. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  295. By using a 'regzbot command' in a direct or indirect reply to the mail with the
  296. regression report. These commands need to be in their own paragraph (IOW: they
  297. need to be separated from the rest of the mail using blank lines).
  298. One such command is ``#regzbot introduced: <version or commit>``, which makes
  299. regzbot consider your mail as a regressions report added to the tracking, as
  300. already described above; ``#regzbot ^introduced: <version or commit>`` is another
  301. such command, which makes regzbot consider the parent mail as a report for a
  302. regression which it starts to track.
  303. Once one of those two commands has been utilized, other regzbot commands can be
  304. used in direct or indirect replies to the report. You can write them below one
  305. of the `introduced` commands or in replies to the mail that used one of them
  306. or itself is a reply to that mail:
  307. * Set or update the title::
  308. #regzbot title: foo
  309. * Monitor a discussion or bugzilla.kernel.org ticket where additions aspects of
  310. the issue or a fix are discussed -- for example the posting of a patch fixing
  311. the regression::
  312. #regzbot monitor: https://lore.kernel.org/all/30th.anniversary.repost@klaava.Helsinki.FI/
  313. Monitoring only works for lore.kernel.org and bugzilla.kernel.org; regzbot
  314. will consider all messages in that thread or ticket as related to the fixing
  315. process.
  316. * Point to a place with further details of interest, like a mailing list post
  317. or a ticket in a bug tracker that are slightly related, but about a different
  318. topic::
  319. #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=123456789
  320. * Mark a regression as fixed by a commit that is heading upstream or already
  321. landed::
  322. #regzbot fix: 1f2e3d4c5d
  323. * Mark a regression as a duplicate of another one already tracked by regzbot::
  324. #regzbot dup-of: https://lore.kernel.org/all/30th.anniversary.repost@klaava.Helsinki.FI/
  325. * Mark a regression as invalid::
  326. #regzbot invalid: wasn't a regression, problem has always existed
  327. Is there more to tell about regzbot and its commands?
  328. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  329. More detailed and up-to-date information about the Linux
  330. kernel's regression tracking bot can be found on its
  331. `project page <https://gitlab.com/knurd42/regzbot>`_, which among others
  332. contains a `getting started guide <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/getting_started.md>`_
  333. and `reference documentation <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/reference.md>`_
  334. which both cover more details than the above section.
  335. Quotes from Linus about regression
  336. ----------------------------------
  337. Find below a few real life examples of how Linus Torvalds expects regressions to
  338. be handled:
  339. * From `2017-10-26 (1/2)
  340. <https://lore.kernel.org/lkml/CA+55aFwiiQYJ+YoLKCXjN_beDVfu38mg=Ggg5LFOcqHE8Qi7Zw@mail.gmail.com/>`_::
  341. If you break existing user space setups THAT IS A REGRESSION.
  342. It's not ok to say "but we'll fix the user space setup".
  343. Really. NOT OK.
  344. [...]
  345. The first rule is:
  346. - we don't cause regressions
  347. and the corollary is that when regressions *do* occur, we admit to
  348. them and fix them, instead of blaming user space.
  349. The fact that you have apparently been denying the regression now for
  350. three weeks means that I will revert, and I will stop pulling apparmor
  351. requests until the people involved understand how kernel development
  352. is done.
  353. * From `2017-10-26 (2/2)
  354. <https://lore.kernel.org/lkml/CA+55aFxW7NMAMvYhkvz1UPbUTUJewRt6Yb51QAx5RtrWOwjebg@mail.gmail.com/>`_::
  355. People should basically always feel like they can update their kernel
  356. and simply not have to worry about it.
  357. I refuse to introduce "you can only update the kernel if you also
  358. update that other program" kind of limitations. If the kernel used to
  359. work for you, the rule is that it continues to work for you.
  360. There have been exceptions, but they are few and far between, and they
  361. generally have some major and fundamental reasons for having happened,
  362. that were basically entirely unavoidable, and people _tried_hard_ to
  363. avoid them. Maybe we can't practically support the hardware any more
  364. after it is decades old and nobody uses it with modern kernels any
  365. more. Maybe there's a serious security issue with how we did things,
  366. and people actually depended on that fundamentally broken model. Maybe
  367. there was some fundamental other breakage that just _had_ to have a
  368. flag day for very core and fundamental reasons.
  369. And notice that this is very much about *breaking* peoples environments.
  370. Behavioral changes happen, and maybe we don't even support some
  371. feature any more. There's a number of fields in /proc/<pid>/stat that
  372. are printed out as zeroes, simply because they don't even *exist* in
  373. the kernel any more, or because showing them was a mistake (typically
  374. an information leak). But the numbers got replaced by zeroes, so that
  375. the code that used to parse the fields still works. The user might not
  376. see everything they used to see, and so behavior is clearly different,
  377. but things still _work_, even if they might no longer show sensitive
  378. (or no longer relevant) information.
  379. But if something actually breaks, then the change must get fixed or
  380. reverted. And it gets fixed in the *kernel*. Not by saying "well, fix
  381. your user space then". It was a kernel change that exposed the
  382. problem, it needs to be the kernel that corrects for it, because we
  383. have a "upgrade in place" model. We don't have a "upgrade with new
  384. user space".
  385. And I seriously will refuse to take code from people who do not
  386. understand and honor this very simple rule.
  387. This rule is also not going to change.
  388. And yes, I realize that the kernel is "special" in this respect. I'm
  389. proud of it.
  390. I have seen, and can point to, lots of projects that go "We need to
  391. break that use case in order to make progress" or "you relied on
  392. undocumented behavior, it sucks to be you" or "there's a better way to
  393. do what you want to do, and you have to change to that new better
  394. way", and I simply don't think that's acceptable outside of very early
  395. alpha releases that have experimental users that know what they signed
  396. up for. The kernel hasn't been in that situation for the last two
  397. decades.
  398. We do API breakage _inside_ the kernel all the time. We will fix
  399. internal problems by saying "you now need to do XYZ", but then it's
  400. about internal kernel API's, and the people who do that then also
  401. obviously have to fix up all the in-kernel users of that API. Nobody
  402. can say "I now broke the API you used, and now _you_ need to fix it
  403. up". Whoever broke something gets to fix it too.
  404. And we simply do not break user space.
  405. * From `2020-05-21
  406. <https://lore.kernel.org/all/CAHk-=wiVi7mSrsMP=fLXQrXK_UimybW=ziLOwSzFTtoXUacWVQ@mail.gmail.com/>`_::
  407. The rules about regressions have never been about any kind of
  408. documented behavior, or where the code lives.
  409. The rules about regressions are always about "breaks user workflow".
  410. Users are literally the _only_ thing that matters.
  411. No amount of "you shouldn't have used this" or "that behavior was
  412. undefined, it's your own fault your app broke" or "that used to work
  413. simply because of a kernel bug" is at all relevant.
  414. Now, reality is never entirely black-and-white. So we've had things
  415. like "serious security issue" etc that just forces us to make changes
  416. that may break user space. But even then the rule is that we don't
  417. really have other options that would allow things to continue.
  418. And obviously, if users take years to even notice that something
  419. broke, or if we have sane ways to work around the breakage that
  420. doesn't make for too much trouble for users (ie "ok, there are a
  421. handful of users, and they can use a kernel command line to work
  422. around it" kind of things) we've also been a bit less strict.
  423. But no, "that was documented to be broken" (whether it's because the
  424. code was in staging or because the man-page said something else) is
  425. irrelevant. If staging code is so useful that people end up using it,
  426. that means that it's basically regular kernel code with a flag saying
  427. "please clean this up".
  428. The other side of the coin is that people who talk about "API
  429. stability" are entirely wrong. API's don't matter either. You can make
  430. any changes to an API you like - as long as nobody notices.
  431. Again, the regression rule is not about documentation, not about
  432. API's, and not about the phase of the moon.
  433. It's entirely about "we caused problems for user space that used to work".
  434. * From `2017-11-05
  435. <https://lore.kernel.org/all/CA+55aFzUvbGjD8nQ-+3oiMBx14c_6zOj2n7KLN3UsJ-qsd4Dcw@mail.gmail.com/>`_::
  436. And our regression rule has never been "behavior doesn't change".
  437. That would mean that we could never make any changes at all.
  438. For example, we do things like add new error handling etc all the
  439. time, which we then sometimes even add tests for in our kselftest
  440. directory.
  441. So clearly behavior changes all the time and we don't consider that a
  442. regression per se.
  443. The rule for a regression for the kernel is that some real user
  444. workflow breaks. Not some test. Not a "look, I used to be able to do
  445. X, now I can't".
  446. * From `2018-08-03
  447. <https://lore.kernel.org/all/CA+55aFwWZX=CXmWDTkDGb36kf12XmTehmQjbiMPCqCRG2hi9kw@mail.gmail.com/>`_::
  448. YOU ARE MISSING THE #1 KERNEL RULE.
  449. We do not regress, and we do not regress exactly because your are 100% wrong.
  450. And the reason you state for your opinion is in fact exactly *WHY* you
  451. are wrong.
  452. Your "good reasons" are pure and utter garbage.
  453. The whole point of "we do not regress" is so that people can upgrade
  454. the kernel and never have to worry about it.
  455. > Kernel had a bug which has been fixed
  456. That is *ENTIRELY* immaterial.
  457. Guys, whether something was buggy or not DOES NOT MATTER.
  458. Why?
  459. Bugs happen. That's a fact of life. Arguing that "we had to break
  460. something because we were fixing a bug" is completely insane. We fix
  461. tens of bugs every single day, thinking that "fixing a bug" means that
  462. we can break something is simply NOT TRUE.
  463. So bugs simply aren't even relevant to the discussion. They happen,
  464. they get found, they get fixed, and it has nothing to do with "we
  465. break users".
  466. Because the only thing that matters IS THE USER.
  467. How hard is that to understand?
  468. Anybody who uses "but it was buggy" as an argument is entirely missing
  469. the point. As far as the USER was concerned, it wasn't buggy - it
  470. worked for him/her.
  471. Maybe it worked *because* the user had taken the bug into account,
  472. maybe it worked because the user didn't notice - again, it doesn't
  473. matter. It worked for the user.
  474. Breaking a user workflow for a "bug" is absolutely the WORST reason
  475. for breakage you can imagine.
  476. It's basically saying "I took something that worked, and I broke it,
  477. but now it's better". Do you not see how f*cking insane that statement
  478. is?
  479. And without users, your program is not a program, it's a pointless
  480. piece of code that you might as well throw away.
  481. Seriously. This is *why* the #1 rule for kernel development is "we
  482. don't break users". Because "I fixed a bug" is absolutely NOT AN
  483. ARGUMENT if that bug fix broke a user setup. You actually introduced a
  484. MUCH BIGGER bug by "fixing" something that the user clearly didn't
  485. even care about.
  486. And dammit, we upgrade the kernel ALL THE TIME without upgrading any
  487. other programs at all. It is absolutely required, because flag-days
  488. and dependencies are horribly bad.
  489. And it is also required simply because I as a kernel developer do not
  490. upgrade random other tools that I don't even care about as I develop
  491. the kernel, and I want any of my users to feel safe doing the same
  492. time.
  493. So no. Your rule is COMPLETELY wrong. If you cannot upgrade a kernel
  494. without upgrading some other random binary, then we have a problem.
  495. * From `2021-06-05
  496. <https://lore.kernel.org/all/CAHk-=wiUVqHN76YUwhkjZzwTdjMMJf_zN4+u7vEJjmEGh3recw@mail.gmail.com/>`_::
  497. THERE ARE NO VALID ARGUMENTS FOR REGRESSIONS.
  498. Honestly, security people need to understand that "not working" is not
  499. a success case of security. It's a failure case.
  500. Yes, "not working" may be secure. But security in that case is *pointless*.
  501. * From `2011-05-06 (1/3)
  502. <https://lore.kernel.org/all/BANLkTim9YvResB+PwRp7QTK-a5VNg2PvmQ@mail.gmail.com/>`_::
  503. Binary compatibility is more important.
  504. And if binaries don't use the interface to parse the format (or just
  505. parse it wrongly - see the fairly recent example of adding uuid's to
  506. /proc/self/mountinfo), then it's a regression.
  507. And regressions get reverted, unless there are security issues or
  508. similar that makes us go "Oh Gods, we really have to break things".
  509. I don't understand why this simple logic is so hard for some kernel
  510. developers to understand. Reality matters. Your personal wishes matter
  511. NOT AT ALL.
  512. If you made an interface that can be used without parsing the
  513. interface description, then we're stuck with the interface. Theory
  514. simply doesn't matter.
  515. You could help fix the tools, and try to avoid the compatibility
  516. issues that way. There aren't that many of them.
  517. From `2011-05-06 (2/3)
  518. <https://lore.kernel.org/all/BANLkTi=KVXjKR82sqsz4gwjr+E0vtqCmvA@mail.gmail.com/>`_::
  519. it's clearly NOT an internal tracepoint. By definition. It's being
  520. used by powertop.
  521. From `2011-05-06 (3/3)
  522. <https://lore.kernel.org/all/BANLkTinazaXRdGovYL7rRVp+j6HbJ7pzhg@mail.gmail.com/>`_::
  523. We have programs that use that ABI and thus it's a regression if they break.
  524. * From `2012-07-06 <https://lore.kernel.org/all/CA+55aFwnLJ+0sjx92EGREGTWOx84wwKaraSzpTNJwPVV8edw8g@mail.gmail.com/>`_::
  525. > Now this got me wondering if Debian _unstable_ actually qualifies as a
  526. > standard distro userspace.
  527. Oh, if the kernel breaks some standard user space, that counts. Tons
  528. of people run Debian unstable
  529. * From `2019-09-15
  530. <https://lore.kernel.org/lkml/CAHk-=wiP4K8DRJWsCo=20hn_6054xBamGKF2kPgUzpB5aMaofA@mail.gmail.com/>`_::
  531. One _particularly_ last-minute revert is the top-most commit (ignoring
  532. the version change itself) done just before the release, and while
  533. it's very annoying, it's perhaps also instructive.
  534. What's instructive about it is that I reverted a commit that wasn't
  535. actually buggy. In fact, it was doing exactly what it set out to do,
  536. and did it very well. In fact it did it _so_ well that the much
  537. improved IO patterns it caused then ended up revealing a user-visible
  538. regression due to a real bug in a completely unrelated area.
  539. The actual details of that regression are not the reason I point that
  540. revert out as instructive, though. It's more that it's an instructive
  541. example of what counts as a regression, and what the whole "no
  542. regressions" kernel rule means. The reverted commit didn't change any
  543. API's, and it didn't introduce any new bugs. But it ended up exposing
  544. another problem, and as such caused a kernel upgrade to fail for a
  545. user. So it got reverted.
  546. The point here being that we revert based on user-reported _behavior_,
  547. not based on some "it changes the ABI" or "it caused a bug" concept.
  548. The problem was really pre-existing, and it just didn't happen to
  549. trigger before. The better IO patterns introduced by the change just
  550. happened to expose an old bug, and people had grown to depend on the
  551. previously benign behavior of that old issue.
  552. And never fear, we'll re-introduce the fix that improved on the IO
  553. patterns once we've decided just how to handle the fact that we had a
  554. bad interaction with an interface that people had then just happened
  555. to rely on incidental behavior for before. It's just that we'll have
  556. to hash through how to do that (there are no less than three different
  557. patches by three different developers being discussed, and there might
  558. be more coming...). In the meantime, I reverted the thing that exposed
  559. the problem to users for this release, even if I hope it will be
  560. re-introduced (perhaps even backported as a stable patch) once we have
  561. consensus about the issue it exposed.
  562. Take-away from the whole thing: it's not about whether you change the
  563. kernel-userspace ABI, or fix a bug, or about whether the old code
  564. "should never have worked in the first place". It's about whether
  565. something breaks existing users' workflow.
  566. Anyway, that was my little aside on the whole regression thing. Since
  567. it's that "first rule of kernel programming", I felt it is perhaps
  568. worth just bringing it up every once in a while
  569. ..
  570. end-of-content
  571. ..
  572. This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top
  573. of the file. If you want to distribute this text under CC-BY-4.0 only,
  574. please use "The Linux kernel developers" for author attribution and link
  575. this as source:
  576. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/handling-regressions.rst
  577. ..
  578. Note: Only the content of this RST file as found in the Linux kernel sources
  579. is available under CC-BY-4.0, as versions of this text that were processed
  580. (for example by the kernel's build system) might contain content taken from
  581. files which use a more restrictive license.