From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2726A3858D20; Mon, 30 Oct 2023 22:16:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2726A3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1698704197; bh=wUwdtXz5H4Cgoh+cNOxjjhOix5zdHfMfrCr2SMtD0+U=; h=From:To:Subject:Date:From; b=IWNOcr+lO7d4uS8J1yo7jJ5w/F6od8oHNerNn9vozgNwapeL6SOXAMuY10qOSYSb0 pxGOENrxLzpInwBbUXVaC6LVrVJyuJwfspFqaCaoslkyTi84Jng7vWx5tuaLSdfwnt Lyg5aitwl3FJcKUA/VxgfacaJhS9L2TG47cUiJUI= From: "agentzh at gmail dot com" To: systemtap@sourceware.org Subject: [Bug runtime/31014] New: Uprobes registered in task finder would block the target processes for long time Date: Mon, 30 Oct 2023 22:16:36 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: agentzh at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31014 Bug ID: 31014 Summary: Uprobes registered in task finder would block the target processes for long time Product: systemtap Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: runtime Assignee: systemtap at sourceware dot org Reporter: agentzh at gmail dot com Target Milestone: --- Currently, the stap runtime tries to call uprobe_register() to register new uprobes inside the context of the target processes via the task finder. This makes little sense for inode-based uprobes implemented in modern kernels and also introduces significant (8ms+) delay in all the target processes via the task work mechanism. Such delays may manifest themselves in syscalls like epoll_wait inside the target processes. All the target processes are affected even though only one task finder call= back gets to call uprobe_register(). Other concurrent target processes would just wait on the lock `c->consumer_lock`. After talking with fche, I'd propose that we should register uprobes early before starting the task finder callbacks. This still may block a CPU core = for 8ms+ or so, but it no longer blocks all the target processes in their own process contexts. Will prepare a patch shortly. --=20 You are receiving this mail because: You are the assignee for the bug.=