A series of scripts to help reviewing of kernel patch series. These are essentially light wrappers around other tooling to make review faster.
DISCLAIMER: I don't guarantee these won't lose you work, destroy your git repos, cause lego to fall beneath your bare foot such that you step on it or any other such calamities and I disclaim all responsibility for such! Use these at your own risk.
Note this will generate ugly local tags to store metadata of the form
review-xxx. Using review-stop or review-clean will clean these up.
It will also create branches of the form review/[name]-[version]. Use
review-clean to get rid of these.
IMPORTANT: The tooling is now set up to use clang by default for
everything and generates compile_commands.json for semantic tooling such as
clangd.
- usual coreutils etc.
- git (>= v2.45)
- b4
- git-delta
- virtme-ng
- neomutt
- ansi2txt
- git-delta
- clang/llvm
- Ensure dependencies are installed.
- Put this directory on your
$PATH.
It is recommended that you run:
git config --global am.threeWay true
So that you can resolve conflicts in series when they are applied.
Kernel configuration and build scripts are located in the hooks/ subdirectory:
kernel-config- run once before build.kernel-config-debug- run once before build, with debug settings.kernel-build- run for each build.
These can be adjusted to taste.
IMPORTANT: b4 isn't always great at finding all the versions of a
series. Therefore you may need to have separate review names for separate
revisions. You can use review-diff-pair to workaround this issue for range
diff comparisons.
-
review-mk- Build kernel using all system cores, terminating the build and all stdout output upon seeing stderr. -
review-start [name] [head] [msgid] <override>- Start a review which you're namingname, which you're basing on revisionheadand wheremsgidis the msgid that exists in lore for a message in one of the revisions you intend to review. Runsreview-geton startup to setup review branches. Ifoverrideis not empty, ignore any checks for existing series in the tree. -
review-start-applied [name] [base ref] [head ref] [version] <msgid>Manually start a review where the series has already been applied and exists in the tree, frombase reftohead refat versionversion. From there you can use the rest of the review tools as if it were obtained normally. Ifmsgidis not provided, then it is assumed it is out-of-tree work and a stub value is set, meaning scripts that retrieve data from the upstream list will fail. -
review-get [name]- Retrieves latest messages for all revisions and updates local branches, placing them inreview/name-vNbraanches. -
review-stop [name]- Remove tag for review but leave branches around. -
review-clear [name]- Clear everything (tag and branches) for the specified review. -
review-clear-branches [name]- Just clear the branches, leave the review active. -
review-diff [name] <version>orreview-diff [name] <prev version> <version>- Provide a side-by-side range-diff between two versions in the series, assuming b4 was able to retrieve versions successfully (if not, usereview-diff-pair). Ifversionspecified then compareversion - 1toversion, ifprev versionandversionspecified then compare those versions, otherwise compare the latest version with the one prior to that (the default if no version parameters are specified). -
review-diff-pair [previous name] [current name] <previous version> <current version>- Same as review-diff, except it's comparing ranges across separate reviews. Useful for series that b4 loses track of, or RFC -> non-RFC, etc. -
review-diff-each [name] <version>- Review each individual patch in the series at the specified version (or latest if not specified) usinggit show. -
review-read [name]- Retrieve the mail for all versions of the series and all replies, and load it in neomutt. -
review-checkpatch [name] <version>- Just runcheckpatch.plagainst all patches in series. -
review-check [name] <version>- Build each patch. Defaults to the latest version, unless specified. Afterwards this runscheckpatch.plagainst each patch. -
review-check-mm-tests [name] <version>- Build series at specified version or if not specified, the latest, compile the mm self tests and then run them in this kernel version. WARNING: this runs with sudo and R/W with access to host file system. Some tests won't work if you don't do this, so don't blame me if your filesystem breaks. -
review-check-mm [name] <version>- Execute all checks for mm series, from easiest checks to hardest, so a checkpatch check first, then self tests check, then individual per-patch build test. -
review-mm-tests <--vma-tests-only> <--mm-tests-only>- Build/run VMA tests and/or memory management self tests, but no review has to be active, this will simply be run against the current kernel tree for convenience. -
review-mm-tests-arm64- Builds/runs mm selftests in an arm64 environment. NOTE: slow. Possibly buggy. But it does work kinda :) -
review-mbox [name]- Retrieves an mbox of all mails associated with series, and saves it into the local directory asreview_[name].mbx. -
review-patches [name] <version>- Retrieves all the patches in the series and saves them locally as a series of *.patch files (minus the cover patch), optionally at the specified version, if not specified then the latest. -
review-build- Simple script to configure and build the kernel using the configuration/build hooks. -
review-rebuild- Same asreview-buildbut runsreview-reconfigfirst, resetting the config and rebuilding the kernel from scratch. -
review-rebuild-debug- Same asreview-rebuildbut usesreview-reconfig-debugto build a kernel with extra debug checks. -
review-config- Simple script to configure the kernel using the configuration hook. -
review-config-debugSame asreview-config, but sets additional debug options that might slow things down quite a bit. -
review-reconfig- Same asreview-configonly run amake mrproperfirst to clear existing configuration. -
review-reconfig-debug- Same asreview-config-debugonly run amake mrproperfirst to clear existing configuration. -
review-rebase [name] [new_base] <version>- Rebase the review branch on to new_base, either at the specified version, or if not specified the latest. Seereview-rebase-branchfor further details. -
review-rebase-branch [branch] [old_base] [new_base] <nopause>- Rebasebranchfromold_basetonew_base. This assumes you're dealing with an often-rebased repo (which kernel development repos/branches often are), so tries to do this with a cherry-pick. Since conflicts can arise, we have 2 ways of dealing with it - manually, where an error message indicates user can manually give up on it (seereview-rebase-abort) or continue applying steps after cherry-pick resolutions applied (seereview-rebase-continue). Alternatively, if able to (nopauseparam is unset), the script will pause and allow resolution in the background, and can be resumed viafg. -
review-rebase-abort [branch] [old_base] [new_base]- Aborts an ongoing cherry-pick rebase started byreview-rebaseorreview-rebase-branch- cleaning up the mess created. -
review-rebase-continue [branch] [old_base] [new_base]- Continues an ongoing cherry-pick rebase started byreview-rebaseorreview-rebase-branch- performing the final steps to apply the rebase. -
review-vng [args...]- Execute virtme-ng with sensible configuration options for development - verbose output for dmesg logs, panic-on-warning,oops and a configuration that is known-working with mm selftests. -
review-vng-debug [args...]- Same asreview-vngbut with more noise useful for debugging. -
review-ls- Lists all review branches in a kernel tree. -
review-build-commits <commit from> <commit to>- Build all commits in a range (ifcommit fromorcommit tois not specified, they default toHEAD- so executing without parameters checks current commit) ensuring that no individual commit breaks the build. -
review-build-commits-pedantic <commit from> <commit to>- Likereview-build-commitsonly builds each commit against an allnoconfig, a normal debug build, a rust build, a nommu build and an arm64 build to truly exercise the series. -
review-clean- Clear all configurations for all architectures and restorereview-configafterwards. -
review-mm <--vma-tests-only> <--mm-tests-only>- Runreview-mm-tests, passing parameters on to it andreview-build-commits-pedanticto check the current commit against these tests and all builds. -
review-mk-nosym- Same asreview-mkbut does not build compile_commands.json symbol information for everything.
Thanks to Tomáš Janoušek for his incredible article on implementing the side-by-side diff for git range-diff.
I include his git-range-diff-delta-preproc helper script under the MIT license.
# Start review, grab series
]$ review-start procmap_query mm-unstable 20250804231552.1217132-1-surenb@google.com
--- retrieving data for [procmap_query]... ---
Grabbing thread from lore.kernel.org/all/20250804231552.1217132-1-surenb@google.com/t.mbox.gz
...
Applying: selftests/proc: test PROCMAP_QUERY ioctl while vma is concurrently modified
Applying: fs/proc/task_mmu: factor out proc_maps_private fields used by PROCMAP_QUERY
Using index info to reconstruct a base tree...
M fs/proc/internal.h
M fs/proc/task_mmu.c
Falling back to patching base and 3-way merge...
Auto-merging fs/proc/internal.h
Auto-merging fs/proc/task_mmu.c
CONFLICT (content): Merge conflict in fs/proc/task_mmu.c
Patch failed at 0002 fs/proc/task_mmu: factor out proc_maps_private fields used by PROCMAP_QUERY
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
WARNING: shazam failed, if due to conflict, please resolve and re-run command.
$ # fix conflict
$ git am --continue
$ review-get
...
Unable to find revision 1
b4 cannot find version 1, deleting branch 'review/procmap_query-v1'
Deleted branch review/procmap_query-v1 (was c617a4dd7102).
$ review-ls
review/procmap_query-v2
review/procmap_query-v3
* review/procmap_query-v4
Now all versions of the series, apart from the one b4 can't find (v1) are in branches.
$ review-diff procmap_query
Now I can check that all patches in the latest revision pass checkpatch.pl:
$ review-checkpatch procmap_query
--- retrieving data for [procmap_query]... ---
Grabbing thread from lore.kernel.org/all/20250804231552.1217132-1-surenb@google.com/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Added from v3: 4 patches
Added from v4: 4 patches
23 messages in the thread
Saved /tmp/tmp.DNbDXaXVd5/review-procmap_query.mbx
--- ...retrieving data for [procmap_query] ---
Analyzing 23 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Analyzing 9 code-review messages
Checking attestation on all messages, may take a moment...
---
[PATCH v4 1/3] selftests/proc: test PROCMAP_QUERY ioctl while vma is concurrently modified
● checkpatch.pl: passed all checks
[PATCH v4 2/3] fs/proc/task_mmu: factor out proc_maps_private fields used by PROCMAP_QUERY
● checkpatch.pl: passed all checks
[PATCH v4 3/3] fs/proc/task_mmu: execute PROCMAP_QUERY ioctl under per-vma locks
+ Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
● checkpatch.pl: passed all checks
---
NOTE: install dkimpy for DKIM signature verification
---
Total patches: 3
---
Cover: ./v4_20250808_surenb_execute_procmap_query_ioctl_under_per_vma_lock.cover
Link: https://lore.kernel.org/r/20250808152850.2580887-1-surenb@google.com
Base: using specified base-commit c2144e09b922d422346a44d72b674bf61dbd84c0
git checkout -b v4_20250808_surenb_google_com c2144e09b922d422346a44d72b674bf61dbd84c0
git am ./v4_20250808_surenb_execute_procmap_query_ioctl_under_per_vma_lock.mbx
Build test every commit in latest revision:
$ review-check procmap_query
<kernel build automatically performed for every commit in series>
Read all mails in the thread:
$ review-read procmap_query
Run all the mm self-tests at the latest version:
$ review-check-mm-tests
< test results >

