Received: by 10.192.165.148 with SMTP id m20csp861013imm; Wed, 2 May 2018 09:56:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo14zplZNSGjvCzhcx8XeKqB4etbbOank1zGSuAdMYdwoXA1lCI5PvL/488yoJ6oaumuRy9 X-Received: by 10.98.3.3 with SMTP id 3mr20003943pfd.255.1525280206929; Wed, 02 May 2018 09:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525280206; cv=none; d=google.com; s=arc-20160816; b=AdfFU/M6JmXdaq7EdTNy1BSyHLGcp1qU/jZGOqa5+K84kUHCbHOTCv5XaLtFQy0S8n FBZsyWxP34Czswqhv/TdxWqnro4tFMyRZZnNsngjOHsxvjIXXLTRM6Tvnh/DgvMbgcaH zN3rA7Klch7zt4Od67dAOoT6zA/ssd4bFiBuQt1azu4uXv4kWSVbgxlBfFphS5ezj4OE SOzyM1wnk880HPP+B3vS7GeEKnPyILottMXaoJvnDZHtXxIkqv6ATWWV5HV1GN6NksO7 w1o6zTfWSKCiCxZ/iMiLUXASSf125pGOYUMTIjw8ySWHJKXNE2EuT1ptY54Lsa/2wiHg 6uJw== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=UHCwwX+Ry1PxIuyscMenCpMbLrsBwW27pbXsIExkA8I=; b=UTum0B2TJmVOGzn0isw5lpITp4DBflrh48PFKxQFFaqyfrk1lmi4RJJHwXo3j3CNLa 94cgRzy6JTjYAAUpO3nnOA+Hx2G3tXaLTfX+DkSxaTP/7fh+1urSuOsCwVvq1Z9PPLCR 2EKVzAQKW3F0qm3ngc1E3lZzNxDxi6n1yNG0mDx7fKfBemHgkiFlEs+mjScrKpkY1wHJ HvR466on0ZXY3IjX5+x2ywXAT9w6/h97prExHo35pMDa0FKqL8ojtZNIgjY2UtTgjQJW FOwA3EXNZRL5BpWV2xQphTSfGiXG2hSWunBUBcBbONKsavxXtTWAVfQn/aIdWABWWmkH BOjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KrC7+F0h; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a66si11423543pfb.81.2018.05.02.09.56.32; Wed, 02 May 2018 09:56:46 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=KrC7+F0h; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751782AbeEBQ4A (ORCPT + 99 others); Wed, 2 May 2018 12:56:00 -0400 Received: from mail-io0-f180.google.com ([209.85.223.180]:33783 "EHLO mail-io0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751100AbeEBQz4 (ORCPT ); Wed, 2 May 2018 12:55:56 -0400 Received: by mail-io0-f180.google.com with SMTP id e78-v6so18323728iod.0 for ; Wed, 02 May 2018 09:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UHCwwX+Ry1PxIuyscMenCpMbLrsBwW27pbXsIExkA8I=; b=KrC7+F0heXyR4LEz/CV4iVrNKBWQLNHOH2l7QhOIPlJZIIq0ibXmH8u1r1u8o+F2yL UCjykeYrNWTcLT03SmYFutdOgNPD8lDb+QU/VPNDO87MXtAyJiFRWkB+dfwaY8DHi+LD bB0intzF7/wkFhWL1rD+DCyeqi6qLWeAfNg3/A/1sHJkItGUgyDFSvLdcmXGhTuDxRoS hFbv9zvkCy/VQa7IsgMaeXiTlP63DGS/QTzSzeWeycXUO6HMBb5vt9mv52G1LDEKfLAI 7YVerT6zfK2yEDB+wlXgEuK6VErd0NHsjabT9rXGU4QeyF2yZuGuF/kkmDr+coAwepRn PTRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UHCwwX+Ry1PxIuyscMenCpMbLrsBwW27pbXsIExkA8I=; b=nejQvlS7CTAYa4TDtXVuPqOYOYQzwi6rLafGBeuVNRcpiXqL22hiAoS4dIYcN4pjcj hs3+FFZ0YfodUkycYGuDOtjOU1OAGAbe8HfCZQQIVt9zlAU0cw9B4NUqA+tR1NeswYdo y/zF5aowtKPENaUM5Sn6p9Ozdx860LenOwlZvFft7TyqGoze12mFzOePVjtVRGHLE3ax RZT8N6c30OkTAK/tsIGnMs/BPGe3m3foaVGEsxSUk8CnzJnQAC+DrWO7ZyoH6XEtiDsI OA3gdFw20D0fmzaTpfv5t9lEGZ76Rl3/KfPdss3qnEvqqMBEBgxWpe3a2KYaPIEHvqjd YYmQ== X-Gm-Message-State: ALQs6tBpg96bqtJe5oo2FME0cAnoUrHWg1BPp/ML2vJJQwOv8Qsb8U21 oOAfElxfKKfV2ASpntcarhya3ygMKmu2nzLWonyRFg== X-Received: by 2002:a6b:27d5:: with SMTP id n204-v6mr21364784ion.206.1525280155686; Wed, 02 May 2018 09:55:55 -0700 (PDT) MIME-Version: 1.0 References: <20180430224433.17407-1-mathieu.desnoyers@efficios.com> <660904075.9201.1525276988842.JavaMail.zimbra@efficios.com> <20180502124253.145253cb@gandalf.local.home> In-Reply-To: <20180502124253.145253cb@gandalf.local.home> From: Daniel Colascione Date: Wed, 02 May 2018 16:55:44 +0000 Message-ID: Subject: Re: [RFC PATCH for 4.18 00/14] Restartable Sequences To: rostedt@goodmis.org Cc: Mathieu Desnoyers , Peter Zijlstra , Paul McKenney , boqun.feng@gmail.com, luto@amacapital.net, davejwatson@fb.com, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Andrew Morton , linux@arm.linux.org.uk, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, Andrew Hunter , andi@firstfloor.org, cl@linux.com, bmaurer@fb.com, josh@joshtriplett.org, torvalds@linux-foundation.org, catalin.marinas@arm.com, will.deacon@arm.com, Michael Kerrisk-manpages , Joel Fernandes 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 Wed, May 2, 2018 at 9:42 AM Steven Rostedt wrote: > On Wed, 02 May 2018 16:07:48 +0000 > Daniel Colascione wrote: > > Why couldn't we take a page fault just before schedule? The reason we can't > > take a page fault in atomic context is that doing so might call schedule. > > Here, we're about to call schedule _anyway_, so what harm does it do to > > call something that might call schedule? If we schedule via that call, we > > can skip the manual schedule we were going to perform. > Another issue is slowing down something that is considered a fast path. There are two questions: 1) does this feature slow down schedule when you're not using it? and 2) is schedule unacceptably slow when you are using this feature? The answer to #1 is no; rseq already tests current->rseq during task switch (via rseq_set_notify_resume), so adding a single further branch (which we'd only test when we follow the current->rseq path anyway) isn't a problem. Regarding #2: yes, a futex operation will increase path length for that one task switch, but in the no-page-fault case, only by a tiny amount. We can run benchmarks of course, but I don't see any reason to suspect that the proposal would make task switching unacceptably slow. If we *do* take a page fault, we won't have done much additional work overall, since *somebody* is going to take that page fault anyway when the lock is released, and the latency of the task switch shouldn't increase, since the futex code will very quickly realize that it needs to sleep and call schedule anyway.