SubmitChecklist 4.7 KB

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