Received: by 10.213.65.68 with SMTP id h4csp1819442imn; Thu, 29 Mar 2018 11:37:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+8kaDNeqNTrIfwDAPrtnS8LH8ziyT2zuNCtzfnOM2iWwuurOAAHqfrtisqpjrOkeQgIWMP X-Received: by 10.98.200.82 with SMTP id z79mr7321940pff.45.1522348647752; Thu, 29 Mar 2018 11:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522348647; cv=none; d=google.com; s=arc-20160816; b=bgC3ioVSO4fYe7qv2B+l4uByGcAESFAu8KQuskcqHTvgd3U3p1BA7P4XNPc3641jgE 1Apv8jptI33bsQFvFtHqPZM/HurTcexPd++ADKou/aug1IRPxV14hMbMjwyeVbF8D3or EQioWa9i1PhzCvx4jvIVRIYJWIWrb9GmQcrFAPQq0usFFMIcw5l/nJk1BACFe8CDfi0P uSjnEFARwM4ly/kaSEaGUFFZcEpxvM0/4SEvGXqMGpltBiSIoUcDxTDM1+12I9+T8eJ1 1abR3ptWFKrck8a7VS/86jHZ9L5Q8gobSVsVE5SB8xfiKlx8+H2xbDTEDyUp6+p3/Xr5 6CaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:arc-authentication-results; bh=ShOgZyWm5mPzDgT/GTHhQaajKKtqWM+V2Y3Fx9Hy68c=; b=jhmAB/wPVsVLSrwSuaflGB/+HyjeNMwUNBx0XEDvED0wLBMcwDH2VnpNGveOTgaPb4 UqcY8INSf+jDqAkQFq7BtfF5ZPtMo2yrylQpiDjJaF87atL4JpSui7bbrsaknL1wXTlJ QUHutu6ABd4XREBZw6bcchuTbVPj6dVwrNVV4cw2G0fOgm2w9JxSU52aswbJMrtxs9bB d3JPNPFKUAj/bNixgxlhJIUvskXeVQQcUtVmRjsN+NZbBacUm3U20ANdiGEjJCdV9Msj EFGxlByqHo9UmGsurhxm53kXCU3FjC0X8R9LVPqcObguSHmtZ23402eCAiS4cf6mXidh VqQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b60-v6si6364603plc.75.2018.03.29.11.37.14; Thu, 29 Mar 2018 11:37:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752873AbeC2SfV (ORCPT + 99 others); Thu, 29 Mar 2018 14:35:21 -0400 Received: from mail.efficios.com ([167.114.142.138]:52096 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbeC2SfS (ORCPT ); Thu, 29 Mar 2018 14:35:18 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 852ED1A99DE; Thu, 29 Mar 2018 14:35:17 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PqI7ACmNqKip; Thu, 29 Mar 2018 14:35:16 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id D226E1A99DB; Thu, 29 Mar 2018 14:35:16 -0400 (EDT) X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail02.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0TK7SDuzN_hI; Thu, 29 Mar 2018 14:35:16 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id B65521A99CB; Thu, 29 Mar 2018 14:35:16 -0400 (EDT) Date: Thu, 29 Mar 2018 14:35:16 -0400 (EDT) From: Mathieu Desnoyers To: rostedt , Andy Lutomirski Cc: Peter Zijlstra , Thomas Gleixner , "Paul E. McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson , linux-kernel , linux-api , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Alexander Viro Message-ID: <1657598086.875.1522348516598.JavaMail.zimbra@efficios.com> In-Reply-To: <20180329140752.12661138@gandalf.local.home> References: <20180327160542.28457-1-mathieu.desnoyers@efficios.com> <87410797.545.1522331641598.JavaMail.zimbra@efficios.com> <20180329142338.GD4043@hirez.programming.kicks-ass.net> <544124089.623.1522337940950.JavaMail.zimbra@efficios.com> <20180329122439.4a909c72@gandalf.local.home> <21903915.856.1522346553810.JavaMail.zimbra@efficios.com> <20180329140752.12661138@gandalf.local.home> Subject: Re: [RFC PATCH for 4.17 02/21] rseq: Introduce restartable sequences system call (v12) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.7_GA_1964 (ZimbraWebClient - FF52 (Linux)/8.8.7_GA_1964) Thread-Topic: rseq: Introduce restartable sequences system call (v12) Thread-Index: gA/dD3LVfqsnqJskpVlD2WUe2Cj1VA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Mar 29, 2018, at 2:07 PM, rostedt rostedt@goodmis.org wrote: > On Thu, 29 Mar 2018 14:02:33 -0400 (EDT) > Mathieu Desnoyers wrote: > >> Currently, anyone using ptrace on a process has pretty much given up all >> hopes of performance. Processes will use rseq to gain performance, not the >> opposite, so this deterioration will be unwelcome. > > The ptrace path has nothing to do with ptrace anymore, and probably be > hard to notice the performance hit. You simply set a TIF flag, and on > exit of the syscall it jumps to a path that checks special cases > (tracing system calls being one of them). It's called the ptrace path > because ptrace was the first one to use it (I'm guessing, I haven't > actually looked at the history). Last time I checked, it's not only a jump, it's actually saving/restoring tons of registers. Did this change recently ? I use it for LTTng syscall tracing too. My experience so far is that it's really terribly slow. I've been waiting on Andy Lutomirski to complete his changes in that area to look into making this faster for syscall tracepoints. > > This is used to add any system call checks that are not done during > normal operation. And this certainly falls under that category. I know it's used for stuff like seccomp too. My guess has always been that security people care much more about robustness than performance. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com