All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: xenomai@xenomai.org
Subject: [CXP] Discussing the RTDM specification
Date: Fri, 18 Dec 2020 15:19:44 +0100	[thread overview]
Message-ID: <874kkjurgf.fsf@xenomai.org> (raw)


This wiki page [1] contains a draft proposal about specifying which
services from the current RTDM interface should be part of the Common
Xenomai Platform. Some proposals for deprecation stand out:

- I suspect that only very few RTDM drivers are actually handling
  requests from other kernel-based drivers in real world applications,
  at least not enough to justify RTDM codifying these rare cases into a
  common interface (rtdm_open, rtdm_read, rtdm_write etc).

  In other words, although I would agree that a few particular drivers
  might want to export a couple of services to kernel-based clients in
  order to provide them some sort of backchannel, it seems wrong to
  require RTDM drivers to provide a kernel interface which would match
  their user interface in the same terms. For these specific cases, ad
  hoc code in these few drivers should be enough.

  Besides, I believe that most kernel->kernel request paths implemented
  by in-tree RTDM drivers have never been tested for years, if ever.
  Meanwhile, this kernel->kernel API introduces a basic exception case
  into many RTDM and driver code paths, e.g. for differentiating kernel
  vs user buffers, for only very few use cases.

  For these reasons, I would suggest to deprecate the kernel->kernel API
  from RTDM starting from 3.3, excluding it from the CXP in the same
  move.

- RTDM_EXECUTE_ATOMICALLY() and related calls relying on the Cobalt big
  lock must go. For SMP scalability reasons, this big lock was
  eliminated from the EVL core, which means that all the attached
  semantics will not hold there. Serializing access to shared resources
  should be guaranteed by resource-specific locking, not by a giant
  traffic light like the big lock implements.

- rtdm_mutex_timedlock() has dubious semantics. Hitting a timeout
  condition on grabbing a mutex either means that:

  * the mutex was already locked on entry to the call if timeout ==
    RTDM_TIMEOUT_NONE,

  * the mutex was not released within the allotted time, which had to be
    long enough to prevent early shots. This means that something is
    most likely going really wrong in the software, since a mutex is
    supposed to cover fairly short, hopefully simple sections of code,
    exhibiting an obvious exit path.

  In the first case, we would be better off providing
  rtdm_trylock_mutex() which has clearer semantics, starting from 3.3,
  adding it to the CXP. The ship is most likely wrecked already in the
  second case, so using a timeout condition as a way towards recovery is
  unlikely to succeed at this point anyway.

[1] https://gitlab.denx.de/Xenomai/xenomai/-/wikis/CXP_RTDM

-- 
Philippe.


             reply	other threads:[~2020-12-18 14:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 14:19 Philippe Gerum [this message]
2020-12-19  4:53 ` [CXP] Discussing the RTDM specification Fino Meng
2020-12-23  9:45 ` Jan Kiszka
2020-12-23 10:40   ` Philippe Gerum
2021-01-05 19:31     ` Jan Kiszka
2021-01-09 17:01       ` Philippe Gerum
2021-01-11 10:48         ` Jan Kiszka
2021-01-11 13:14           ` Philippe Gerum
2021-01-11 13:18             ` Jan Kiszka
2021-01-16 15:41               ` Philippe Gerum

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=874kkjurgf.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.