2024-04-09 07:32:06

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 0/6] docs: verify/bisect: fine tuning, testing fixes, build host, order

A quick series with various improvements for
Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst after
receiving feedback on the text or seeing people struggle with certain
tasks.

* The first two patches contains various fixes and some fine tuning.

* The third is mainly a layout improvement that results in a somewhat
large patch.

* The fourth adds instructions for later testing of reverts, fixes, or
newer versions. This was already hinted at; but during some early
work on Documentation/admin-guide/reporting-issues.rst to better
reconcile the two it seemed wise to cover this properly here.

* The fifth patch briefly outlines how to build kernels on a different
host; it came into being after a second user within one week asked for
this. That also allowed the text to briefly cover cross-compilation.

* The sixth makes users that face a regression within a stable series
test that series first before they are told to test mainline.
---

Hi! While at it let me mention one more thing unrelated to the changes
that came up where I'm unsure if the current approach by the text was
a wise choice:

* Should the document tell users to avoid mainline during merge windows?

Some input from the community on this would be splendid.

Ciao, Thorsten

P.S.: Not totally sure, but I think this should go into 6.9 as this is
a new document; if not I guess it would be wise to pick the first two,
as they fix bugs.

Thorsten Leemhuis (6):
docs: verify/bisect: use git switch, tag kernel, and various fixes
docs: verify/bisect: add and fetch stable branches ahead of time
docs: verify/bisect: proper headlines and more spacing
docs: verify/bisect: explain testing reverts, patches and newer code
docs: verify/bisect: describe how to use a build host
docs: verify/bisect: stable regressions: first stable, then mainline

.../verify-bugs-and-bisect-regressions.rst | 597 ++++++++++++------
1 file changed, 417 insertions(+), 180 deletions(-)


base-commit: b8cfda5c9065cd619a97c17da081cbfab3b1e756
--
2.44.0



2024-04-09 07:32:08

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 2/6] docs: verify/bisect: add and fetch stable branches ahead of time

Add and fetch all required stable branches ahead of time. This fixes a
bug, as readers that wanted to bisect a regression within a stable or
longterm series otherwise did not have them available at the right time.
This way also matches the flow somewhat better and avoids some "if you
haven't already added it" phrases that otherwise become necessary in
future changes.

Signed-off-by: Thorsten Leemhuis <[email protected]>
---
.../verify-bugs-and-bisect-regressions.rst | 31 +++++++++++--------
1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index c999e40c79ab7f..06278501a4bdcc 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -136,8 +136,7 @@ will be considered the 'good' release and used to prepare the .config file.

* **Segment 3**: perform and validate the bisection.

- a) In case your 'broken' version is a stable/longterm release, add the Git
- branch holding it::
+ a) Retrieve the sources for your 'bad' version::

git remote set-branches --add stable linux-6.1.y
git fetch stable
@@ -371,6 +370,21 @@ Preparations: set up everything to build your own kernels

[:ref:`details<sources_bisref>`]

+.. _stablesources_bissbs:
+
+* Retrieve the sources for any stable or longterm series you might need.
+
+ Is the version you earlier established as 'bad' a stable or longterm release?
+ Then download the code for the series it belongs to ('linux-6.1.y' in this
+ example)::
+
+ git remote set-branches --add stable linux-6.1.y
+ git fetch stable
+
+ If the version earlier established as 'good' is from a different stable or
+ longterm series (say 6.0.13), repeat the previous step, but this time for the
+ branch holding the series the 'good' version belongs to (e.g. linux-6.0.y).
+
.. _oldconfig_bissbs:

* Start preparing a kernel build configuration (the '.config' file).
@@ -620,12 +634,10 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
reproduce it with the mainline kernel you just built? One that according to
the `front page of kernel.org <https://kernel.org/>`_ is still supported? Then
check if the latest codebase for the particular series might already fix the
- problem. To do so, add the stable series Git branch for your 'good' kernel
- (again, this here is assumed to be 6.0) and check out the latest version::
+ problem. To do so, check out that series latest version (again, this here is
+ assumed to be 6.0)::

cd ~/linux/
- git remote set-branches --add stable linux-6.0.y
- git fetch stable
git switch --discard-changes --detach linux-6.0.y

Now use the checked out code to build and install another kernel using the
@@ -717,13 +729,6 @@ configuration created earlier this works a lot faster than many people assume:
overall on average it will often just take about 10 to 15 minutes to compile
each kernel on commodity x86 machines.

-* In case your 'bad' version is a stable/longterm release (say 6.1.5), add its
- stable branch, unless you already did so earlier::
-
- cd ~/linux/
- git remote set-branches --add stable linux-6.1.y
- git fetch stable
-
.. _bisectstart_bissbs:

* Start the bisection and tell Git about the versions earlier established as
--
2.44.0


2024-04-09 07:32:12

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 6/6] docs: verify/bisect: stable regressions: first stable, then mainline

Rearrange the instructions so that readers facing a regression within a
stable or longterm series first test its latest release before testing
mainline. This is less scary for some people. It also reduces the chance
that something goes sideways for readers that compile their first
kernel, as mainline can cause slightly more trouble.

Signed-off-by: Thorsten Leemhuis <[email protected]>
---
.../verify-bugs-and-bisect-regressions.rst | 91 +++++++++++--------
1 file changed, 51 insertions(+), 40 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index 6193c797642732..c389d4fd7599df 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -309,31 +309,32 @@ machine; if you want to compile the kernel on another system, check
.. _rangecheck_bissbs:

* Determine the kernel versions considered 'good' and 'bad' throughout this
- guide.
+ guide:

- Do you follow this guide to verify if a bug is present in the code developers
- care for? Then consider the mainline release your 'working' kernel (the newest
- one you regularly use) is based on to be the 'good' version; if your 'working'
- kernel for example is 6.0.13, then your 'good' kernel is 6.0.
+ * Do you follow this guide to verify if a bug is present in the code the
+ primary developers care for? Then consider the version of the newest kernel
+ you regularly use currently as 'good' (e.g. 6.0, 6.0.13, or 6.1-rc2).

- In case you face a regression, it depends on the version range where the
- regression was introduced:
+ * Do you face a regression, e.g. something broke or works worse after
+ switching to a newer kernel version? In that case it depends on the version
+ range during which the problem appeared:

- * Something which used to work in Linux 6.0 broke when switching to Linux
- 6.1-rc1? Then henceforth regard 6.0 as the last known 'good' version
- and 6.1-rc1 as the first 'bad' one.
+ * Something regressed when updating from a stable/longterm release
+ (say 6.0.13) to a newer mainline series (like 6.1-rc7 or 6.1) or a
+ stable/longterm version based on one (say 6.1.5)? Then consider the
+ mainline release your working kernel is based on to be the 'good'
+ version (e.g. 6.0) and the first version to be broken as the 'bad' one
+ (e.g. 6.1-rc7, 6.1, or 6.1.5). Note, at this point it is merely assumed
+ that 6.0 is fine; this hypothesis will be checked in segment 2.

- * Some function stopped working when updating from 6.0.13 to 6.1.5? Then for
- the time being consider 6.0 as the last 'good' version and 6.1.5 as
- the 'bad' one. Note, at this point it is merely assumed that 6.0 is fine;
- this assumption will be checked in segment 2.
+ * Something regressed when switching from one mainline version (say 6.0) to
+ a later one (like 6.1-rc1) or a stable/longterm release based on it
+ (say 6.1.5)? Then regard the last working version (e.g. 6.0) as 'good' and
+ the first broken (e.g. 6.1-rc1 or 6.1.5) as 'bad'.

- * A feature you used in 6.0.13 does not work at all or worse in 6.1.15? In
- that case you want to bisect within a stable/longterm series: consider
- 6.0.13 as the last known 'good' version and 6.0.15 as the first 'bad'
- one. Note, in this case you still want to compile and test a mainline kernel
- as explained in segment 1: the outcome will determine if you need to report
- your issue to the regular developers or the stable team.
+ * Something regressed when updating within a stable/longterm series (say
+ from 6.0.13 to 6.0.15)? Then consider those versions as 'good' and 'bad'
+ (e.g. 6.0.13 and 6.0.15), as you need to bisect within that series.

*Note, do not confuse 'good' version with 'working' kernel; the latter term
throughout this guide will refer to the last kernel that has been working
@@ -392,19 +393,13 @@ machine; if you want to compile the kernel on another system, check

.. _stablesources_bissbs:

-* Retrieve the sources for any stable or longterm series you might need.
-
- Is the version you earlier established as 'bad' a stable or longterm release?
- Then download the code for the series it belongs to ('linux-6.1.y' in this
- example)::
+* Is one of the versions you earlier established as 'good' or 'bad' a stable or
+ longterm release (say 6.1.5)? Then download the code for the series it belongs
+ to ('linux-6.1.y' in this example)::

git remote set-branches --add stable linux-6.1.y
git fetch stable

- If the version earlier established as 'good' is from a different stable or
- longterm series (say 6.0.13), repeat the previous step, but this time for the
- branch holding the series the 'good' version belongs to (e.g. linux-6.0.y).
-
.. _oldconfig_bissbs:

* Start preparing a kernel build configuration (the '.config' file).
@@ -545,10 +540,24 @@ be a waste of time. [:ref:`details <introlatestcheck_bisref>`]

.. _checkoutmaster_bissbs:

-* Check out the latest Linux codebase::
+* Check out the latest Linux codebase.

- cd ~/linux/
- git switch --discard-changes --detach mainline/master
+ * Are your 'good' and 'bad' versions from the same stable or longterm series?
+ Then check the `front page of kernel.org <https://kernel.org/>`_: if it
+ lists a release from that series without an '[EOL]' tag, checkout the series
+ latest version ('linux-6.1.y' in the following example)::
+
+ cd ~/linux/
+ git switch --discard-changes --detach stable/linux-6.1.y
+
+ Your series is unsupported, if is not listed or carrying a 'end of life'
+ tag. In that case you might want to check if a successor series (say
+ linux-6.2.y) or mainline (see next point) fix the bug.
+
+ * In all other cases, run::
+
+ cd ~/linux/
+ git switch --discard-changes --detach mainline/master

[:ref:`details <checkoutmaster_bisref>`]

@@ -650,15 +659,15 @@ be a waste of time. [:ref:`details <introlatestcheck_bisref>`]

.. _recheckstablebroken_bissbs:

-* Are you facing a problem within a stable/longterm series, but failed to
- reproduce it with the mainline kernel you just built? One that according to
- the `front page of kernel.org <https://kernel.org/>`_ is still supported? Then
- check if the latest codebase for the particular series might already fix the
- problem. To do so, check out that series latest version (again, this here is
- assumed to be 6.0)::
+* Did you just built a stable or longterm kernel? And were you able to reproduce
+ the regression with it? Then you should test the latest mainline codebase as
+ well, because the result determines which developers the bug must be submitted
+ to.
+
+ To prepare that test, check out current mainline::

cd ~/linux/
- git switch --discard-changes --detach linux-6.0.y
+ git switch --discard-changes --detach mainline/master

Now use the checked out code to build and install another kernel using the
commands the earlier steps already described in more detail::
@@ -680,7 +689,9 @@ be a waste of time. [:ref:`details <introlatestcheck_bisref>`]
uname -r
cat /proc/sys/kernel/tainted

- Now verify if this kernel is showing the problem.
+ Now verify if this kernel is showing the problem. If it does, then you need
+ to report the bug to the primary developers; if it does not, report it to the
+ stable team. See Documentation/admin-guide/reporting-issues.rst for details.

[:ref:`details <recheckstablebroken_bisref>`]

--
2.44.0


2024-04-09 07:32:14

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 4/6] docs: verify/bisect: explain testing reverts, patches and newer code

Rename 'Supplementary tasks' to 'Complementary tasks' while introducing
a section 'Optional tasks: test reverts, patches, or later versions':
the latter is something readers occasionally will have to do after
reporting a bug and thus is best covered here.

Signed-off-by: Thorsten Leemhuis <[email protected]>
---
.../verify-bugs-and-bisect-regressions.rst | 128 ++++++++++++++++--
1 file changed, 115 insertions(+), 13 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index 355c2cea5230d9..1987c827211fce 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -160,7 +160,7 @@ will be considered the 'good' release and used to prepare the .config file.
this step (e.g. build, install, boot, and test a kernel to then tell Git
the outcome). Do so again and again until Git shows which commit broke
things. If you run short of disk space during this process, check the
- section 'Supplementary tasks: cleanup during and after the process'
+ section 'Complementary tasks: cleanup during and after the process'
below.

d) Once your finished the bisection, put a few things away::
@@ -182,7 +182,7 @@ will be considered the 'good' release and used to prepare the .config file.
kernel; just this time skip the first command copying the base .config file
over, as that already has been taken care off.

-* **Supplementary tasks**: cleanup during and after the process.
+* **Complementary tasks**: cleanup during and after the process.

a) To avoid running out of disk space during a bisection, you might need to
remove some kernels you built earlier. You most likely want to keep those
@@ -205,6 +205,18 @@ will be considered the 'good' release and used to prepare the .config file.
the kernels you built earlier and later you might want to keep around for
a week or two.

+* **Optional task**: test a debug patch or a proposed fix later::
+
+ git fetch mainline
+ git switch --discard-changes --detach mainline/master
+ git apply /tmp/foobars-proposed-fix-v1.patch
+ cp ~/kernel-config-working .config
+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-foobars-fix-v1'
+
+ Build, install, and boot a kernel as described in *segment 1, section b* --
+ but this time omit the first command copying the build configuration over,
+ as that has been taken care of already.
+
.. _introguide_bissbs:

Step-by-step guide on how to verify bugs and bisect regressions
@@ -232,7 +244,9 @@ developers are obliged to act upon.

:ref:`Segment 3: perform a bisection and validate the result <introbisect_bissbs>`.

- :ref:`Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.
+ :ref:`Complementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.
+
+ :ref:`Optional tasks: test reverts, patches, or later versions <introoptional_bissbs>`.

The steps in each segment illustrate the important aspects of the process, while
a comprehensive reference section holds additional details for almost all of the
@@ -669,7 +683,7 @@ be a waste of time. [:ref:`details <introlatestcheck_bisref>`]
Do you follow this guide to verify if a problem is present in the code
currently supported by Linux kernel developers? Then you are done at this
point. If you later want to remove the kernel you just built, check out
-:ref:`Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.
+:ref:`Complementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.

In case you face a regression, move on and execute at least the next segment
as well.
@@ -888,7 +902,7 @@ each kernel on commodity x86 machines.

.. _introclosure_bissbs:

-Supplementary tasks: cleanup during and after the bisection
+Complementary tasks: cleanup during and after the bisection
-----------------------------------------------------------

During and after following this guide you might want or need to remove some of
@@ -950,6 +964,81 @@ space might run out.

[:ref:`details <finishingtouch_bisref>`]

+.. _introoptional_bissbs:
+
+Optional: test reverts, patches, or later versions
+--------------------------------------------------
+
+While or after reporting a bug, you might want or potentially will be asked to
+test reverts, debug patches, proposed fixes, or other versions. In that case
+follow these instructions.
+
+* Update your Git clone and check out the latest code.
+
+ * In case you want to test mainline, fetch its latest changes before checking
+ its code out::
+
+ git fetch mainline
+ git switch --discard-changes --detach mainline/master
+
+ * In case you want to test a stable or longterm kernel, first add the branch
+ holding the series you are interested in (6.2 in the example), unless you
+ already did so earlier::
+
+ git remote set-branches --add stable linux-6.2.y
+
+ Then fetch the latest changes and check out the latest version from the
+ series::
+
+ git fetch stable
+ git switch --discard-changes --detach stable/linux-6.2.y
+
+* Copy your kernel build configuration over::
+
+ cp ~/kernel-config-working .config
+
+* Your next step depends on what you want to do:
+
+ * In case you just want to test the latest codebase, head to the next step,
+ you are already all set.
+
+ * In case you want to test if a revert fixes an issue, revert one or multiple
+ changes by specifying their commit ids::
+
+ git revert --no-edit cafec0cacaca0
+
+ Now give that kernel a special tag to facilitates its identification and
+ prevent accidentally overwriting another kernel::
+
+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-cafec0cacaca0-reverted'
+
+ * In case you want to test a patch, store the patch in a file like
+ '/tmp/foobars-proposed-fix-v1.patch' and apply it like this::
+
+ git apply /tmp/foobars-proposed-fix-v1.patch
+
+ In case of multiple patches, repeat this step with the others.
+
+ Now give that kernel a special tag to facilitates its identification and
+ prevent accidentally overwriting another kernel::
+
+ ./scripts/config --set-str CONFIG_LOCALVERSION '-local-foobars-fix-v1'
+
+* Build a kernel using the familiar commands, just without copying the kernel
+ build configuration over, as that has been taken care of already::
+
+ make olddefconfig &&
+ make -j $(nproc --all)
+ # * Check if the free space suffices holding another kernel:
+ df -h /boot/ /lib/modules/
+ sudo make modules_install
+ command -v installkernel && sudo make install
+ make -s kernelrelease | tee -a ~/kernels-built
+ reboot
+
+* Now verify you booted the newly built kernel and check it.
+
+[:ref:`details <introoptional_bisref>`]

.. _submit_improvements:

@@ -1986,20 +2075,33 @@ build artifacts and the Linux sources, but will leave the Git repository
(~/linux/.git/) behind -- a simple ``git reset --hard`` thus will bring the
sources back.

-Removing the repository as well would likely be unwise at this point: there is a
-decent chance developers will ask you to build another kernel to perform
-additional tests. This is often required to debug an issue or check proposed
-fixes. Before doing so you want to run the ``git fetch mainline`` command again
-followed by ``git checkout mainline/master`` to bring your clone up to date and
-checkout the latest codebase. Then apply the patch using ``git apply
-<filename>`` or ``git am <filename>`` and build yet another kernel using the
-familiar commands.
+Removing the repository as well would likely be unwise at this point: there
+is a decent chance developers will ask you to build another kernel to
+perform additional tests -- like testing a debug patch or a proposed fix.
+Details on how to perform those can be found in the section :ref:`Optional
+tasks: test reverts, patches, or later versions <introoptional_bissbs>`.

Additional tests are also the reason why you want to keep the
~/kernel-config-working file around for a few weeks.

[:ref:`back to step-by-step guide <finishingtouch_bissbs>`]

+.. _introoptional_bisref:
+
+Test reverts, patches, or later versions
+----------------------------------------
+
+ *While or after reporting a bug, you might want or potentially will be asked
+ to test reverts, patches, proposed fixes, or other versions.*
+ [:ref:`... <introoptional_bissbs>`]
+
+All the commands used in this section should be pretty straight forward, so
+there is not much to add except one thing: when setting a kernel tag as
+instructed, ensure it is not much longer than the one used in the example, as
+problems will arise if the kernelrelease identifier exceeds 63 characters.
+
+[:ref:`back to step-by-step guide <introoptional_bissbs>`].
+

Additional reading material
===========================
--
2.44.0


2024-04-09 07:33:02

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 5/6] docs: verify/bisect: describe how to use a build host

Describe how to build kernels on another system (with and without
cross-compiling), as building locally can be quite painfully on some
slow systems. This is done in an add-on section, as it would make the
step-by-step guide to complicated if this special case would be
described there.

Signed-off-by: Thorsten Leemhuis <[email protected]>
---
.../verify-bugs-and-bisect-regressions.rst | 78 ++++++++++++++++++-
1 file changed, 74 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index 1987c827211fce..6193c797642732 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -276,6 +276,10 @@ Preparations: set up everything to build your own kernels

The following steps lay the groundwork for all further tasks.

+Note: the instructions assume you are building and testing on the same
+machine; if you want to compile the kernel on another system, check
+:ref:`Build kernels on a different machine <buildhost_bis>` below.
+
.. _backup_bissbs:

* Create a fresh backup and put system repair and restore tools at hand, just
@@ -2103,11 +2107,77 @@ problems will arise if the kernelrelease identifier exceeds 63 characters.
[:ref:`back to step-by-step guide <introoptional_bissbs>`].


-Additional reading material
-===========================
+Additional information
+======================
+
+.. _buildhost_bis:
+
+Build kernels on a different machine
+------------------------------------
+
+To compile kernels on another system, slightly alter the step-by-step guide's
+instructions:
+
+* Start following the guide on the machine where you want to install and test
+ the kernels later.
+
+* After executing ':ref:`Boot into the working kernel and briefly use the
+ apparently broken feature <bootworking_bissbs>`', save the list of loaded
+ modules to a file using ``lsmod > ~/test-machine-lsmod``. Then locate the
+ build configuration for the running kernel (see ':ref:`Start defining the
+ build configuration for your kernel <oldconfig_bisref>`' for hints on where
+ to find it) and store it as '~/test-machine-config-working'. Transfer both
+ files to the home directory of your build host.
+
+* Continue the guide on the build host (e.g. with ':ref:`Ensure to have enough
+ free space for building [...] <diskspace_bissbs>`').
+
+* When you reach ':ref:`Start preparing a kernel build configuration[...]
+ <oldconfig_bissbs>`': before running ``make olddefconfig`` for the first time,
+ execute the following command to base your configuration on the one from the
+ test machine's 'working' kernel::
+
+ cp ~/test-machine-config-working ~/linux/.config
+
+* During the next step to ':ref:`disable any apparently superfluous kernel
+ modules <localmodconfig_bissbs>`' use the following command instead::
+
+ yes '' | make localmodconfig LSMOD=~/lsmod_foo-machine localmodconfig
+
+* Continue the guide, but ignore the instructions outlining how to compile,
+ install, and reboot into a kernel every time they come up. Instead build
+ like this::

-Further sources
----------------
+ cp ~/kernel-config-working .config
+ make olddefconfig &&
+ make -j $(nproc --all) targz-pkg
+
+ This will generate a gzipped tar file whose name is printed in the last
+ line shown; for example, a kernel with the kernelrelease identifier
+ '6.0.0-rc1-local-g928a87efa423' built for x86 machines usually will
+ be stored as '~/linux/linux-6.0.0-rc1-local-g928a87efa423-x86.tar.gz'.
+
+ Copy that file to your test machine's home directory.
+
+* Switch to the test machine to check if you have enough space to hold another
+ kernel. Then extract the file you transferred::
+
+ sudo tar -xvzf ~/linux-6.0.0-rc1-local-g928a87efa423-x86.tar.gz -C /
+
+ Afterwards :ref:`generate the initramfs and add the kernel to your boot
+ loader's configuration <install_bisref>`; on some distributions the following
+ command will take care of both these tasks::
+
+ sudo /sbin/installkernel 6.0.0-rc1-local-g928a87efa423 /boot/vmlinuz-6.0.0-rc1-local-g928a87efa423
+
+ Now reboot and ensure you started the intended kernel.
+
+This approach even works when building for another architecture: just install
+cross-compilers and add the appropriate parameters to every invocation of make
+(e.g. ``make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- [...]``).
+
+Additional reading material
+---------------------------

* The `man page for 'git bisect' <https://git-scm.com/docs/git-bisect>`_ and
`fighting regressions with 'git bisect' <https://git-scm.com/docs/git-bisect-lk2009.html>`_
--
2.44.0


2024-04-09 07:35:33

by Thorsten Leemhuis

[permalink] [raw]
Subject: [PATCH v2 3/6] docs: verify/bisect: proper headlines and more spacing

Various small improvements and fixes:

* Separate ref links from their target with a space for better
readability.

* Add a proper heading for the note at the end of the step-by-step
guide.

* Use proper 3rd and 4th level headlines in the reference section and
add short intros for the 2nd level headlines that lacked one.

Signed-off-by: Thorsten Leemhuis <[email protected]>
---
.../verify-bugs-and-bisect-regressions.rst | 194 ++++++++++--------
1 file changed, 113 insertions(+), 81 deletions(-)

diff --git a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
index 06278501a4bdcc..355c2cea5230d9 100644
--- a/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
+++ b/Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst
@@ -29,7 +29,7 @@ The essence of the process (aka 'TL;DR')
========================================

*[If you are new to building or bisecting Linux, ignore this section and head
-over to the* ":ref:`step-by-step guide<introguide_bissbs>`" *below. It utilizes
+over to the* ':ref:`step-by-step guide <introguide_bissbs>`' *below. It utilizes
the same commands as this section while describing them in brief fashion. The
steps are nevertheless easy to follow and together with accompanying entries
in a reference section mention many alternatives, pitfalls, and additional
@@ -224,15 +224,15 @@ report; instead of the latter your could also head straight on and follow
*segment 3* to **perform a bisection** for a full-fledged regression report
developers are obliged to act upon.

- :ref:`Preparations: set up everything to build your own kernels.<introprep_bissbs>`
+ :ref:`Preparations: set up everything to build your own kernels <introprep_bissbs>`.

- :ref:`Segment 1: try to reproduce the problem with the latest codebase.<introlatestcheck_bissbs>`
+ :ref:`Segment 1: try to reproduce the problem with the latest codebase <introlatestcheck_bissbs>`.

- :ref:`Segment 2: check if the kernels you build work fine.<introworkingcheck_bissbs>`
+ :ref:`Segment 2: check if the kernels you build work fine <introworkingcheck_bissbs>`.

- :ref:`Segment 3: perform a bisection and validate the result.<introbisect_bissbs>`
+ :ref:`Segment 3: perform a bisection and validate the result <introbisect_bissbs>`.

- :ref:`Supplementary tasks: cleanup during and after following this guide.<introclosure_bissbs>`
+ :ref:`Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.

The steps in each segment illustrate the important aspects of the process, while
a comprehensive reference section holds additional details for almost all of the
@@ -260,12 +260,14 @@ improve it, :ref:`please let the kernel developers know <submit_improvements>`.
Preparations: set up everything to build your own kernels
---------------------------------------------------------

+The following steps lay the groundwork for all further tasks.
+
.. _backup_bissbs:

* Create a fresh backup and put system repair and restore tools at hand, just
to be prepared for the unlikely case of something going sideways.

- [:ref:`details<backup_bisref>`]
+ [:ref:`details <backup_bisref>`]

.. _vanilla_bissbs:

@@ -273,7 +275,7 @@ Preparations: set up everything to build your own kernels
builds them automatically. That includes but is not limited to DKMS, openZFS,
VirtualBox, and Nvidia's graphics drivers (including the GPLed kernel module).

- [:ref:`details<vanilla_bisref>`]
+ [:ref:`details <vanilla_bisref>`]

.. _secureboot_bissbs:

@@ -284,7 +286,7 @@ Preparations: set up everything to build your own kernels
their restrictions through a process initiated by
``mokutil --disable-validation``.

- [:ref:`details<secureboot_bisref>`]
+ [:ref:`details <secureboot_bisref>`]

.. _rangecheck_bissbs:

@@ -319,13 +321,13 @@ Preparations: set up everything to build your own kernels
throughout this guide will refer to the last kernel that has been working
fine.*

- [:ref:`details<rangecheck_bisref>`]
+ [:ref:`details <rangecheck_bisref>`]

.. _bootworking_bissbs:

* Boot into the 'working' kernel and briefly use the apparently broken feature.

- [:ref:`details<bootworking_bisref>`]
+ [:ref:`details <bootworking_bisref>`]

.. _diskspace_bissbs:

@@ -335,7 +337,7 @@ Preparations: set up everything to build your own kernels
debug symbols: both explain approaches reducing the amount of space, which
should allow you to master these tasks with about 4 Gigabytes free space.

- [:ref:`details<diskspace_bisref>`]
+ [:ref:`details <diskspace_bisref>`]

.. _buildrequires_bissbs:

@@ -345,7 +347,7 @@ Preparations: set up everything to build your own kernels
reference section shows how to quickly install those on various popular Linux
distributions.

- [:ref:`details<buildrequires_bisref>`]
+ [:ref:`details <buildrequires_bisref>`]

.. _sources_bissbs:

@@ -368,7 +370,7 @@ Preparations: set up everything to build your own kernels
git remote add -t master stable \
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

- [:ref:`details<sources_bisref>`]
+ [:ref:`details <sources_bisref>`]

.. _stablesources_bissbs:

@@ -421,7 +423,7 @@ Preparations: set up everything to build your own kernels
'make olddefconfig' again and check if it now picked up the right config file
as base.

- [:ref:`details<oldconfig_bisref>`]
+ [:ref:`details <oldconfig_bisref>`]

.. _localmodconfig_bissbs:

@@ -455,7 +457,7 @@ Preparations: set up everything to build your own kernels
spending much effort on, as long as it boots and allows to properly test the
feature that causes trouble.

- [:ref:`details<localmodconfig_bisref>`]
+ [:ref:`details <localmodconfig_bisref>`]

.. _tagging_bissbs:

@@ -465,7 +467,7 @@ Preparations: set up everything to build your own kernels
./scripts/config --set-str CONFIG_LOCALVERSION '-local'
./scripts/config -e CONFIG_LOCALVERSION_AUTO

- [:ref:`details<tagging_bisref>`]
+ [:ref:`details <tagging_bisref>`]

.. _debugsymbols_bissbs:

@@ -484,7 +486,7 @@ Preparations: set up everything to build your own kernels
./scripts/config -d DEBUG_INFO -d DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT \
-d DEBUG_INFO_DWARF4 -d DEBUG_INFO_DWARF5 -e CONFIG_DEBUG_INFO_NONE

- [:ref:`details<debugsymbols_bisref>`]
+ [:ref:`details <debugsymbols_bisref>`]

.. _configmods_bissbs:

@@ -494,14 +496,14 @@ Preparations: set up everything to build your own kernels
* Are you running Debian? Then you want to avoid known problems by performing
additional adjustments explained in the reference section.

- [:ref:`details<configmods_distros_bisref>`].
+ [:ref:`details <configmods_distros_bisref>`].

* If you want to influence other aspects of the configuration, do so now using
your preferred tool. Note, to use make targets like 'menuconfig' or
'nconfig', you will need to install the development files of ncurses; for
'xconfig' you likewise need the Qt5 or Qt6 headers.

- [:ref:`details<configmods_individual_bisref>`].
+ [:ref:`details <configmods_individual_bisref>`].

.. _saveconfig_bissbs:

@@ -511,7 +513,7 @@ Preparations: set up everything to build your own kernels
make olddefconfig
cp .config ~/kernel-config-working

- [:ref:`details<saveconfig_bisref>`]
+ [:ref:`details <saveconfig_bisref>`]

.. _introlatestcheck_bissbs:

@@ -521,7 +523,7 @@ Segment 1: try to reproduce the problem with the latest codebase
The following steps verify if the problem occurs with the code currently
supported by developers. In case you face a regression, it also checks that the
problem is not caused by some .config change, as reporting the issue then would
-be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
+be a waste of time. [:ref:`details <introlatestcheck_bisref>`]

.. _checkoutmaster_bissbs:

@@ -530,7 +532,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
cd ~/linux/
git switch --discard-changes --detach mainline/master

- [:ref:`details<checkoutmaster_bisref>`]
+ [:ref:`details <checkoutmaster_bisref>`]

.. _build_bissbs:

@@ -545,7 +547,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
reference section for alternatives, which obviously will require other
steps to install as well.

- [:ref:`details<build_bisref>`]
+ [:ref:`details <build_bisref>`]

.. _install_bissbs:

@@ -578,7 +580,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
down: if you will build more kernels as described in segment 2 and 3, you will
have to perform those again after executing ``command -v installkernel [...]``.

- [:ref:`details<install_bisref>`]
+ [:ref:`details <install_bisref>`]

.. _storagespace_bissbs:

@@ -591,7 +593,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
Write down or remember those two values for later: they enable you to prevent
running out of disk space accidentally during a bisection.

- [:ref:`details<storagespace_bisref>`]
+ [:ref:`details <storagespace_bisref>`]

.. _kernelrelease_bissbs:

@@ -618,7 +620,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
If that command does not return '0', check the reference section, as the cause
for this might interfere with your testing.

- [:ref:`details<tainted_bisref>`]
+ [:ref:`details <tainted_bisref>`]

.. _recheckbroken_bissbs:

@@ -626,7 +628,7 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]
out the instructions in the reference section to ensure nothing went sideways
during your tests.

- [:ref:`details<recheckbroken_bisref>`]
+ [:ref:`details <recheckbroken_bisref>`]

.. _recheckstablebroken_bissbs:

@@ -662,12 +664,12 @@ be a waste of time. [:ref:`details<introlatestcheck_bisref>`]

Now verify if this kernel is showing the problem.

- [:ref:`details<recheckstablebroken_bisref>`]
+ [:ref:`details <recheckstablebroken_bisref>`]

Do you follow this guide to verify if a problem is present in the code
currently supported by Linux kernel developers? Then you are done at this
point. If you later want to remove the kernel you just built, check out
-:ref:`Supplementary tasks: cleanup during and after following this guide<introclosure_bissbs>`.
+:ref:`Supplementary tasks: cleanup during and after following this guide <introclosure_bissbs>`.

In case you face a regression, move on and execute at least the next segment
as well.
@@ -679,7 +681,7 @@ Segment 2: check if the kernels you build work fine

In case of a regression, you now want to ensure the trimmed configuration file
you created earlier works as expected; a bisection with the .config file
-otherwise would be a waste of time. [:ref:`details<introworkingcheck_bisref>`]
+otherwise would be a waste of time. [:ref:`details <introworkingcheck_bisref>`]

.. _recheckworking_bissbs:

@@ -714,7 +716,7 @@ otherwise would be a waste of time. [:ref:`details<introworkingcheck_bisref>`]
Now check if this kernel works as expected; if not, consult the reference
section for further instructions.

- [:ref:`details<recheckworking_bisref>`]
+ [:ref:`details <recheckworking_bisref>`]

.. _introbisect_bissbs:

@@ -739,7 +741,7 @@ each kernel on commodity x86 machines.
git bisect good v6.0
git bisect bad v6.1.5

- [:ref:`details<bisectstart_bisref>`]
+ [:ref:`details <bisectstart_bisref>`]

.. _bisectbuild_bissbs:

@@ -768,7 +770,7 @@ each kernel on commodity x86 machines.
totally normal to see release identifiers like '6.0-rc1-local-gcafec0cacaca0'
if you bisect between versions 6.1 and 6.2 for example.

- [:ref:`details<bisectbuild_bisref>`]
+ [:ref:`details <bisectbuild_bisref>`]

.. _bisecttest_bissbs:

@@ -808,7 +810,7 @@ each kernel on commodity x86 machines.
might need to scroll up to see the message mentioning the culprit;
alternatively, run ``git bisect log > ~/bisection-log``.

- [:ref:`details<bisecttest_bisref>`]
+ [:ref:`details <bisecttest_bisref>`]

.. _bisectlog_bissbs:

@@ -820,7 +822,7 @@ each kernel on commodity x86 machines.
cp .config ~/bisection-config-culprit
git bisect reset

- [:ref:`details<bisectlog_bisref>`]
+ [:ref:`details <bisectlog_bisref>`]

.. _revert_bissbs:

@@ -882,7 +884,7 @@ each kernel on commodity x86 machines.
Now check one last time if the feature that made you perform a bisection works
with that kernel: if everything went well, it should not show the regression.

- [:ref:`details<revert_bisref>`]
+ [:ref:`details <revert_bisref>`]

.. _introclosure_bissbs:

@@ -923,7 +925,7 @@ space might run out.
kernel image and related files behind; in that case remove them as described
in the reference section.

- [:ref:`details<makeroom_bisref>`]
+ [:ref:`details <makeroom_bisref>`]

.. _finishingtouch_bissbs:

@@ -946,11 +948,15 @@ space might run out.
the version considered 'good', and the last three or four you compiled
during the actual bisection process.

- [:ref:`details<finishingtouch_bisref>`]
+ [:ref:`details <finishingtouch_bisref>`]
+

.. _submit_improvements:

-This concludes the step-by-step guide.
+Conclusion
+----------
+
+You have reached the end of the step-by-step guide.

Did you run into trouble following any of the above steps not cleared up by the
reference section below? Did you spot errors? Or do you have ideas how to
@@ -970,10 +976,20 @@ Reference section for the step-by-step guide
This section holds additional information for almost all the items in the above
step-by-step guide.

+Preparations for building your own kernels
+------------------------------------------
+
+ *The steps in this section lay the groundwork for all further tests.*
+ [:ref:`... <introprep_bissbs>`]
+
+The steps in all later sections of this guide depend on those described here.
+
+[:ref:`back to step-by-step guide <introprep_bissbs>`].
+
.. _backup_bisref:

Prepare for emergencies
------------------------
+~~~~~~~~~~~~~~~~~~~~~~~

*Create a fresh backup and put system repair and restore tools at hand.*
[:ref:`... <backup_bissbs>`]
@@ -988,7 +1004,7 @@ for something going sideways, even if that should not happen.
.. _vanilla_bisref:

Remove anything related to externally maintained kernel modules
----------------------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Remove all software that depends on externally developed kernel drivers or
builds them automatically.* [:ref:`...<vanilla_bissbs>`]
@@ -1006,7 +1022,7 @@ explains in more detail.
.. _secureboot_bisref:

Deal with techniques like Secure Boot
--------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*On platforms with 'Secure Boot' or similar techniques, prepare everything to
ensure the system will permit your self-compiled kernel to boot later.*
@@ -1043,7 +1059,7 @@ Afterwards, permit MokManager to reboot the machine.
.. _bootworking_bisref:

Boot the last kernel that was working
--------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Boot into the last working kernel and briefly recheck if the feature that
regressed really works.* [:ref:`...<bootworking_bissbs>`]
@@ -1056,7 +1072,7 @@ the right thing.
.. _diskspace_bisref:

Space requirements
-------------------
+~~~~~~~~~~~~~~~~~~

*Ensure to have enough free space for building Linux.*
[:ref:`... <diskspace_bissbs>`]
@@ -1074,7 +1090,7 @@ space by quite a few gigabytes.
.. _rangecheck_bisref:

Bisection range
----------------
+~~~~~~~~~~~~~~~

*Determine the kernel versions considered 'good' and 'bad' throughout this
guide.* [:ref:`...<rangecheck_bissbs>`]
@@ -1099,7 +1115,7 @@ to do this as well, if you tried bisecting between 6.0.13 and 6.1.15.
.. _buildrequires_bisref:

Install build requirements
---------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~

*Install all software required to build a Linux kernel.*
[:ref:`...<buildrequires_bissbs>`]
@@ -1150,7 +1166,7 @@ the kernel's tools/ directory.
.. _sources_bisref:

Download the sources using Git
-------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Retrieve the Linux mainline sources.*
[:ref:`...<sources_bissbs>`]
@@ -1170,7 +1186,7 @@ work better for you:
.. _sources_bundle_bisref:

Downloading Linux mainline sources using a bundle
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"""""""""""""""""""""""""""""""""""""""""""""""""

Use the following commands to retrieve the Linux mainline sources using a
bundle::
@@ -1241,7 +1257,7 @@ Note, shallow clones have a few peculiar characteristics:
.. _oldconfig_bisref:

Start defining the build configuration for your kernel
-------------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Start preparing a kernel build configuration (the '.config' file).*
[:ref:`... <oldconfig_bissbs>`]
@@ -1301,7 +1317,7 @@ that file to the build machine and store it as ~/linux/.config; afterwards run
.. _localmodconfig_bisref:

Trim the build configuration for your kernel
---------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Disable any kernel modules apparently superfluous for your setup.*
[:ref:`... <localmodconfig_bissbs>`]
@@ -1350,7 +1366,7 @@ step-by-step guide mentions::
.. _tagging_bisref:

Tag the kernels about to be build
----------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Ensure all the kernels you will build are clearly identifiable using a
special tag and a unique version identifier.* [:ref:`... <tagging_bissbs>`]
@@ -1366,7 +1382,7 @@ confusing during the bisection.
.. _debugsymbols_bisref:

Decide to enable or disable debug symbols
------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Decide how to handle debug symbols.* [:ref:`... <debugsymbols_bissbs>`]

@@ -1395,7 +1411,7 @@ explains this process in more detail.
.. _configmods_bisref:

Adjust build configuration
---------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~

*Check if you may want or need to adjust some other kernel configuration
options:*
@@ -1406,7 +1422,7 @@ kernel configuration options.
.. _configmods_distros_bisref:

Distro specific adjustments
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+"""""""""""""""""""""""""""

*Are you running* [:ref:`... <configmods_bissbs>`]

@@ -1431,7 +1447,7 @@ when following this guide on a few commodity distributions.
.. _configmods_individual_bisref:

Individual adjustments
-~~~~~~~~~~~~~~~~~~~~~~
+""""""""""""""""""""""

*If you want to influence the other aspects of the configuration, do so
now.* [:ref:`... <configmods_bissbs>`]
@@ -1448,13 +1464,13 @@ is missing.
.. _saveconfig_bisref:

Put the .config file aside
---------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~

*Reprocess the .config after the latest changes and store it in a safe place.*
[:ref:`... <saveconfig_bissbs>`]

Put the .config you prepared aside, as you want to copy it back to the build
-directory every time during this guide before you start building another
+directory every time during this guide before you start building another
kernel. That's because going back and forth between different versions can alter
.config files in odd ways; those occasionally cause side effects that could
confuse testing or in some cases render the result of your bisection
@@ -1464,8 +1480,8 @@ meaningless.

.. _introlatestcheck_bisref:

-Try to reproduce the regression
------------------------------------------
+Try to reproduce the problem with the latest codebase
+-----------------------------------------------------

*Verify the regression is not caused by some .config change and check if it
still occurs with the latest codebase.* [:ref:`... <introlatestcheck_bissbs>`]
@@ -1519,21 +1535,21 @@ highly recommended for these reasons:
.. _checkoutmaster_bisref:

Check out the latest Linux codebase
------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Check out the latest Linux codebase.*
- [:ref:`... <introlatestcheck_bissbs>`]
+ [:ref:`... <checkoutmaster_bissbs>`]

In case you later want to recheck if an ever newer codebase might fix the
problem, remember to run that ``git fetch --shallow-exclude [...]`` command
again mentioned earlier to update your local Git repository.

-[:ref:`back to step-by-step guide <introlatestcheck_bissbs>`]
+[:ref:`back to step-by-step guide <checkoutmaster_bissbs>`]

.. _build_bisref:

Build your kernel
------------------
+~~~~~~~~~~~~~~~~~

*Build the image and the modules of your first kernel using the config file
you prepared.* [:ref:`... <build_bissbs>`]
@@ -1543,7 +1559,7 @@ yourself. Another subsection explains how to directly package your kernel up as
deb, rpm or tar file.

Dealing with build errors
-~~~~~~~~~~~~~~~~~~~~~~~~~
+"""""""""""""""""""""""""

When a build error occurs, it might be caused by some aspect of your machine's
setup that often can be fixed quickly; other times though the problem lies in
@@ -1578,7 +1594,7 @@ system, but lies in the code. If you run into one of those, you might thus find
a solution (e.g. a patch) or workaround for your issue, too.

Package your kernel up
-~~~~~~~~~~~~~~~~~~~~~~
+""""""""""""""""""""""

The step-by-step guide uses the default make targets (e.g. 'bzImage' and
'modules' on x86) to build the image and the modules of your kernel, which later
@@ -1609,7 +1625,7 @@ distribution's kernel packages.
.. _install_bisref:

Put the kernel in place
------------------------
+~~~~~~~~~~~~~~~~~~~~~~~

*Install the kernel you just built.* [:ref:`... <install_bissbs>`]

@@ -1652,7 +1668,7 @@ process. Afterwards add your kernel to your bootloader configuration and reboot.
.. _storagespace_bisref:

Storage requirements per kernel
--------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Check how much storage space the kernel, its modules, and other related files
like the initramfs consume.* [:ref:`... <storagespace_bissbs>`]
@@ -1673,7 +1689,7 @@ need to look in different places.
.. _tainted_bisref:

Check if your newly built kernel considers itself 'tainted'
------------------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Check if the kernel marked itself as 'tainted'.*
[:ref:`... <tainted_bissbs>`]
@@ -1692,7 +1708,7 @@ interest, as your testing might be flawed otherwise.
.. _recheckbroken_bisref:

Check the kernel built from a recent mainline codebase
-------------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Verify if your bug occurs with the newly built kernel.*
[:ref:`... <recheckbroken_bissbs>`]
@@ -1718,7 +1734,7 @@ the kernel you built from the latest codebase. These are the most frequent:
.. _recheckstablebroken_bisref:

Check the kernel built from the latest stable/longterm codebase
----------------------------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Are you facing a regression within a stable/longterm release, but failed to
reproduce it with the kernel you just built using the latest mainline sources?
@@ -1763,7 +1779,7 @@ ensure the kernel version you assumed to be 'good' earlier in the process (e.g.
.. _recheckworking_bisref:

Build your own version of the 'good' kernel
--------------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Build your own variant of the working kernel and check if the feature that
regressed works as expected with it.* [:ref:`... <recheckworking_bissbs>`]
@@ -1794,10 +1810,20 @@ most likely flawed.

[:ref:`back to step-by-step guide <recheckworking_bissbs>`]

+Perform a bisection and validate the result
+-------------------------------------------
+
+ *With all the preparations and precaution builds taken care of, you are now
+ ready to begin the bisection.* [:ref:`... <introbisect_bissbs>`]
+
+The steps in this segment perform and validate the bisection.
+
+[:ref:`back to step-by-step guide <introbisect_bissbs>`].
+
.. _bisectstart_bisref:

Start the bisection
--------------------
+~~~~~~~~~~~~~~~~~~~

*Start the bisection and tell Git about the versions earlier established as
'good' and 'bad'.* [:ref:`... <bisectstart_bissbs>`]
@@ -1811,7 +1837,7 @@ for you to test.
.. _bisectbuild_bisref:

Build a kernel from the bisection point
----------------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*Build, install, and boot a kernel from the code Git checked out using the
same commands you used earlier.* [:ref:`... <bisectbuild_bissbs>`]
@@ -1839,7 +1865,7 @@ There are two things worth of note here:
.. _bisecttest_bisref:

Bisection checkpoint
---------------------
+~~~~~~~~~~~~~~~~~~~~

*Check if the feature that regressed works in the kernel you just built.*
[:ref:`... <bisecttest_bissbs>`]
@@ -1853,7 +1879,7 @@ will be for nothing.
.. _bisectlog_bisref:

Put the bisection log away
---------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~

*Store Git's bisection log and the current .config file in a safe place.*
[:ref:`... <bisectlog_bissbs>`]
@@ -1873,7 +1899,7 @@ ask for it after you report the regression.
.. _revert_bisref:

Try reverting the culprit
--------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~

*Try reverting the culprit on top of the latest codebase to see if this fixes
your regression.* [:ref:`... <revert_bissbs>`]
@@ -1891,14 +1917,20 @@ succeeds, test that kernel version instead.

[:ref:`back to step-by-step guide <revert_bissbs>`]

+Cleanup steps during and after following this guide
+---------------------------------------------------

-Supplementary tasks: cleanup during and after the bisection
------------------------------------------------------------
+ *During and after following this guide you might want or need to remove some
+ of the kernels you installed.* [:ref:`... <introclosure_bissbs>`]
+
+The steps in this section describe clean-up procedures.
+
+[:ref:`back to step-by-step guide <introclosure_bissbs>`].

.. _makeroom_bisref:

Cleaning up during the bisection
---------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*To remove one of the kernels you installed, look up its 'kernelrelease'
identifier.* [:ref:`... <makeroom_bissbs>`]
@@ -1939,7 +1971,7 @@ when all you want is to remove 6.0 or 6.0.1.
[:ref:`back to step-by-step guide <makeroom_bissbs>`]

Cleaning up after the bisection
--------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _finishingtouch_bisref:

--
2.44.0


2024-04-15 16:02:20

by Jonathan Corbet

[permalink] [raw]
Subject: Re: [PATCH v2 0/6] docs: verify/bisect: fine tuning, testing fixes, build host, order

Thorsten Leemhuis <[email protected]> writes:

> A quick series with various improvements for
> Documentation/admin-guide/verify-bugs-and-bisect-regressions.rst after
> receiving feedback on the text or seeing people struggle with certain
> tasks.
>
> * The first two patches contains various fixes and some fine tuning.
>
> * The third is mainly a layout improvement that results in a somewhat
> large patch.
>
> * The fourth adds instructions for later testing of reverts, fixes, or
> newer versions. This was already hinted at; but during some early
> work on Documentation/admin-guide/reporting-issues.rst to better
> reconcile the two it seemed wise to cover this properly here.
>
> * The fifth patch briefly outlines how to build kernels on a different
> host; it came into being after a second user within one week asked for
> this. That also allowed the text to briefly cover cross-compilation.
>
> * The sixth makes users that face a regression within a stable series
> test that series first before they are told to test mainline.
> ---
>
> Hi! While at it let me mention one more thing unrelated to the changes
> that came up where I'm unsure if the current approach by the text was
> a wise choice:
>
> * Should the document tell users to avoid mainline during merge windows?
>
> Some input from the community on this would be splendid.
>
> Ciao, Thorsten
>
> P.S.: Not totally sure, but I think this should go into 6.9 as this is
> a new document; if not I guess it would be wise to pick the first two,
> as they fix bugs.

Nobody seems to be complaining, so I've gone ahead and applied the set
to docs-fixes.

Thanks,

jon