Re: [PATCH v2 04/24] docs: lockdep-design: fix some warning issues

From: Matthew Wilcox
Date: Tue Oct 13 2020 - 11:02:56 EST


On Tue, Oct 13, 2020 at 04:09:41PM +0200, Peter Zijlstra wrote:
> On Tue, Oct 13, 2020 at 02:11:16PM +0100, Matthew Wilcox wrote:
> > On Tue, Oct 13, 2020 at 02:52:06PM +0200, Peter Zijlstra wrote:
> > > On Tue, Oct 13, 2020 at 02:14:31PM +0200, Mauro Carvalho Chehab wrote:
> > > > + ===== ===================================================
> > > > + ``.`` acquired while irqs disabled and not in irq context
> > > > + ``-`` acquired in irq context
> > > > + ``+`` acquired with irqs enabled
> > > > + ``?`` acquired in irq context with irqs enabled.
> > > > + ===== ===================================================
> > >
> > > NAK!
> >
> > You're seriously suggesting that:
> >
> > - === ===================================================
> > - '.' acquired while irqs disabled and not in irq context
> > - '-' acquired in irq context
> > - '+' acquired with irqs enabled
> > - '?' acquired in irq context with irqs enabled.
> > - === ===================================================
> > + ===== ===================================================
> > + ``.`` acquired while irqs disabled and not in irq context
> > + ``-`` acquired in irq context
> > + ``+`` acquired with irqs enabled
> > + ``?`` acquired in irq context with irqs enabled.
> > + ===== ===================================================
> >
> > this change makes the lockdep docs less readable?
>
> Definitely makes it harder to read for me. My C trained eyes go WTF at
> seeing it, which breaks the flow. ',' is a regular single character
> constant, '','' a syntax error.

OK, that's fair. 'a' is definitely a character constant. Perhaps
the automarkup script can take care of this for us? We'd have to
be careful not to catch anything we shouldn't've [1], but I'm sure
there's a regex for it. Something like "\<'.'\>", perhaps?

[1] I'm quite proud of that one.

> > It's not the markup that makes the lockdep documentation hard to
> > understand.
>
> I'm not sure what you're alluding to, the subject just isn't easy to
> begin with.

Absolutely. The problem is (similar to most Linux documentation)
the document doesn't know who its audience is. It mixes internal
implementation details of lockdep with what people need to know who
are just trying to understand what a lockdep splat means. I don't
have time to restructure it right now though.