Linux Trace Kernel
 help / color / mirror / Atom feed
From: Gabriele Monaco <gmonaco@redhat.com>
To: Wen Yang <wen.yang@linux.dev>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/9] rv: add generic uprobe infrastructure for RV monitors
Date: Wed, 01 Jul 2026 13:57:31 +0200	[thread overview]
Message-ID: <e8e6c6ddb99e096b2daf2a88891cdce703730bdd.camel@redhat.com> (raw)
In-Reply-To: <d1e84072-7968-4a64-9497-09db83b38682@linux.dev>

On Wed, 2026-07-01 at 02:44 +0800, Wen Yang wrote:
> Thank you for the patient explanation.
> You are right, and v4 implements the embedded approach.
> struct rv_uprobe directly embeds struct uprobe_consumer:
> 
>    struct rv_uprobe {
>        struct uprobe_consumer  uc;
>        struct uprobe          *uprobe;
>        struct inode           *inode;
>        void                   *priv;
>        int (*handler)(...);
>        int (*ret_handler)(...);
>    };

Alright, great. Why are you still using double function pointers? Do you really
need rv_uprobe->handler instead of just using rv_uprobe->uc.handler ? That also
simplifies one function call down the road.

Thanks,
Gabriele

> rv_uprobe_free() is gone — no allocation means no explicit free.  After
> rv_uprobe_unregister() (or rv_uprobe_unregister_nosync() + 
> rv_uprobe_sync()), the caller frees the containing struct directly.  In 
> tlob:
> 
>    rv_uprobe_unregister_nosync(&b->start_probe);
>    rv_uprobe_unregister_nosync(&b->stop_probe);
>    rv_uprobe_sync();
>    kfree(b);   /* frees both embedded consumers */
> 
> This is the pattern from your sketch.
> 
> Regarding my earlier reply that argued for the separate allocation: I 
> was wrong. The key barrier is synchronize_rcu_tasks_trace() (called 
> first in uprobe_unregister_sync()), which waits for all 
> rcu_read_lock_trace() readers including handler_chain().  After it 
> returns, no cons_node.next read is in flight and embedding is safe.
> 
> We appreciate your thorough review. All of your comments have been 
> addressed in v4.
> We'll run local tests for one or two days, and then it will be sent out 
> shortly.
> 
> --
> Best wishes,
> Wen
> 


  reply	other threads:[~2026-07-01 11:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-07 16:13 [PATCH v3 0/9] rv/tlob: Add task latency over budget RV monitor wen.yang
2026-06-07 16:13 ` [PATCH v3 1/9] rv/da: introduce DA_MON_ALLOCATION_STRATEGY wen.yang
2026-06-15  9:56   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 2/9] rv: add generic uprobe infrastructure for RV monitors wen.yang
2026-06-16  9:49   ` Gabriele Monaco
2026-06-28 16:47     ` Wen Yang
2026-06-30  8:48       ` Gabriele Monaco
2026-06-30 18:44         ` Wen Yang
2026-07-01 11:57           ` Gabriele Monaco [this message]
2026-06-07 16:13 ` [PATCH v3 3/9] rv/tlob: add tlob model DOT file wen.yang
2026-06-07 16:13 ` [PATCH v3 4/9] rv/ha: fix ha_invariant_passed_ns silent bypass of invariant check wen.yang
2026-06-15 10:12   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 5/9] rv/ha: make da_monitor_reset_hook and EVENT_NONE_LBL overridable wen.yang
2026-06-15 10:16   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 6/9] rv/tlob: add tlob hybrid automaton monitor wen.yang
2026-06-15 15:24   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 7/9] rv/tlob: add KUnit tests for the tlob monitor wen.yang
2026-06-17  7:49   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 8/9] selftests/verification: fix verificationtest-ktap for out-of-tree execution wen.yang
2026-06-16 11:14   ` Gabriele Monaco
2026-06-07 16:13 ` [PATCH v3 9/9] selftests/verification: add tlob selftests wen.yang
2026-06-16 14:58   ` Gabriele Monaco
2026-06-17 15:09   ` Gabriele Monaco
2026-06-22  9:26   ` Gabriele Monaco
2026-06-13 16:00 ` [PATCH v3 0/9] rv/tlob: Add task latency over budget RV monitor Wen Yang

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=e8e6c6ddb99e096b2daf2a88891cdce703730bdd.camel@redhat.com \
    --to=gmonaco@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=wen.yang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox