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

From: Daniel Bristot de Oliveira
Date: Wed Apr 08 2020 - 01:36:09 EST


On 4/7/20 9:40 PM, Jonathan Corbet wrote:
> 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.

I agree.

I think that their idea was focused on a media that could translate the
"source-code in .dot" into a graphical representation, which is good. But that
is not the case for this file and its audience.

But, maybe, it would be nice to have the .dot somewhere (not in the document, I
agree) as a "source code" for future updates.

-- Daniel