Received: by 10.223.164.202 with SMTP id h10csp2365791wrb; Sat, 18 Nov 2017 20:22:21 -0800 (PST) X-Google-Smtp-Source: AGs4zMb1p5o+RP0f4VZkG+4Up/DIicsOYHjqjP05VthVaqAcljxvnqgOacmALmARqS6G4OdLN3Us X-Received: by 10.98.34.199 with SMTP id p68mr6961229pfj.241.1511065341863; Sat, 18 Nov 2017 20:22:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511065341; cv=none; d=google.com; s=arc-20160816; b=lamJJjg8PR9ENX/4T4dA5S2hGBXXyAqe4WaQPhqiBAZbatgCLfyVJV66bQ5i/4IhzH Aut6HPuemlSW5iFzTfpWFoArAzLHtAdxk+h5orPgDoyTtznqmG8/5X+jqwyNTdtpeCzC UNNMimGtCMm9kc7foZmTVqe6y1M/MkaHm6I+z+Q48vlr1PajZycn7aCkyLN5ZlJuhQHe f78qSVQGM111+MZOEIO26V9F/koGN06QroP3AWvXCkhm1O2InD+/zrQ3Ocinw1pIMDBJ U6iA+y+ydXiYrGddLrPihHYkZIl04qFsACCoy+SUcwzLlTsWyqMFxn+b7dZ+PiwlZa/Z dRog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=fElg4KqgJew9VN7wJU0wQv561oQdU3q1PMw+1pshT3U=; b=KgYG8ZH+z/EK73bouB8Bt7IoVKksR418seVf727TM5MQvzJQ1O+zQWS6Bg/WkZnQ6T HFSUcKj9rwM4gXNWF8nd0myoT6Xb2T7FtwOWrpu/j8nTYUPLe2Ov73Sf2CDvYMEDK2MN T+UFqjVfwb5JEcRJbXt79WU4rPzNvSDOKog5xORRFBiAFQIkATLXEQcQE0FSkE22ksqk cWNMAHrj/KD/Ms/dFUG/T49Oht3U55NXD1i9aqXiaP6Q0+20F520ov/1bxio3uiY90WL zkjodHGG1abnwp8tUkH96R7P6r/PA0Jw9Xfw3OWqVtV/S0F/s66pNetVzP0GnRhFv3qv 2u4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=TBp5XcSp; 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 i69si6190142pfd.147.2017.11.18.20.22.09; Sat, 18 Nov 2017 20:22:21 -0800 (PST) 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; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=TBp5XcSp; 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 S1763377AbdKRVJu (ORCPT + 92 others); Sat, 18 Nov 2017 16:09:50 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:36456 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763363AbdKRVJl (ORCPT ); Sat, 18 Nov 2017 16:09:41 -0500 Received: by mail-it0-f66.google.com with SMTP id 187so5690406iti.1 for ; Sat, 18 Nov 2017 13:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fElg4KqgJew9VN7wJU0wQv561oQdU3q1PMw+1pshT3U=; b=TBp5XcSpLEnzhnTCmPRKZ6yFAv+SOxfR7qXoQitoLmo0A5dJvFiQUUf3MROwlWsb5M DPctR44NJuVzvBkwC1Nr40qikejIMcxfs+dWOxUefgKHCBYTaQJWftSSmpWN30Rf1n5r z6GezR1EtRHabY8e3Vq9Gs9LCwlYg+PRT1pbboO38dYajy9VBjHHrbwj5LX0C/8l4HMO J4JPyDg8Bof9ZhAz9BONBxDTsfWU36FeZBFXiuHI83vNBrFvKm0B1c0aakDokyygC/a2 ObxMXyVCq+bpOFJ5IeiNZIrurANDk1ughRIPHXz52DE+HqctkLAYUvqrNtiBImprQLou Unww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fElg4KqgJew9VN7wJU0wQv561oQdU3q1PMw+1pshT3U=; b=AkjdkuBNoIFRCetTJ9pvmrsggeVA35qclMhwa3AQKwdtLticDcWOdve9iKt2dORoX9 Ygi+CAUXUUAZJR9YpQ2ENdImMP6kXDqn7hBTUDg5pbUZRjv87E7xSsUIW7C92ZC/ToFh GyqFti3V90wDk+7VBXCSJUgi9PrJVjyLPfeRUfyu4S/2PDo0JTFemKNJkgV+J1wFZwjz 8OuYjoCgkTm9Xtdqbn1Djycyc7vltvJvVKNzETlmGQ2dVt1QSLixax5J034lEL/ZPOzp QMzsib81qBGlhsX6DLkWwwN+fC0g+i+HMzQfc0CLTAkb52ELfxNr2O1WWt79HFjDXja1 lCVQ== X-Gm-Message-State: AJaThX4oCQzGbVDuocj/HNI/T6c2bumAAwQn/PEYNDQ967c0K/3XcEgq PywvxPSrbBfgJcJwiLcCHqB4junXhSSx0XJIHoq76A== X-Received: by 10.36.184.5 with SMTP id m5mr13155719ite.69.1511039380772; Sat, 18 Nov 2017 13:09:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.133.35 with HTTP; Sat, 18 Nov 2017 13:09:20 -0800 (PST) In-Reply-To: References: <20171114200414.2188-1-mathieu.desnoyers@efficios.com> <20171114200414.2188-9-mathieu.desnoyers@efficios.com> <20171117001410.GG2482@two.firstfloor.org> <1756446476.17265.1510938872121.JavaMail.zimbra@efficios.com> <20171117181839.GH2482@two.firstfloor.org> <20171117191547.GI2482@two.firstfloor.org> From: Andy Lutomirski Date: Sat, 18 Nov 2017 13:09:20 -0800 Message-ID: Subject: Re: [RFC PATCH v3 for 4.15 08/24] Provide cpu_opv system call To: Thomas Gleixner Cc: Andi Kleen , Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Dave Watson , linux-kernel , linux-api , Paul Turner , Andrew Morton , Russell King , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Chris Lameter , Ben Maurer , rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 17, 2017 at 12:07 PM, Thomas Gleixner wrote: > On Fri, 17 Nov 2017, Andi Kleen wrote: >> > The most straight forward is to have a mechanism which forces everything >> > into the slow path in case of debugging, lack of progress, etc. The slow >> >> That's the abort address, right? > > Yes. > >> For the generic case the fall back path would require disabling preemption >> unfortunately, for which we don't have a mechanism in user space. >> >> I think that is what Mathieu tried to implement here with this call. > > Yes. preempt disabled execution of byte code to make sure that the > transaction succeeds. > > But, why is disabling preemption mandatory? If stuff fails due to hitting a > breakpoint or because it retried a gazillion times without progress, then > the abort code can detect that and act accordingly. Pseudo code: > > abort: > if (!slowpath_required() && > !breakpoint_caused_abort() && > !stall_detected()) { > do_the_normal_abort_postprocessing(); > goto retry; > } > > lock(slowpath_lock[cpu]); > > if (!slowpath_required()) { > unlock(slowpath_lock[cpu]); > goto retry; > } > > if (rseq_supported) > set_slow_path(); > > /* Same code as inside the actual rseq */ > do_transaction(); > > if (rseq_supported) > unset_slow_path(); > > unlock(slowpath_lock[cpu]); My objection to this approach is that people will get it wrong and not notice until it's too late. TSX has two things going for it: 1. It's part of the ISA, so debuggers have very well-defined semantics to deal with and debuggers will know about it. rseq is a made-up Linux thing and debuggers may not know what to do with it. 2. TSX is slow and crappy, so it may not be that widely used. glibc, OTOH, will probably start using rseq on all machines if the patches are merged. From 1584394646711470634@xxx Sat Nov 18 09:14:41 +0000 2017 X-GM-THRID: 1584073649300144580 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread