[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <172285896262.2215.6938257232093000341.tip-bot2@tip-bot2>
Date: Mon, 05 Aug 2024 11:56:02 -0000
From: "tip-bot2 for Oleg Nesterov" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Oleg Nesterov <oleg@...hat.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, Jiri Olsa <jolsa@...nel.org>,
Andrii Nakryiko <andrii@...nel.org>,
"Masami Hiramatsu (Google)" <mhiramat@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: perf/core] uprobes: fold __uprobe_unregister() into uprobe_unregister()
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 70408bebba94a63ea11471ed00168cd8606a9328
Gitweb: https://git.kernel.org/tip/70408bebba94a63ea11471ed00168cd8606a9328
Author: Oleg Nesterov <oleg@...hat.com>
AuthorDate: Thu, 01 Aug 2024 15:27:44 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Fri, 02 Aug 2024 11:30:32 +02:00
uprobes: fold __uprobe_unregister() into uprobe_unregister()
Fold __uprobe_unregister() into its single caller, uprobe_unregister().
A separate patch to simplify the next change.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Reviewed-by: Jiri Olsa <jolsa@...nel.org>
Acked-by: Andrii Nakryiko <andrii@...nel.org>
Acked-by: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Link: https://lore.kernel.org/r/20240801132744.GA8814@redhat.com
---
kernel/events/uprobes.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index eacf287..175058b 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1085,20 +1085,6 @@ register_for_each_vma(struct uprobe *uprobe, struct uprobe_consumer *new)
return err;
}
-static void
-__uprobe_unregister(struct uprobe *uprobe, struct uprobe_consumer *uc)
-{
- int err;
-
- if (WARN_ON(!consumer_del(uprobe, uc)))
- return;
-
- err = register_for_each_vma(uprobe, NULL);
- /* TODO : cant unregister? schedule a worker thread */
- if (!uprobe->consumers && !err)
- delete_uprobe(uprobe);
-}
-
/**
* uprobe_unregister - unregister an already registered probe.
* @uprobe: uprobe to remove
@@ -1106,9 +1092,18 @@ __uprobe_unregister(struct uprobe *uprobe, struct uprobe_consumer *uc)
*/
void uprobe_unregister(struct uprobe *uprobe, struct uprobe_consumer *uc)
{
+ int err;
+
get_uprobe(uprobe);
down_write(&uprobe->register_rwsem);
- __uprobe_unregister(uprobe, uc);
+ if (WARN_ON(!consumer_del(uprobe, uc)))
+ err = -ENOENT;
+ else
+ err = register_for_each_vma(uprobe, NULL);
+
+ /* TODO : cant unregister? schedule a worker thread */
+ if (!err && !uprobe->consumers)
+ delete_uprobe(uprobe);
up_write(&uprobe->register_rwsem);
put_uprobe(uprobe);
}
Powered by blists - more mailing lists