Re: [RFC PATCH 2/3] docs: scheduler: Add scheduler overview documentation

From: Jonathan Corbet
Date: Tue Apr 07 2020 - 15:40:32 EST


On Wed, 1 Apr 2020 13:47:04 +0200
Daniel Bristot de Oliveira <bristot@xxxxxxxxxx> wrote:

> > And that is a prime example of why I hates RST, it pretty much mandates
> > you view this with something other than a text editor.
>
> The good thing about the dot format is that we can convert it to many other
> formats, including text:
>
> [bristot@x1 ~]$ cat sched_transition.dot | graph-easy
>
> *
>
> |
> | task
> | forks
> v
> +------------------------------------+
> | TASK_NEW |
> | (Ready to run) |
> +------------------------------------+
> |
> |
> v
> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -+
> ' int '
> ' '
> ' +------------------------------------+ '
> ' | TASK_RUNNING | '
> ' +--------------> | (Ready to run) | <--+ '
> ' | +------------------------------------+ | '
> ' | | | '
> ' | | schedule() calls context_switch() | task is pre-empted '
> ' | v | '
> ' | +------------------------------------+ | '
> ' | | TASK_RUNNING | | '
> ' | | (Running) | ---+ '
> ' | event occurred +------------------------------------+ '
> ' | | '
> ' | | - - - - - - - - - - - -+
> ' | | '
> ' | | task needs to wait for event '
> ' | v '
> ' | +------------------------------------+ '
> ' | | TASK_INTERRUPTIBLE | '
> ' | | TASK_UNINTERRUPTIBLE | '
> ' +--------------- | TASK_WAKEKILL | '
> ' +------------------------------------+ '
> ' '
> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
> |
> | task exits via do_exit()
> v
> +------------------------------------+
> | TASK_DEAD |
> | EXIT_ZOMBIE |
> +------------------------------------+
>
>
> Is there a way to also add this representation, while hiding it
> when using a graphical reader?

Better, honestly, to just put the ascii art into the doc as a literal
block. I don't see any real reason to embed Dot stuff unless there's
really no alternative.

Thanks,

jon