Received: by 10.192.165.148 with SMTP id m20csp660063imm; Fri, 4 May 2018 17:41:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqsXklii7/X10FW25oo1ncJe5FL3LduXXX7/RwU1W59aBsSmybNbRjMy6+nQOT5oleharbS X-Received: by 2002:a17:902:b286:: with SMTP id u6-v6mr30012001plr.68.1525480885308; Fri, 04 May 2018 17:41:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525480885; cv=none; d=google.com; s=arc-20160816; b=xO28SPIBIYPr141gExRCWG1v8+3vySTxC2ujhrCYRufkXP/LdrmfX6xi7XmrcIC2Dv djTmy78VEyCf4/AOtDup9E40Ni9GvRPMp/nPhAZLvPR9vGRv5m6zMUsrl8ERAy2CcFCc xkVOYrf/qn3paPFDOg4wlBwN286EmbDoxDMNTpslW/rF1OyjU3aFupzPentyz7HbmIJw MIbBaEmmqwFSeXtlvy1kjEI6sApTemv1fefyeJyBIyn5v8JEVmvTgh86w5xm6+INuLp/ fBXzTHCNUlSJ6kchNUynvhciNSMOmbifB0RRet+PWGfkaMdDA25uNZSGlP8S4OyNAy9i gRdw== 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=F/dVIp+Nbydyw5LCP8poQUctZqa3UZwGURcQLAOJXa0=; b=mwypLh1wMZEvg0GTL10CD9l3wD+fmlG+eVvge2iRbYDeBd40N3rpfTdvfCuTGVnJqy m1zt6rHr8YeLnebMPeJVhPSdn6MyEqPYopuIidug14dDl/on2F4MoJ31OlJEL5QK6hH6 J7rRBlxL8oVLdkfrCoLvoRPQ4bTQSOiLkZO113YD6tMJ0B+urm1R0IPQ+OyxIAnY8oVB QdCBoBYc6qOo2awVeLCh//dO8MjlX6Cj4Hh9O/KdOQktaErk7VDkqbOr03+KkmxORhhj RSWAuEo//k8yvfxuaw1qezw3/XvjLiedOQwdM3+lF9MCAv62d+c0YlUjTSr52TUrNYIr cljQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vAftbBeb; 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 90-v6si16756331plc.205.2018.05.04.17.41.10; Fri, 04 May 2018 17:41:25 -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=vAftbBeb; 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 S1751807AbeEEAjs (ORCPT + 99 others); Fri, 4 May 2018 20:39:48 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:41487 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710AbeEEAjr (ORCPT ); Fri, 4 May 2018 20:39:47 -0400 Received: by mail-io0-f170.google.com with SMTP id e12-v6so27603324iob.8 for ; Fri, 04 May 2018 17:39:47 -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=F/dVIp+Nbydyw5LCP8poQUctZqa3UZwGURcQLAOJXa0=; b=vAftbBebRitZrN+CUzLFNMA2LfS21BNVMicgSmPqXSDHsT5K8fYT0A1xVKpCLAhtZr O5JXcVenabTtDRcZxmKnN0GoAjjpKl664ROBDqbzdYe4O1XE4/SvWomQS0wmDNfztgVy XcrEM0klkIdr4o/XodS2p9Q3Td4g/68PFr/zAV5tufIlzIC+Yv9LPg1o0UJRlTWTz1fu NQCK+9MSigEA11SHxGtkUn6I/wFVnlxF0SXcClSRWah3S6mL6TizdSGYLARRejvCDJRC hspnT1YRhO+Ok0zV/tq2OvOgUJPZSACk+44NtyC6Z5cWLU4WJYyZffKO1jXoeC12ZKc9 lpcA== 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=F/dVIp+Nbydyw5LCP8poQUctZqa3UZwGURcQLAOJXa0=; b=O9dWc2mSx/a9DOYDDcTcRi1Eyp4GunLqrMr2dYGGpNGzJJ8p8XKf72g52DaTtwOq3t 7Nl8p8jFfMbpsD/6pZfNZDax8p6MYA76S322mmWuCLWXn/YdHYlT0R19Y/v3BCoqoPNX gXhy6Os8vChmIwyDujqDVHA6mnvlKwQSo+KnPfRniw7gJAgP8/LVImtZ9ZcvRSl82JP1 KilFdZF08GzkQT/ctv68qriB8nK7vQTg6o30VwCJTgcoFUqWnmrOajzXYs2i0MpIVYha D9tb4gBE40UEF/urIC0sWJlEHdW21Ii+dUGTZsOJMnv1DYf2j1+4HUF+BdVQdSMaYs4+ 801w== X-Gm-Message-State: ALQs6tAwebeG4p4qiSesD/aw2TKbmUCUpFyc10u9tnwzQVbzKXMIZQLj bqNvJxSgruTrufa9toj0kNvCWVcQZ3UJO5xrHfHfIg== X-Received: by 2002:a6b:be01:: with SMTP id o1-v6mr30463819iof.299.1525480786848; Fri, 04 May 2018 17:39:46 -0700 (PDT) MIME-Version: 1.0 References: <20180504123050.2841f80d@gandalf.local.home> <20180504174330.GS26088@linux.vnet.ibm.com> <20180504184951.GU26088@linux.vnet.ibm.com> <20180504201129.GX26088@linux.vnet.ibm.com> <20180504224921.GE26088@linux.vnet.ibm.com> <5ab0c23a-f98d-859f-593f-f32f6c470626@google.com> <20180504234342.GJ26088@linux.vnet.ibm.com> In-Reply-To: <20180504234342.GJ26088@linux.vnet.ibm.com> From: Joel Fernandes Date: Sat, 05 May 2018 00:39:36 +0000 Message-ID: Subject: Re: rcu-bh design To: Paul McKenney Cc: "Joel Fernandes (Google)" , Steven Rostedt , Mathieu Desnoyers , LKML 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, May 4, 2018 at 4:42 PM Paul E. McKenney wrote: [..] > > Say that the tracepoint code is buggy and for some reason a > > call_srcu wasn't done. For example, say the hypothetical bug I'm > > taking about is in tracepoint_remove_func which called the > > rcu_assign_pointer, but didn't call release_probes: > > > > diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c > > index d0639d917899..f54cb358f451 100644 > > --- a/kernel/tracepoint.c > > +++ b/kernel/tracepoint.c > > @@ -216,7 +216,6 @@ static int tracepoint_add_func(struct tracepoint *tp, > > rcu_assign_pointer(tp->funcs, tp_funcs); > > if (!static_key_enabled(&tp->key)) > > static_key_slow_inc(&tp->key); > > - release_probes(old); > > return 0; > > } > > --- > > I want to catching this from the test code. If I did the following, > > it would be insufficient then: > > > > trace_probe_register(...); > > srcu_barrier(&my_srcu_struct); // only tells me any queued calls > > // are done but not that something > > // was queued > > > > I was seeing if I could use my_srcu_struct::completed for that. but > > I'm not sure if that'll work (or that its legal to access it > > directly - but hey this is just test code! :P). > This is a bit ugly to do programmatically in the kernel. The callbacks > are on per-CPU queues that cannot be safely accessed except by that CPU. > Plus they are on singly linked lists that can be quite long, so it could > be insanely slow as well. > But given that this is test code, why not leverage event tracing? > There are some relevant events in include/trace/events/rcu.h, starting > with the rcu_callback trace event. Sounds like a great idea. I'll try that, thanks. - Joel