[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241001142503.GA13633@redhat.com>
Date: Tue, 1 Oct 2024 16:25:03 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Andrii Nakryiko <andrii@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Cc: Liao Chang <liaochang1@...wei.com>, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org
Subject: [PATCH 2/2] uprobes: fold xol_take_insn_slot() into
xol_get_insn_slot()
After the previous change xol_take_insn_slot() becomes trivial, kill it.
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---
kernel/events/uprobes.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index 38d91e10d455..40ecab0971ff 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1643,29 +1643,20 @@ static unsigned long xol_get_slot_nr(struct xol_area *area)
return UINSNS_PER_PAGE;
}
-/*
- * - search for a free slot.
- */
-static unsigned long xol_take_insn_slot(struct xol_area *area)
-{
- unsigned long slot_nr;
-
- wait_event(area->wq, (slot_nr = xol_get_slot_nr(area)) < UINSNS_PER_PAGE);
-
- return area->vaddr + slot_nr * UPROBE_XOL_SLOT_BYTES;
-}
-
/*
* xol_get_insn_slot - allocate a slot for xol.
*/
static bool xol_get_insn_slot(struct uprobe *uprobe, struct uprobe_task *utask)
{
struct xol_area *area = get_xol_area();
+ unsigned long slot_nr;
if (!area)
return false;
- utask->xol_vaddr = xol_take_insn_slot(area);
+ wait_event(area->wq, (slot_nr = xol_get_slot_nr(area)) < UINSNS_PER_PAGE);
+
+ utask->xol_vaddr = area->vaddr + slot_nr * UPROBE_XOL_SLOT_BYTES;
arch_uprobe_copy_ixol(area->page, utask->xol_vaddr,
&uprobe->arch.ixol, sizeof(uprobe->arch.ixol));
return true;
--
2.25.1.362.g51ebf55
Powered by blists - more mailing lists