From: Jonathan Corbet <corbet@lwn.net>
To: Jani Nikula <jani.nikula@intel.com>, ksummit@lists.linux.dev
Subject: Re: [TECH TOPIC] Kernel documentation
Date: Tue, 20 Jun 2023 13:30:34 -0600 [thread overview]
Message-ID: <87v8fiq6cl.fsf@meer.lwn.net> (raw)
In-Reply-To: <871qi6glzl.fsf@intel.com>
Jani Nikula <jani.nikula@intel.com> writes:
> It should be more feasible to build the documentation. Make it faster,
> reduce the warnings.
>
> Some ideas to make it faster:
>
> - Bump the minimum Sphinx version requirement if it helps the speed. I
> don't think it needs to be as conservative as the compiler.
Alas, newer versions of Sphinx are slower, not faster; 2.4 takes about
half the time to build the docs that 5.x does.
A while back, I went into Sphinx with a hatchet and managed to take
about 20% off the build time. The C domain stuff builds a data
structure of incredible complexity, then just tosses much of it away.
I've never had the time to figure out why they do that or to try to get
my hack job into a condition where I'd be willing to show it to my dog,
much less the Sphinx developers.
I wish we had an active presence in the Sphinx community, but I've never
been able to make that happen myself.
> - Cache kernel-doc results per document. A bunch of .rst files use
> multiple kernel-doc directives for the same source file to better
> control the documentation order [1]. Each directive causes the same
> source to be parsed. (I'm not sure how bad the effect is though.)
That would help, but I don't think this is our biggest problem.
> - Simplify the rst output kernel-doc produces. For example, use rst
> native field lists for parameter and member descriptions instead of
> hand-crafting them. See [2]. Drop the "definition" part from
> structures, as nobody relies on it anyway. If necessary, add links to
> source instead.
Seems worth a try.
> - Default to Sphinx parallel build.
We *do* default to that, or so I thought. Much of the build doesn't
actually parallelize, though.
> - Consider splitting the whole documentation to multiple smaller
> projects, and linking between them using intersphinx. (This may be a
> tall order.)
This would be nice. I looked into it a little while back and ran into
some roadblocks; I'll need to go back to my notes to remind myself of
where the problems were.
> Some ideas to reduce warnings:
>
> - W=1 already includes kernel-doc warnings for .c. In i915 we've added
> that to the regular build as well as a separate target to test
> headers, and use kernel-doc -Werror for development. Try to get more
> folks on board.
>
> - Add more warning levels to kernel-doc similar to compilers, and reduce
> the default warnings. For example, I'm not sure it's necessary to warn
> about each undocumented parameter/member by default. That could be a
> verbose option. Bump up the warnings after we've fixed the more
> glaring issues.
This seems like a good idea.
> - For more verbose checking without Sphinx, it should be possible to
> lint the rst produced by kernel-doc (originating from source), and
> check that as part of the build. But that's clearly W=2 stuff or on a
> subsystem/driver basis.
>
> - Making the Sphinx build faster would also get more people on board
> fixing the warnings too.
This, I think, is the key point. The build speed is a real pain point
that impedes contribution.
jon
next prev parent reply other threads:[~2023-06-20 19:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 17:48 Jonathan Corbet
2023-06-20 16:02 ` Jani Nikula
2023-06-20 19:30 ` Jonathan Corbet [this message]
2023-11-20 12:06 ` Vegard Nossum
2023-11-20 13:50 ` Jonathan Corbet
2023-11-20 14:42 ` Mauro Carvalho Chehab
2023-11-20 14:49 ` Johannes Berg
2023-11-20 20:54 ` Jonathan Corbet
2023-06-29 21:34 ` Intersphinx ([TECH TOPIC] Kernel documentation) Jonathan Corbet
2023-06-30 13:17 ` Jani Nikula
2023-06-30 16:54 ` Theodore Ts'o
2023-06-30 17:11 ` Jonathan Corbet
2023-07-02 1:46 ` Steven Rostedt
2023-07-02 4:56 ` Linus Torvalds
2023-07-02 13:18 ` James Bottomley
2023-07-02 18:32 ` Steven Rostedt
2023-07-02 18:44 ` Linus Torvalds
2023-07-03 2:46 ` Theodore Ts'o
2023-06-21 11:04 ` [TECH TOPIC] Kernel documentation Thorsten Leemhuis
2023-06-26 14:34 ` Jan Kara
2023-11-11 12:42 ` Vegard Nossum
2023-11-11 15:14 ` Jonathan Corbet
2023-11-20 12:20 ` Vegard Nossum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8fiq6cl.fsf@meer.lwn.net \
--to=corbet@lwn.net \
--cc=jani.nikula@intel.com \
--cc=ksummit@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox