reporting-regressions.rst 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. .. SPDX-License-Identifier: (GPL-2.0+ OR CC-BY-4.0)
  2. .. [see the bottom of this file for redistribution information]
  3. Reporting regressions
  4. +++++++++++++++++++++
  5. "*We don't cause regressions*" is the first rule of Linux kernel development;
  6. Linux founder and lead developer Linus Torvalds established it himself and
  7. ensures it's obeyed.
  8. This document describes what the rule means for users and how the Linux kernel's
  9. development model ensures to address all reported regressions; aspects relevant
  10. for kernel developers are left to Documentation/process/handling-regressions.rst.
  11. The important bits (aka "TL;DR")
  12. ================================
  13. #. It's a regression if something running fine with one Linux kernel works worse
  14. or not at all with a newer version. Note, the newer kernel has to be compiled
  15. using a similar configuration; the detailed explanations below describes this
  16. and other fine print in more detail.
  17. #. Report your issue as outlined in Documentation/admin-guide/reporting-issues.rst,
  18. it already covers all aspects important for regressions and repeated
  19. below for convenience. Two of them are important: start your report's subject
  20. with "[REGRESSION]" and CC or forward it to `the regression mailing list
  21. <https://lore.kernel.org/regressions/>`_ (regressions@lists.linux.dev).
  22. #. Optional, but recommended: when sending or forwarding your report, make the
  23. Linux kernel regression tracking bot "regzbot" track the issue by specifying
  24. when the regression started like this::
  25. #regzbot introduced: v5.13..v5.14-rc1
  26. All the details on Linux kernel regressions relevant for users
  27. ==============================================================
  28. The important basics
  29. --------------------
  30. What is a "regression" and what is the "no regressions" rule?
  31. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32. It's a regression if some application or practical use case running fine with
  33. one Linux kernel works worse or not at all with a newer version compiled using a
  34. similar configuration. The "no regressions" rule forbids this to take place; if
  35. it happens by accident, developers that caused it are expected to quickly fix
  36. the issue.
  37. It thus is a regression when a WiFi driver from Linux 5.13 works fine, but with
  38. 5.14 doesn't work at all, works significantly slower, or misbehaves somehow.
  39. It's also a regression if a perfectly working application suddenly shows erratic
  40. behavior with a newer kernel version; such issues can be caused by changes in
  41. procfs, sysfs, or one of the many other interfaces Linux provides to userland
  42. software. But keep in mind, as mentioned earlier: 5.14 in this example needs to
  43. be built from a configuration similar to the one from 5.13. This can be achieved
  44. using ``make olddefconfig``, as explained in more detail below.
  45. Note the "practical use case" in the first sentence of this section: developers
  46. despite the "no regressions" rule are free to change any aspect of the kernel
  47. and even APIs or ABIs to userland, as long as no existing application or use
  48. case breaks.
  49. Also be aware the "no regressions" rule covers only interfaces the kernel
  50. provides to the userland. It thus does not apply to kernel-internal interfaces
  51. like the module API, which some externally developed drivers use to hook into
  52. the kernel.
  53. How do I report a regression?
  54. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  55. Just report the issue as outlined in
  56. Documentation/admin-guide/reporting-issues.rst, it already describes the
  57. important points. The following aspects outlined there are especially relevant
  58. for regressions:
  59. * When checking for existing reports to join, also search the `archives of the
  60. Linux regressions mailing list <https://lore.kernel.org/regressions/>`_ and
  61. `regzbot's web-interface <https://linux-regtracking.leemhuis.info/regzbot/>`_.
  62. * Start your report's subject with "[REGRESSION]".
  63. * In your report, clearly mention the last kernel version that worked fine and
  64. the first broken one. Ideally try to find the exact change causing the
  65. regression using a bisection, as explained below in more detail.
  66. * Remember to let the Linux regressions mailing list
  67. (regressions@lists.linux.dev) know about your report:
  68. * If you report the regression by mail, CC the regressions list.
  69. * If you report your regression to some bug tracker, forward the submitted
  70. report by mail to the regressions list while CCing the maintainer and the
  71. mailing list for the subsystem in question.
  72. If it's a regression within a stable or longterm series (e.g.
  73. v5.15.3..v5.15.5), remember to CC the `Linux stable mailing list
  74. <https://lore.kernel.org/stable/>`_ (stable@vger.kernel.org).
  75. In case you performed a successful bisection, add everyone to the CC the
  76. culprit's commit message mentions in lines starting with "Signed-off-by:".
  77. When CCing for forwarding your report to the list, consider directly telling the
  78. aforementioned Linux kernel regression tracking bot about your report. To do
  79. that, include a paragraph like this in your mail::
  80. #regzbot introduced: v5.13..v5.14-rc1
  81. Regzbot will then consider your mail a report for a regression introduced in the
  82. specified version range. In above case Linux v5.13 still worked fine and Linux
  83. v5.14-rc1 was the first version where you encountered the issue. If you
  84. performed a bisection to find the commit that caused the regression, specify the
  85. culprit's commit-id instead::
  86. #regzbot introduced: 1f2e3d4c5d
  87. Placing such a "regzbot command" is in your interest, as it will ensure the
  88. report won't fall through the cracks unnoticed. If you omit this, the Linux
  89. kernel's regressions tracker will take care of telling regzbot about your
  90. regression, as long as you send a copy to the regressions mailing lists. But the
  91. regression tracker is just one human which sometimes has to rest or occasionally
  92. might even enjoy some time away from computers (as crazy as that might sound).
  93. Relying on this person thus will result in an unnecessary delay before the
  94. regressions becomes mentioned `on the list of tracked and unresolved Linux
  95. kernel regressions <https://linux-regtracking.leemhuis.info/regzbot/>`_ and the
  96. weekly regression reports sent by regzbot. Such delays can result in Linus
  97. Torvalds being unaware of important regressions when deciding between "continue
  98. development or call this finished and release the final?".
  99. Are really all regressions fixed?
  100. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. Nearly all of them are, as long as the change causing the regression (the
  102. "culprit commit") is reliably identified. Some regressions can be fixed without
  103. this, but often it's required.
  104. Who needs to find the root cause of a regression?
  105. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. Developers of the affected code area should try to locate the culprit on their
  107. own. But for them that's often impossible to do with reasonable effort, as quite
  108. a lot of issues only occur in a particular environment outside the developer's
  109. reach -- for example, a specific hardware platform, firmware, Linux distro,
  110. system's configuration, or application. That's why in the end it's often up to
  111. the reporter to locate the culprit commit; sometimes users might even need to
  112. run additional tests afterwards to pinpoint the exact root cause. Developers
  113. should offer advice and reasonably help where they can, to make this process
  114. relatively easy and achievable for typical users.
  115. How can I find the culprit?
  116. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117. Perform a bisection, as roughly outlined in
  118. Documentation/admin-guide/reporting-issues.rst and described in more detail by
  119. Documentation/admin-guide/bug-bisect.rst. It might sound like a lot of work, but
  120. in many cases finds the culprit relatively quickly. If it's hard or
  121. time-consuming to reliably reproduce the issue, consider teaming up with other
  122. affected users to narrow down the search range together.
  123. Who can I ask for advice when it comes to regressions?
  124. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125. Send a mail to the regressions mailing list (regressions@lists.linux.dev) while
  126. CCing the Linux kernel's regression tracker (regressions@leemhuis.info); if the
  127. issue might better be dealt with in private, feel free to omit the list.
  128. Additional details about regressions
  129. ------------------------------------
  130. What is the goal of the "no regressions" rule?
  131. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  132. Users should feel safe when updating kernel versions and not have to worry
  133. something might break. This is in the interest of the kernel developers to make
  134. updating attractive: they don't want users to stay on stable or longterm Linux
  135. series that are either abandoned or more than one and a half years old. That's
  136. in everybody's interest, as `those series might have known bugs, security
  137. issues, or other problematic aspects already fixed in later versions
  138. <http://www.kroah.com/log/blog/2018/08/24/what-stable-kernel-should-i-use/>`_.
  139. Additionally, the kernel developers want to make it simple and appealing for
  140. users to test the latest pre-release or regular release. That's also in
  141. everybody's interest, as it's a lot easier to track down and fix problems, if
  142. they are reported shortly after being introduced.
  143. Is the "no regressions" rule really adhered in practice?
  144. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  145. It's taken really seriously, as can be seen by many mailing list posts from
  146. Linux creator and lead developer Linus Torvalds, some of which are quoted in
  147. Documentation/process/handling-regressions.rst.
  148. Exceptions to this rule are extremely rare; in the past developers almost always
  149. turned out to be wrong when they assumed a particular situation was warranting
  150. an exception.
  151. Who ensures the "no regressions" rule is actually followed?
  152. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153. The subsystem maintainers should take care of that, which are watched and
  154. supported by the tree maintainers -- e.g. Linus Torvalds for mainline and
  155. Greg Kroah-Hartman et al. for various stable/longterm series.
  156. All of them are helped by people trying to ensure no regression report falls
  157. through the cracks. One of them is Thorsten Leemhuis, who's currently acting as
  158. the Linux kernel's "regressions tracker"; to facilitate this work he relies on
  159. regzbot, the Linux kernel regression tracking bot. That's why you want to bring
  160. your report on the radar of these people by CCing or forwarding each report to
  161. the regressions mailing list, ideally with a "regzbot command" in your mail to
  162. get it tracked immediately.
  163. How quickly are regressions normally fixed?
  164. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  165. Developers should fix any reported regression as quickly as possible, to provide
  166. affected users with a solution in a timely manner and prevent more users from
  167. running into the issue; nevertheless developers need to take enough time and
  168. care to ensure regression fixes do not cause additional damage.
  169. The answer thus depends on various factors like the impact of a regression, its
  170. age, or the Linux series in which it occurs. In the end though, most regressions
  171. should be fixed within two weeks.
  172. Is it a regression, if the issue can be avoided by updating some software?
  173. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  174. Almost always: yes. If a developer tells you otherwise, ask the regression
  175. tracker for advice as outlined above.
  176. Is it a regression, if a newer kernel works slower or consumes more energy?
  177. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  178. Yes, but the difference has to be significant. A five percent slow-down in a
  179. micro-benchmark thus is unlikely to qualify as regression, unless it also
  180. influences the results of a broad benchmark by more than one percent. If in
  181. doubt, ask for advice.
  182. Is it a regression, if an external kernel module breaks when updating Linux?
  183. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  184. No, as the "no regression" rule is about interfaces and services the Linux
  185. kernel provides to the userland. It thus does not cover building or running
  186. externally developed kernel modules, as they run in kernel-space and hook into
  187. the kernel using internal interfaces occasionally changed.
  188. How are regressions handled that are caused by security fixes?
  189. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  190. In extremely rare situations security issues can't be fixed without causing
  191. regressions; those fixes are given way, as they are the lesser evil in the end.
  192. Luckily this middling almost always can be avoided, as key developers for the
  193. affected area and often Linus Torvalds himself try very hard to fix security
  194. issues without causing regressions.
  195. If you nevertheless face such a case, check the mailing list archives if people
  196. tried their best to avoid the regression. If not, report it; if in doubt, ask
  197. for advice as outlined above.
  198. What happens if fixing a regression is impossible without causing another?
  199. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  200. Sadly these things happen, but luckily not very often; if they occur, expert
  201. developers of the affected code area should look into the issue to find a fix
  202. that avoids regressions or at least their impact. If you run into such a
  203. situation, do what was outlined already for regressions caused by security
  204. fixes: check earlier discussions if people already tried their best and ask for
  205. advice if in doubt.
  206. A quick note while at it: these situations could be avoided, if people would
  207. regularly give mainline pre-releases (say v5.15-rc1 or -rc3) from each
  208. development cycle a test run. This is best explained by imagining a change
  209. integrated between Linux v5.14 and v5.15-rc1 which causes a regression, but at
  210. the same time is a hard requirement for some other improvement applied for
  211. 5.15-rc1. All these changes often can simply be reverted and the regression thus
  212. solved, if someone finds and reports it before 5.15 is released. A few days or
  213. weeks later this solution can become impossible, as some software might have
  214. started to rely on aspects introduced by one of the follow-up changes: reverting
  215. all changes would then cause a regression for users of said software and thus is
  216. out of the question.
  217. Is it a regression, if some feature I relied on was removed months ago?
  218. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  219. It is, but often it's hard to fix such regressions due to the aspects outlined
  220. in the previous section. It hence needs to be dealt with on a case-by-case
  221. basis. This is another reason why it's in everybody's interest to regularly test
  222. mainline pre-releases.
  223. Does the "no regression" rule apply if I seem to be the only affected person?
  224. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  225. It does, but only for practical usage: the Linux developers want to be free to
  226. remove support for hardware only to be found in attics and museums anymore.
  227. Note, sometimes regressions can't be avoided to make progress -- and the latter
  228. is needed to prevent Linux from stagnation. Hence, if only very few users seem
  229. to be affected by a regression, it for the greater good might be in their and
  230. everyone else's interest to lettings things pass. Especially if there is an
  231. easy way to circumvent the regression somehow, for example by updating some
  232. software or using a kernel parameter created just for this purpose.
  233. Does the regression rule apply for code in the staging tree as well?
  234. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  235. Not according to the `help text for the configuration option covering all
  236. staging code <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/Kconfig>`_,
  237. which since its early days states::
  238. Please note that these drivers are under heavy development, may or
  239. may not work, and may contain userspace interfaces that most likely
  240. will be changed in the near future.
  241. The staging developers nevertheless often adhere to the "no regressions" rule,
  242. but sometimes bend it to make progress. That's for example why some users had to
  243. deal with (often negligible) regressions when a WiFi driver from the staging
  244. tree was replaced by a totally different one written from scratch.
  245. Why do later versions have to be "compiled with a similar configuration"?
  246. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  247. Because the Linux kernel developers sometimes integrate changes known to cause
  248. regressions, but make them optional and disable them in the kernel's default
  249. configuration. This trick allows progress, as the "no regressions" rule
  250. otherwise would lead to stagnation.
  251. Consider for example a new security feature blocking access to some kernel
  252. interfaces often abused by malware, which at the same time are required to run a
  253. few rarely used applications. The outlined approach makes both camps happy:
  254. people using these applications can leave the new security feature off, while
  255. everyone else can enable it without running into trouble.
  256. How to create a configuration similar to the one of an older kernel?
  257. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  258. Start your machine with a known-good kernel and configure the newer Linux
  259. version with ``make olddefconfig``. This makes the kernel's build scripts pick
  260. up the configuration file (the ".config" file) from the running kernel as base
  261. for the new one you are about to compile; afterwards they set all new
  262. configuration options to their default value, which should disable new features
  263. that might cause regressions.
  264. Can I report a regression I found with pre-compiled vanilla kernels?
  265. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  266. You need to ensure the newer kernel was compiled with a similar configuration
  267. file as the older one (see above), as those that built them might have enabled
  268. some known-to-be incompatible feature for the newer kernel. If in doubt, report
  269. the matter to the kernel's provider and ask for advice.
  270. More about regression tracking with "regzbot"
  271. ---------------------------------------------
  272. What is regression tracking and why should I care about it?
  273. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274. Rules like "no regressions" need someone to ensure they are followed, otherwise
  275. they are broken either accidentally or on purpose. History has shown this to be
  276. true for Linux kernel development as well. That's why Thorsten Leemhuis, the
  277. Linux Kernel's regression tracker, and some people try to ensure all regression
  278. are fixed by keeping an eye on them until they are resolved. Neither of them are
  279. paid for this, that's why the work is done on a best effort basis.
  280. Why and how are Linux kernel regressions tracked using a bot?
  281. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  282. Tracking regressions completely manually has proven to be quite hard due to the
  283. distributed and loosely structured nature of Linux kernel development process.
  284. That's why the Linux kernel's regression tracker developed regzbot to facilitate
  285. the work, with the long term goal to automate regression tracking as much as
  286. possible for everyone involved.
  287. Regzbot works by watching for replies to reports of tracked regressions.
  288. Additionally, it's looking out for posted or committed patches referencing such
  289. reports with "Link:" tags; replies to such patch postings are tracked as well.
  290. Combined this data provides good insights into the current state of the fixing
  291. process.
  292. How to see which regressions regzbot tracks currently?
  293. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  294. Check out `regzbot's web-interface <https://linux-regtracking.leemhuis.info/regzbot/>`_.
  295. What kind of issues are supposed to be tracked by regzbot?
  296. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  297. The bot is meant to track regressions, hence please don't involve regzbot for
  298. regular issues. But it's okay for the Linux kernel's regression tracker if you
  299. involve regzbot to track severe issues, like reports about hangs, corrupted
  300. data, or internal errors (Panic, Oops, BUG(), warning, ...).
  301. How to change aspects of a tracked regression?
  302. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  303. By using a 'regzbot command' in a direct or indirect reply to the mail with the
  304. report. The easiest way to do that: find the report in your "Sent" folder or the
  305. mailing list archive and reply to it using your mailer's "Reply-all" function.
  306. In that mail, use one of the following commands in a stand-alone paragraph (IOW:
  307. use blank lines to separate one or multiple of these commands from the rest of
  308. the mail's text).
  309. * Update when the regression started to happen, for example after performing a
  310. bisection::
  311. #regzbot introduced: 1f2e3d4c5d
  312. * Set or update the title::
  313. #regzbot title: foo
  314. * Monitor a discussion or bugzilla.kernel.org ticket where additions aspects of
  315. the issue or a fix are discussed:::
  316. #regzbot monitor: https://lore.kernel.org/r/30th.anniversary.repost@klaava.Helsinki.FI/
  317. #regzbot monitor: https://bugzilla.kernel.org/show_bug.cgi?id=123456789
  318. * Point to a place with further details of interest, like a mailing list post
  319. or a ticket in a bug tracker that are slightly related, but about a different
  320. topic::
  321. #regzbot link: https://bugzilla.kernel.org/show_bug.cgi?id=123456789
  322. * Mark a regression as invalid::
  323. #regzbot invalid: wasn't a regression, problem has always existed
  324. Regzbot supports a few other commands primarily used by developers or people
  325. tracking regressions. They and more details about the aforementioned regzbot
  326. commands can be found in the `getting started guide
  327. <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/getting_started.md>`_ and
  328. the `reference documentation <https://gitlab.com/knurd42/regzbot/-/blob/main/docs/reference.md>`_
  329. for regzbot.
  330. ..
  331. end-of-content
  332. ..
  333. This text is available under GPL-2.0+ or CC-BY-4.0, as stated at the top
  334. of the file. If you want to distribute this text under CC-BY-4.0 only,
  335. please use "The Linux kernel developers" for author attribution and link
  336. this as source:
  337. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/admin-guide/reporting-regressions.rst
  338. ..
  339. Note: Only the content of this RST file as found in the Linux kernel sources
  340. is available under CC-BY-4.0, as versions of this text that were processed
  341. (for example by the kernel's build system) might contain content taken from
  342. files which use a more restrictive license.