Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp653347imm; Wed, 11 Jul 2018 08:43:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdymZyrszJWC84xEyvg/rF+td4Ve/nebsdEGuLshx4IOFzNmzNuSKLeoCj2TahpVbIFgzmS X-Received: by 2002:a63:d704:: with SMTP id d4-v6mr13573101pgg.312.1531323815576; Wed, 11 Jul 2018 08:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531323815; cv=none; d=google.com; s=arc-20160816; b=yFoLw4GKc/M5rIg+s6znBKDMRG6i2k6Sp+T4iU6oNDpw6QZ0GOVjGQ6Ip8e7Gz2V6l m75wiBYyVJyIChT/1DHIU4vazJi33aE3ih2fykDwhp4K/Wj/csmEVMLJTfBSTAnS095I Bc0QnRzuDeknrSFrl421xXx0EeDM+mvyCMb+9Ju/3L76Ol7+FLeBwVsuz0NXDWnppaM0 FYjsy/F2xTJuXZmB05awwX6Yhj2CvTk0DwJpc5KVuEhUdoYcKAJflxtYOK87P/tUmVlK iN6nQEVh/kP619oicjpn5OaGzEh+R8AfErTJbkpuZcuvdjUbKfm8YYGFXXjuUiCeAmUh D4cg== 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=YcYkRSTSVAd4b9ErqX5u8/04YC28fPw8GcNCHSamuYU=; b=zneBe41spUyGo94xwG2aOi5n1XV+vcW0QnX4UZH73h4BglHFFs8YbzBRbcQOpbxFKq HykfFE+5ZQlUzFDhh5Ko+PTeh28yABkxCD25+K6krYTD+3kYcuzbYzhDCOqgZ82Lzv0/ 04vge2RhR2u80L9OSwjA8ZYGfhsbBSBJqohHc2FvGp3qmXuIsZH6QRDXV94E8kU5G/Hm TobBxnlHUaa3molhHglZkHzQyYpOZJGCjsFm+fKODmxKqchJUDR5xH0pFGeVfPtesVdI QMu6XR4wrkA/G30lSY5+NmrUvsVLc5yQgidG3Byx5IJfFORtEV/vWx+nVkaAdPyz+bMw Jwgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=H3UigC5C; 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 z9-v6si18902505pln.250.2018.07.11.08.43.20; Wed, 11 Jul 2018 08:43:35 -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=H3UigC5C; 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 S1732853AbeGKMya (ORCPT + 99 others); Wed, 11 Jul 2018 08:54:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:37784 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732819AbeGKMya (ORCPT ); Wed, 11 Jul 2018 08:54:30 -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=YcYkRSTSVAd4b9ErqX5u8/04YC28fPw8GcNCHSamuYU=; b=H3UigC5CEUc+ApUqTxWDUl1KF 2ibj+B9wBiKUVncylNEr+4r+ztI8aR9+5OBdNQ1Orm4DTzPw7GO5heBH9HVEop8b4w62JE66VN3M1 HEfBxvuOK+h8Dt40rFnexonDOoTi8qvJSgXMz/Pd63pl2+yMCR7fr5aOUV7bQJonXOp3bbAzMSIMF q2hDxqQ/gzO80d2l96OPXd4AbAB49wIoXQ/nLA6JGX5MLTCZHaBhcZKld26mVVca8yVB7rXGCBLz+ SuZHlOQaR1rBFOAmv5EmC+D6xe0x5Aj3QcjKe4GDEj6TKD4r2Juf20ykUed3bGTU8pOZOr6pu17/k Zy+yqIkgQ==; 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 1fdEZB-0008GC-Eg; Wed, 11 Jul 2018 12:49:57 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CA62420289CE4; Wed, 11 Jul 2018 14:49:54 +0200 (CEST) Date: Wed, 11 Jul 2018 14:49:54 +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: <20180711124954.GE2476@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: > - it_func_ptr = rcu_dereference_sched((tp)->funcs); \ I would convert to rcu_dereference_raw() to appease sparse. The fancy stuff below is pointless if you then turn off all checking. > + \ > + /* \ > + * For rcuidle callers, use srcu since sched-rcu \ > + * doesn't work from the idle path. \ > + */ \ > + if (rcuidle) { \ > + if (in_nmi()) { \ > + WARN_ON_ONCE(1); \ > + return; /* no srcu from nmi */ \ > + } \ > + \ > + idx = srcu_read_lock_notrace(&tracepoint_srcu); \ > + it_func_ptr = \ > + srcu_dereference_notrace((tp)->funcs, \ > + &tracepoint_srcu); \ > + /* To keep it consistent with !rcuidle path */ \ > + preempt_disable_notrace(); \ > + } else { \ > + rcu_read_lock_sched_notrace(); \ > + it_func_ptr = \ > + rcu_dereference_sched((tp)->funcs); \ > + } \