Received: by 10.192.165.148 with SMTP id m20csp953088imm; Fri, 27 Apr 2018 10:05:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7JsSz8rQYq5KxCzBqDxg69WqI0bAn57ovwAF0LLSYGUqzP+2e9qPQOxWtdtVWM0GPuXk6 X-Received: by 10.98.11.210 with SMTP id 79mr2916347pfl.4.1524848744228; Fri, 27 Apr 2018 10:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524848744; cv=none; d=google.com; s=arc-20160816; b=z1jq9JiZbOEmoNgeDdgFGk2NKm6NlWE8UFGMdDOZCQorTarpDj0S+ZGeKGkIaH3MpZ eDExJfmCpzH8AO5IOBJiFh/EGiX/fDU7ff3aRgSd2+HIu6kVZdp5q1L0/Y+X7EEmQ7bX xgdpDlcpklgfgD/T94mXnT8saUqXEBBwStnKyuTI50k14UNwG83S4W0wZU6XOd1ojZXP /CCnr0cI86/bqEIPZkl+N9qB40FaZlh9bzXH5uVFHS9yIWzl2D8tyakvF0UvxANSNJaS KvHjoX7KlrbxdR+kiHzUpMH4vyxxboz/bSVVoY2JpoRKK+UL//WSgVPaqH9sUrhusv6x 0BdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=dYl6q9pMvL173BPuqaake7BCK3AqBb7VF+uGFGYGEw8=; b=iYFta+RelrGmJxbdwxdaQiJJ9ttvKDuz7q0ewCI/SbOuJP7/Up0AycFaaW4A6tl8sr sWe8YJ6HFDdzK8XOzpeYRoYIIslM8O+pkcm1Sejm0pVXlsATW2lvD+/3yaWsCCohjGA1 42W3z4PlIYFiHm28Km9bdLv8db/lEl0LwVPpnqgvvCcOryDWu0TwGrsNhJEfHFrC2QZ7 8mLXRP1AXPjtksf1aDE99WImTiBILb5oOH+2vtQszOs5dXg0enWi3Uuli6UsANK+e77S RbfzNR1x/6xbaf1g0+WdQVi/w6ZjmkhVUPx7Z334lt+11pksQCk+GC/SICgVcgwmQ0LY FOZQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5-v6si1522723pgn.459.2018.04.27.10.05.29; Fri, 27 Apr 2018 10:05:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758891AbeD0REJ (ORCPT + 99 others); Fri, 27 Apr 2018 13:04:09 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:53470 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757569AbeD0REH (ORCPT ); Fri, 27 Apr 2018 13:04:07 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3RH3wnj069311 for ; Fri, 27 Apr 2018 13:04:06 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hm7gjh2u0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 27 Apr 2018 13:04:06 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Apr 2018 13:04:05 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 27 Apr 2018 13:04:01 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3RH40Il52101340; Fri, 27 Apr 2018 17:04:00 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6DD59B2046; Fri, 27 Apr 2018 14:06:02 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 1A3DAB2052; Fri, 27 Apr 2018 14:06:02 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id E33DC16C1666; Fri, 27 Apr 2018 10:05:17 -0700 (PDT) Date: Fri, 27 Apr 2018 10:05:17 -0700 From: "Paul E. McKenney" To: Steven Rostedt Cc: Joel Fernandes , LKML , Peter Zilstra , Ingo Molnar , Mathieu Desnoyers , Tom Zanussi , Namhyung Kim , Thomas Glexiner , Boqun Feng , Frederic Weisbecker , Randy Dunlap , Masami Hiramatsu , Fenguang Wu , Baohong Liu , Vedang Patel , "Cc: Android Kernel" Subject: Re: [PATCH RFC] tracepoint: Introduce tracepoint callbacks executing with preempt on Reply-To: paulmck@linux.vnet.ibm.com References: <20180427042656.190746-1-joelaf@google.com> <20180427155701.GL26088@linux.vnet.ibm.com> <20180427122201.75abc313@gandalf.local.home> <20180427164554.GO26088@linux.vnet.ibm.com> <20180427124641.7b991c57@gandalf.local.home> <20180427170048.GP26088@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180427170048.GP26088@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18042717-0036-0000-0000-000002EB4F10 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008933; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01024098; UDB=6.00522858; IPR=6.00803328; MB=3.00020809; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-27 17:04:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042717-0037-0000-0000-000044236A1B Message-Id: <20180427170517.GA799@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-27_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804270164 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 10:00:48AM -0700, Paul E. McKenney wrote: > On Fri, Apr 27, 2018 at 12:46:41PM -0400, Steven Rostedt wrote: > > On Fri, 27 Apr 2018 09:45:54 -0700 > > "Paul E. McKenney" wrote: > > > > > > > That shouldn't be needed. For the rcu_read_lock_sched case, there is a > > > > > preempt_disable which needs to be a notrace, but for the srcu one, > > > > > since we don't do that, I think it should be fine. > > > > > > > > Actually, I think I may agree here too. Because the _notrace is for > > > > function tracing, and it shouldn't affect it. If people don't want it > > > > traced, they could add those functions to the list in the notrace file. > > > > > > OK, feel free to ignore my notrace srcu_read_lock() patch, then. ;-) > > > > Of course I wasn't thinking about the lockdep tracepoints that Joel > > mentioned, which happens to be the reason for all this discussion in > > the first place :-) Now I think we do need it. (OK, I can keep > > changing my mind, can't I?). > > You can, but at some point I start applying heavy-duty hysteresis. ;-) > > So the current thought (as of your having sent the above email) is that > we need notrace versions of srcu_read_lock() and srcu_read_unlock(), > but not for __srcu_read_lock() and __srcu_read_unlock(), correct? And Joel noted offline that I messed up srcu_read_unlock_notrace(), so here is an updated patch with that fixed. Thanx, Paul ------------------------------------------------------------------------ diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 91494d7e8e41..3e72a291c401 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -195,6 +195,16 @@ static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp) return retval; } +/* Used by tracing, cannot be traced and cannot invoke lockdep. */ +static inline notrace int +srcu_read_lock_notrace(struct srcu_struct *sp) __acquires(sp) +{ + int retval; + + retval = __srcu_read_lock(sp); + return retval; +} + /** * srcu_read_unlock - unregister a old reader from an SRCU-protected structure. * @sp: srcu_struct in which to unregister the old reader. @@ -209,6 +219,13 @@ static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) __srcu_read_unlock(sp, idx); } +/* Used by tracing, cannot be traced and cannot call lockdep. */ +static inline notrace void +srcu_read_unlock_notrace(struct srcu_struct *sp, int idx) __releases(sp) +{ + __srcu_read_unlock(sp, idx); +} + /** * smp_mb__after_srcu_read_unlock - ensure full ordering after srcu_read_unlock *