Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: Thobias Knudsen via lttng-dev <lttng-dev@lists.lttng.org>
To: "Ondřej Surý" <ondrej@sury.org>
Cc: lttng-dev@lists.lttng.org
Subject: Re: URCU feature request?
Date: Tue, 2 Sep 2025 23:48:43 +0200	[thread overview]
Message-ID: <CAKGpcip6w2nVQ+vbtfFH1296xTi5HYX+68J8okecChsihejDQA@mail.gmail.com> (raw)
In-Reply-To: <BD1A29BD-2AD2-4092-B1A2-DFEFAE77AAEE@sury.org>

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

Yes but all read/write operations doesn't have the syntax of a function as
you used in the example here i.e. use(...). When it is a function you can
easily just change the implementation to check if it is called inside a
read section. Some reads and writes are usually done by this syntax (a = b)
and '=' cannot be overridden.

BTW just saying that what we're talking about now is not the original
topic, but if someone has an elegant solution to this that would be nice!

Thanks
Thobias

tir. 2. sep. 2025 kl. 23:34 skrev Ondřej Surý <ondrej@sury.org>:

> If I understand you correctly, you can do something like this:
>
> #undef rcu_read_lock
> #define rcu_read_lock() urcu_memb_read_lock(); {
>
> #undef rcu_read_unlock
> #define rcu_read_lock() } urcu_memb_read_unlock();
>
> (replace memb with your RCU variant of course)
>
> and make your code declare all the RCU protected pointers inside the RCU
> critical section, e.g.
>
> rcu_read_lock();
> my_pointer *foo = rcu_dereference(...);
>
> use(foo); /* valid */
>
> rcu_read_unlock();
>
>
> use(foo); /* invalid and caught by the compiler */
>
> Ondrej
> --
> Ondřej Surý (He/Him)
> ondrej@sury.org
>
> > On 2. 9. 2025, at 23:06, Thobias Knudsen via lttng-dev <
> lttng-dev@lists.lttng.org> wrote:
> >
> > Yes, that is what I'm worried about. For my case when using URCU that is
> my biggest concern, as the debug macro "library" I made checks everything
> else, if I haven't overlooked anything.
> >
>
>

[-- Attachment #2: Type: text/html, Size: 2092 bytes --]

  reply	other threads:[~2025-09-02 21:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKGpciq6Cb6+hqsfn+_zPk+MqCg+b0M_Gc3jVxVvnEGcE8rdLw@mail.gmail.com>
     [not found] ` <db17b2cb-6ec1-49a2-b6a8-444878b63319@efficios.com>
2025-09-02 14:02   ` Thobias Knudsen via lttng-dev
     [not found] ` <CAKGpciqHpGqGJChLa8p4P4Xv7EyUPMxULHxeknOTyie8kHH6hg@mail.gmail.com>
     [not found]   ` <3c49eadb-f310-46b2-984d-58a0c193cde9@efficios.com>
2025-09-02 14:17     ` Thobias Knudsen via lttng-dev
2025-09-02 14:24       ` Thobias Knudsen via lttng-dev
2025-09-02 20:33         ` Paul E. McKenney via lttng-dev
2025-09-02 21:06           ` Thobias Knudsen via lttng-dev
2025-09-02 21:33             ` Ondřej Surý via lttng-dev
2025-09-02 21:48               ` Thobias Knudsen via lttng-dev [this message]
2025-09-03  1:35                 ` Olivier Dion via lttng-dev
2025-09-04 18:06                   ` Thobias Knudsen via lttng-dev
2025-09-04 18:09                     ` Thobias Knudsen via lttng-dev
2025-09-05 18:04                     ` Olivier Dion via lttng-dev
2025-09-07 19:18                       ` Thobias Knudsen via lttng-dev
2025-09-08  0:10                         ` Olivier Dion via lttng-dev
2025-09-19 20:39                           ` Thobias Knudsen via lttng-dev
2025-09-19 20:42                             ` Thobias Knudsen via lttng-dev
2025-09-03  1:20             ` Paul E. McKenney via lttng-dev

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=CAKGpcip6w2nVQ+vbtfFH1296xTi5HYX+68J8okecChsihejDQA@mail.gmail.com \
    --to=lttng-dev@lists.lttng.org \
    --cc=ondrej@sury.org \
    --cc=thobknu@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox