submit-checklist.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. .. _submitchecklist:
  2. Linux Kernel patch submission checklist
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. Here are some basic things that developers should do if they want to see their
  5. kernel patch submissions accepted more quickly.
  6. These are all above and beyond the documentation that is provided in
  7. :ref:`Documentation/process/submitting-patches.rst <submittingpatches>`
  8. and elsewhere regarding submitting Linux kernel patches.
  9. 1) If you use a facility then #include the file that defines/declares
  10. that facility. Don't depend on other header files pulling in ones
  11. that you use.
  12. 2) Builds cleanly:
  13. a) with applicable or modified ``CONFIG`` options ``=y``, ``=m``, and
  14. ``=n``. No ``gcc`` warnings/errors, no linker warnings/errors.
  15. b) Passes ``allnoconfig``, ``allmodconfig``
  16. c) Builds successfully when using ``O=builddir``
  17. d) Any Documentation/ changes build successfully without new warnings/errors.
  18. Use ``make htmldocs`` or ``make pdfdocs`` to check the build and
  19. fix any issues.
  20. 3) Builds on multiple CPU architectures by using local cross-compile tools
  21. or some other build farm.
  22. 4) ppc64 is a good architecture for cross-compilation checking because it
  23. tends to use ``unsigned long`` for 64-bit quantities.
  24. 5) Check your patch for general style as detailed in
  25. :ref:`Documentation/process/coding-style.rst <codingstyle>`.
  26. Check for trivial violations with the patch style checker prior to
  27. submission (``scripts/checkpatch.pl``).
  28. You should be able to justify all violations that remain in
  29. your patch.
  30. 6) Any new or modified ``CONFIG`` options do not muck up the config menu and
  31. default to off unless they meet the exception criteria documented in
  32. ``Documentation/kbuild/kconfig-language.rst`` Menu attributes: default value.
  33. 7) All new ``Kconfig`` options have help text.
  34. 8) Has been carefully reviewed with respect to relevant ``Kconfig``
  35. combinations. This is very hard to get right with testing -- brainpower
  36. pays off here.
  37. 9) Check cleanly with sparse.
  38. 10) Use ``make checkstack`` and fix any problems that it finds.
  39. .. note::
  40. ``checkstack`` does not point out problems explicitly,
  41. but any one function that uses more than 512 bytes on the stack is a
  42. candidate for change.
  43. 11) Include :ref:`kernel-doc <kernel_doc>` to document global kernel APIs.
  44. (Not required for static functions, but OK there also.) Use
  45. ``make htmldocs`` or ``make pdfdocs`` to check the
  46. :ref:`kernel-doc <kernel_doc>` and fix any issues.
  47. 12) Has been tested with ``CONFIG_PREEMPT``, ``CONFIG_DEBUG_PREEMPT``,
  48. ``CONFIG_DEBUG_SLAB``, ``CONFIG_DEBUG_PAGEALLOC``, ``CONFIG_DEBUG_MUTEXES``,
  49. ``CONFIG_DEBUG_SPINLOCK``, ``CONFIG_DEBUG_ATOMIC_SLEEP``,
  50. ``CONFIG_PROVE_RCU`` and ``CONFIG_DEBUG_OBJECTS_RCU_HEAD`` all
  51. simultaneously enabled.
  52. 13) Has been build- and runtime tested with and without ``CONFIG_SMP`` and
  53. ``CONFIG_PREEMPT.``
  54. 16) All codepaths have been exercised with all lockdep features enabled.
  55. 17) All new ``/proc`` entries are documented under ``Documentation/``
  56. 18) All new kernel boot parameters are documented in
  57. ``Documentation/admin-guide/kernel-parameters.rst``.
  58. 19) All new module parameters are documented with ``MODULE_PARM_DESC()``
  59. 20) All new userspace interfaces are documented in ``Documentation/ABI/``.
  60. See ``Documentation/ABI/README`` for more information.
  61. Patches that change userspace interfaces should be CCed to
  62. linux-api@vger.kernel.org.
  63. 21) Check that it all passes ``make headers_check``.
  64. 22) Has been checked with injection of at least slab and page-allocation
  65. failures. See ``Documentation/fault-injection/``.
  66. If the new code is substantial, addition of subsystem-specific fault
  67. injection might be appropriate.
  68. 23) Newly-added code has been compiled with ``gcc -W`` (use
  69. ``make EXTRA_CFLAGS=-W``). This will generate lots of noise, but is good
  70. for finding bugs like "warning: comparison between signed and unsigned".
  71. 24) Tested after it has been merged into the -mm patchset to make sure
  72. that it still works with all of the other queued patches and various
  73. changes in the VM, VFS, and other subsystems.
  74. 25) All memory barriers {e.g., ``barrier()``, ``rmb()``, ``wmb()``} need a
  75. comment in the source code that explains the logic of what they are doing
  76. and why.
  77. 26) If any ioctl's are added by the patch, then also update
  78. ``Documentation/userspace-api/ioctl/ioctl-number.rst``.
  79. 27) If your modified source code depends on or uses any of the kernel
  80. APIs or features that are related to the following ``Kconfig`` symbols,
  81. then test multiple builds with the related ``Kconfig`` symbols disabled
  82. and/or ``=m`` (if that option is available) [not all of these at the
  83. same time, just various/random combinations of them]:
  84. ``CONFIG_SMP``, ``CONFIG_SYSFS``, ``CONFIG_PROC_FS``, ``CONFIG_INPUT``, ``CONFIG_PCI``, ``CONFIG_BLOCK``, ``CONFIG_PM``, ``CONFIG_MAGIC_SYSRQ``,
  85. ``CONFIG_NET``, ``CONFIG_INET=n`` (but latter with ``CONFIG_NET=y``).