handling-regressions.rst 35 KB

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