From: Philippe Gerum <rpm@xenomai.org>
To: Richard Weinberger <richard@nod.at>
Cc: xenomai@lists.linux.dev, upstream+xenomai@sigma-star.at
Subject: Re: [PATCH 2/5] Make RTDM tasks behave, part I
Date: Wed, 28 Jan 2026 14:23:22 +0100 [thread overview]
Message-ID: <874io5vpkl.fsf@xenomai.org> (raw)
In-Reply-To: <20260128112821.1232-2-richard@nod.at> (Richard Weinberger's message of "Wed, 28 Jan 2026 12:28:18 +0100")
Richard Weinberger <richard@nod.at> writes:
> RTDM tasks must now utilize rtdm_task_should_stop() to ensure proper
> cleanup and SIGSHADOW detection.
> Also, handle -EINTR gracefully, rather than exiting immediately on
> interruption, the task should loop and re-check rtdm_task_should_stop()
> to decide if termination is actually required.
>
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
> kernel/drivers/autotune/autotune.c | 17 ++++++++++-------
> kernel/drivers/net/addons/proxy.c | 6 +++++-
> kernel/drivers/net/stack/ipv4/tcp/timerwheel.c | 6 ++++--
> kernel/drivers/net/stack/rtcfg/rtcfg_frame.c | 6 +++++-
> .../drivers/net/stack/rtmac/nomac/nomac_proto.c | 6 +++++-
> .../drivers/net/stack/rtmac/tdma/tdma_worker.c | 4 +++-
> kernel/drivers/net/stack/rtnet_rtpc.c | 5 ++++-
> kernel/drivers/net/stack/stack_mgr.c | 6 +++++-
> kernel/drivers/testing/rtdmtest.c | 9 ++++-----
> kernel/drivers/testing/timerbench.c | 2 +-
> 10 files changed, 46 insertions(+), 21 deletions(-)
>
> diff --git a/kernel/drivers/autotune/autotune.c b/kernel/drivers/autotune/autotune.c
> index 03fd688de..c11d18057 100644
> --- a/kernel/drivers/autotune/autotune.c
> +++ b/kernel/drivers/autotune/autotune.c
> @@ -248,22 +248,25 @@ static void task_handler(void *arg)
> xnticks_t now;
> int ret = 0;
>
> - for (;;) {
> - if (rtdm_task_should_stop())
> - break;
> -
> + while (!rtdm_task_should_stop()) {
> ret = rtdm_event_wait(&k_tuner->barrier);
> - if (ret)
> + if (ret == -EINTR)
> + continue;
Using -EINTR is going to be a problem if xnthread_unblock() is called to
forcibly wake up a kernel task from a sleep. In this case, you would not
be able to distinguish a signal receipt from a forcible
unblock. -ERESTARTSYS may be better for that specific purpose in the
RTDM API.
--
Philippe.
next prev parent reply other threads:[~2026-01-28 13:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 11:28 [PATCH 1/5] Allow changing CPU affinity of RTDM tasks Richard Weinberger
2026-01-28 11:28 ` [PATCH 2/5] Make RTDM tasks behave, part I Richard Weinberger
2026-01-28 13:23 ` Philippe Gerum [this message]
2026-01-28 13:31 ` Richard Weinberger
2026-01-28 13:54 ` Richard Weinberger
2026-01-28 16:37 ` Philippe Gerum
2026-01-28 11:28 ` [PATCH 3/5] Make RTDM tasks behave, part II Richard Weinberger
2026-01-29 9:45 ` Jan Kiszka
2026-01-28 11:28 ` [PATCH 4/5] Warn on unexpected RTDM task termination Richard Weinberger
2026-01-29 9:50 ` Jan Kiszka
2026-01-29 9:54 ` Florian Bezdeka
2026-01-28 11:28 ` [PATCH 5/5] Allow specifying CPU affinity in rtdm_task_init() Richard Weinberger
2026-01-29 9:53 ` Jan Kiszka
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=874io5vpkl.fsf@xenomai.org \
--to=rpm@xenomai.org \
--cc=richard@nod.at \
--cc=upstream+xenomai@sigma-star.at \
--cc=xenomai@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 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.