From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C3663850422; Thu, 23 Jul 2020 15:40:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C3663850422 From: "fche at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/26296] New: delay script-global locking until required Date: Thu, 23 Jul 2020 15:40:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fche at redhat dot com X-Bugzilla-Status: NEW 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 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2020 15:40:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26296 Bug ID: 26296 Summary: delay script-global locking until required Product: systemtap Version: unspecified Status: NEW Severity: normal Priority: P2 Component: translator Assignee: systemtap at sourceware dot org Reporter: fche at redhat dot com Target Milestone: --- The scripting language promises atomic execution of handlers that read/write global variables. This is implemented by taking read/write locks as appropriate, early in the probe handler prologue. It has been repeatedly observed that this causes perhaps unnecessary overheads (e.g. bug #7033). We can imagine a change that could maintain the atomic semantics, but handle the common pattern: global bar probe foo { if(condition) next; bar =3D $var } where a pure filtering predicate that does not read global variables is expected to frequently skip execution of the critical sections entirely. Instead of emitting: prologue: lock_all() body: if(condition) goto epilogue; bar=3D$var epilogue: unlock_all() we could emit: prologue: locked_p =3D false body: if(condition) goto epilogue; if(!locked_p) lock_all(); locked_p =3D true; bar=3D$var epilogue: if (locked_p) unlock_all() IOW: defer locking to the first moment when any global is actually read/written, tracking locked-ness in a new context local. This would invo= lve only a small change to the translator, involving only context-free logic. = That could later be optimized to remove repeated checks/etc. over multiple global vars= in a control-flow / context aware way. --=20 You are receiving this mail because: You are the assignee for the bug.=