From: Oleg Nesterov <oleg@redhat.com>
To: Andrii Nakryiko <andrii@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Cc: Liao Chang <liaochang1@huawei.com>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: [PATCH 2/2] uprobes: fold xol_take_insn_slot() into xol_get_insn_slot()
Date: Tue, 1 Oct 2024 16:25:03 +0200 [thread overview]
Message-ID: <20241001142503.GA13633@redhat.com> (raw)
In-Reply-To: <20241001142416.GA13599@redhat.com>
After the previous change xol_take_insn_slot() becomes trivial, kill it.
Signed-off-by: Oleg Nesterov <oleg@redhat.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
next prev parent reply other threads:[~2024-10-01 14:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 14:24 [PATCH 0/2] uprobes: kill xol_area->slot_count Oleg Nesterov
2024-10-01 14:24 ` [PATCH 1/2] " Oleg Nesterov
2024-10-08 11:05 ` [tip: perf/core] " tip-bot2 for Oleg Nesterov
2024-10-01 14:25 ` Oleg Nesterov [this message]
2024-10-08 11:05 ` [tip: perf/core] uprobes: fold xol_take_insn_slot() into xol_get_insn_slot() tip-bot2 for Oleg Nesterov
2024-10-01 16:59 ` [PATCH 0/2] uprobes: kill xol_area->slot_count Andrii Nakryiko
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=20241001142503.GA13633@redhat.com \
--to=oleg@redhat.com \
--cc=andrii@kernel.org \
--cc=jolsa@kernel.org \
--cc=liaochang1@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=peterz@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox