Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp653995imm; Wed, 11 Jul 2018 08:44:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeUGLhpGbqEj12RAEq8L1XvyV4KIIm567i0hbO9m8YKXhKP715vryOqKN9H8kSxB+y/cNiG X-Received: by 2002:a62:c90a:: with SMTP id k10-v6mr5397365pfg.180.1531323853720; Wed, 11 Jul 2018 08:44:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531323853; cv=none; d=google.com; s=arc-20160816; b=EOZAken0QD3Qfm2kwmoUyEGe0Y+jFpMDXAbOvWCWC9lKoYpnMtRszBwT9Gt55TXbXT 7sR0c1H9V3bt8KUv1xWhNHtll+c+XIkUMZ/aS3Se1R9Kz5AoOFdY0fu8wq0/osPsD+rh nInOHYbSUIwStp/OvqWafC4jZ/vxwYUjwg3z8JDDFqO50zZDqwVA4JZx0QUBhaTxFeHA emi4bNOsz3MApnYJBsf8TgRnkekiJYI4UtiEk6NimM8CHau9yDA6ne5QhgW9qQiJWtmM ZU/DW3ahYN8Xwfcb+0SDThLw2k0c2MaUvmhHMHoj/v+6WWg/LIkoRUE8WG1JMqEEbSQM n2Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=/VFqgvoFfd/mu2OGdRKjmrVAr7jSMt45bphOTwn6cUQ=; b=KOTaYA2Og8v/REGqa89iLzW6Cuadtc8YhgpYrLycrGgGOcQGh+cmKWKeuae8+29n2w KcQvc7MBdYMHoRxLt4Y3tB3BGvsLWMjs+kW/X/ebbdv086pbT7ubL5qDSPCuXpgEyodK JUyuCzXcf70kD0hsBDtGRZl+dD+03i2bXuYvBI2eZZrkD1J0/4SjFzxCzCVfAsZCvnPc 8oujBwefmzJIlyPpF4OtH3DiTdaXBKayMM5FQUVYKnxF0spejGU2507Gl2Vav1rnU019 IUIopPRiVd4FBRhihVPmkfmvpLrlj5xG46tEieuq9izfOAtqnREu+/ahZhRo1NrUodQx yMLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=mWZH2Exo; 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 l4-v6si19513834plb.213.2018.07.11.08.43.58; Wed, 11 Jul 2018 08:44:13 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=mWZH2Exo; 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 S1733289AbeGKNBa (ORCPT + 99 others); Wed, 11 Jul 2018 09:01:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37990 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbeGKNB3 (ORCPT ); Wed, 11 Jul 2018 09:01:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/VFqgvoFfd/mu2OGdRKjmrVAr7jSMt45bphOTwn6cUQ=; b=mWZH2ExoRPvdFnv0n8Amkenmc 8jiwcCpYIPRToXG8p1R2rFOI87Fpjb26vJs1ThrouGjtAyCWYq6QOwEv+e1JtSoFBxWQ21qk5fbfj ZCzRCxlSe4NDO402hcWSqfQ1Up+HGfNZYw03lApc9GLku6oT09wi+52Jq/K9cfcWosErAa47KSRen /C9o/BhKmaZqPbbkSPWPQnbS5Fy4JLuR62exRhGEwMmbB4WbZmlARez2lvW3nai6aF8TCBwl6F3Nj mNo5IrYSuJwum5I5Cg6grTACGn0p9qDFf4KUmV/ktQHcuEtUuPyzyeLcqzZa0rVjK6R47nuPLM5Cl BOcYCXTWQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdEfp-0008Is-4v; Wed, 11 Jul 2018 12:56:49 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D807220289CE4; Wed, 11 Jul 2018 14:56:47 +0200 (CEST) Date: Wed, 11 Jul 2018 14:56:47 +0200 From: Peter Zijlstra To: Joel Fernandes Cc: linux-kernel@vger.kernel.org, Boqun Feng , Byungchul Park , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Paul McKenney , Steven Rostedt , Thomas Glexiner , Tom Zanussi Subject: Re: [PATCH v9 4/7] tracepoint: Make rcuidle tracepoint callers use SRCU Message-ID: <20180711125647.GG2476@hirez.programming.kicks-ass.net> References: <20180628182149.226164-1-joel@joelfernandes.org> <20180628182149.226164-5-joel@joelfernandes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180628182149.226164-5-joel@joelfernandes.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2018 at 11:21:46AM -0700, Joel Fernandes wrote: > static inline void tracepoint_synchronize_unregister(void) > { > + synchronize_srcu(&tracepoint_srcu); > synchronize_sched(); > } Given you below do call_rcu_sched() and then call_srcu(), isn't the above the wrong way around? Also, does the above want to be barrier instead of synchronize, so as to guarantee completion of the callbacks. > +static void srcu_free_old_probes(struct rcu_head *head) > { > kfree(container_of(head, struct tp_probes, rcu)); > } > > +static void rcu_free_old_probes(struct rcu_head *head) > +{ > + call_srcu(&tracepoint_srcu, head, srcu_free_old_probes); > +} > + > static inline void release_probes(struct tracepoint_func *old) > { > if (old) { > struct tp_probes *tp_probes = container_of(old, > struct tp_probes, probes[0]); > + /* > + * Tracepoint probes are protected by both sched RCU and SRCU, > + * by calling the SRCU callback in the sched RCU callback we > + * cover both cases. So let us chain the SRCU and sched RCU > + * callbacks to wait for both grace periods. > + */ > call_rcu_sched(&tp_probes->rcu, rcu_free_old_probes); > } > }