All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Norbert Lange <nolange79@gmail.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	lttng-dev <lttng-dev@lists.lttng.org>,
	Xenomai <xenomai@xenomai.org>, paulmck <paulmck@kernel.org>
Subject: Re: [lttng-dev] Using lttng-ust with xenomai
Date: Fri, 22 Nov 2019 14:00:05 -0500 (EST)	[thread overview]
Message-ID: <2088324778.1063.1574449205629.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <CADYdroOh+T8pOcNBW74KSMfCh--ujD8L3_G96LWR1migpsUq0g@mail.gmail.com>

----- On Nov 22, 2019, at 12:44 PM, Norbert Lange nolange79@gmail.com wrote:

> Am Fr., 22. Nov. 2019 um 16:52 Uhr schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>>
>> On 22.11.19 16:42, Mathieu Desnoyers wrote:

[...]

> 
> 
>> >
>> > That's indeed a good point. I suspect membarrier may not send any IPI
>> > to Xenomai threads (that would have to be confirmed). I suspect the
>> > latency introduced by this IPI would be unwanted.
>>
>> Is an "IPI" a POSIX signal here? Or are real IPI that delivers an
>> interrupt to Linux on another CPU? The latter would still be possible,
>> but it would be delayed until all Xenomai threads on that core eventual
>> took a break (which should happen a couple of times per second under
>> normal conditions - 100% RT load is an illegal application state).
> 
> Not POSIX, some inter-thread interrupts. point is the syscall waits
> for the set of
> registered *running* Linux threads.

Just a small clarification: the PRIVATE membarrier command does not *wait*
for other threads, but it rather ensures that all other running threads
have had IPIs that issue memory barriers before it returns.

This is just a building block that can be used to speed up stuff like liburcu
and JIT memory reclaim.

[...]

>> >
>> > Another thing to make sure is to have a glibc and Linux kernel which perform
>> > clock_gettime() as vDSO for the monotonic clock, because you don't want a
>> > system call there. If that does not work for you, you can alternatively
>> > implement your own lttng-ust and lttng-modules clock plugin .so/.ko to override
>> > the clock used by lttng, and for instance use TSC directly. See for instance
>> > the lttng-ust(3) LTTNG_UST_CLOCK_PLUGIN environment variable.
>>
>> clock_gettime & Co for a Xenomai application is syscall-free as well.
> 
> Yes, and that gave me a deadlock already, if a library us not compiled
> for Xenomai,
> it will either use the syscall (and you detect that immediatly) or it
> will work most of the time,
> and lock up once in a while if a Linux thread took the "writer lock"
> of the VDSO structures
> and your high priority xenomai thread is busy waiting infinitely.
> 
> Only sane approach would be to use either the xenomai function directly,
> or recreate the function (rdtsc + interpolation on x86).
> Either compiling/patching lttng for Cobalt (which I really would not
> want to do) or using a
> clock plugin.
> If the later is supposed to be minimal, then that would mean I would
> have to get the
> interpolation factors cobalt uses (without bringing in libcobalt).
> 
> Btw. the Xenomai and Linux monotonic clocks arent synchronised at all
> AFAIK, so timestamps will
> be different to the rest of Linux.
> On my last plattform I did some tracing using internal stamp and
> regulary wrote a
> block with internal and external timestamps so those could be
> converted "offline".
> Anything similar with lttng or tools handling the traces?

Can a Xenomai thread issue clock_gettime(CLOCK_MONOTONIC) ?

AFAIK we don't have tooling to do what you describe out of the box,
but it could probably be implemented as a babeltrace 2 filter plugin.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


  parent reply	other threads:[~2019-11-22 19:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADYdroN-i9yrpd-wjPSW36GUptRV+kOCJT=Yv6+Z5sCVBmo_SQ@mail.gmail.com>
2019-11-22 15:42 ` [lttng-dev] Using lttng-ust with xenomai Mathieu Desnoyers
2019-11-22 15:52   ` Jan Kiszka
2019-11-22 15:52   ` [lttng-dev] " Jan Kiszka
2019-11-22 17:01     ` Mathieu Desnoyers
2019-11-22 17:36       ` Jan Kiszka
2019-11-22 17:36       ` Jan Kiszka
2019-11-22 17:01     ` Mathieu Desnoyers
2019-11-22 17:44     ` Norbert Lange
2019-11-22 17:44     ` [lttng-dev] " Norbert Lange
2019-11-22 17:52       ` Jan Kiszka
2019-11-22 17:52       ` [lttng-dev] " Jan Kiszka
2019-11-22 18:01         ` Norbert Lange
2019-11-22 18:01         ` [lttng-dev] " Norbert Lange
2019-11-22 18:07           ` Jan Kiszka
2019-11-22 21:38             ` Norbert Lange
2019-11-22 21:38             ` Norbert Lange
2019-11-22 18:07           ` Jan Kiszka
2019-11-22 19:00       ` Mathieu Desnoyers
2019-11-22 19:00       ` Mathieu Desnoyers [this message]
2019-11-22 19:57         ` Norbert Lange
2019-11-22 19:57         ` [lttng-dev] " Norbert Lange
2019-11-22 20:15           ` Mathieu Desnoyers
2019-11-22 20:15           ` [lttng-dev] " Mathieu Desnoyers
2019-11-22 21:27             ` Norbert Lange via Xenomai
2019-11-22 21:27               ` Norbert Lange
2019-11-22 17:55   ` Norbert Lange
2019-11-22 19:03     ` Mathieu Desnoyers
2019-11-22 19:03     ` [lttng-dev] " Mathieu Desnoyers
2019-11-22 20:04       ` Norbert Lange
2019-11-22 20:04       ` Norbert Lange
2019-11-22 17:55   ` Norbert Lange
2019-11-22 15:42 ` Mathieu Desnoyers

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=2088324778.1063.1574449205629.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=jan.kiszka@siemens.com \
    --cc=lttng-dev@lists.lttng.org \
    --cc=nolange79@gmail.com \
    --cc=paulmck@kernel.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.