Received: by 10.192.165.148 with SMTP id m20csp4418767imm; Mon, 30 Apr 2018 18:46:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpqNg9WhMerXIA1tthOFJCDo2ejT/HZeJMo/pPSj37n/q55IyQcemFBxzLSY0bNeVcXmlLq X-Received: by 2002:a65:4784:: with SMTP id e4-v6mr11424359pgs.196.1525139214685; Mon, 30 Apr 2018 18:46:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525139214; cv=none; d=google.com; s=arc-20160816; b=MeFRqQY7725kQAqF6+WDkVrO6tfTk3mgY4xTFD36CVm9FBP1bd+uDeFeupyJejmFU7 BsfODTj8YUKpxnNwGdQVoO/l4l+n+q8+0Zy8m3AiDteYesIvs70Jz09SQtnDd05a1ih9 6g42jSk4307KJ4evPHAb9b67FLQiVaXR5wVwN+AAS98Dhv7FZKwWJzHPGPQxj67iVGMo NT3gSRYpMSsajKpNzcmECQB12Gtb4E4l9F3kO1teb9AfZUJWTIdfvWeOs6iWa65Dz3jC 21arFnVVNYcrWj9e0iASk2zZAR5LbiTYVZPmbiZNq2FJYDeAUOtdxRx44bEgMKc0wDNp epfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ZNb6lvsmFY029PAoHUQJ86/j2UKCuHhWug1SrZz+LIU=; b=cHRR1mmfondOi5JL7V50ALzvAoLXqBFy8hW+Wnc+pEDB+mIeTXLYsb1lDP7mwa6S2N qIZPZQHEdqh6l2xuC3ml9Z9r2QGxgI3XstB291tlmJbVgO45E8zCBwfFDfO9T1sFFA8L TpeZ858YvqRU13Owg8rOdxWxVp64HGr8Ag2YjvLSzlXDGq9W7wwBSxXLw9Ru6aF549Aw I34nMOXvC7P2x1bnT/hfSYYnEH/X8Dxl7LcN2dSXayr2zbXr9SwezHHNVNn0FvFTWjlj 7PngermJLMUEgaYSOKldd5hkYzb9D4VWxeFsoNIVm0aiB7K/RkA/PbpPB3m4cidSgyHN knOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=XC3zODn9; 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 t5-v6si2747497pgu.341.2018.04.30.18.46.40; Mon, 30 Apr 2018 18:46:54 -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=XC3zODn9; 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 S1756180AbeEABna (ORCPT + 99 others); Mon, 30 Apr 2018 21:43:30 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45352 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753283AbeEABmX (ORCPT ); Mon, 30 Apr 2018 21:42:23 -0400 Received: by mail-pf0-f193.google.com with SMTP id c10so8128156pfi.12 for ; Mon, 30 Apr 2018 18:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZNb6lvsmFY029PAoHUQJ86/j2UKCuHhWug1SrZz+LIU=; b=XC3zODn9JUIT3KyXwjdeBpBzSIMKwLVZPbWMwdOL862Gw7xqt3YPK1YIF3pwYyCyod CQppYlxoPI8j9u1HmA9W8G6n4jdMjqUkrUSQVrg+gpdkjZcsMcbbrlD4wred7pARAZ5y mzxGAu2XuhKG6ZCSSQXdDj6cT8u3R1kuJL/CLQjMrhpoOfdNXyfqDFjLj8fojq1gDXuv U1BLRBodfU6yf56hv+mPYx1TW6WwOuZYRyyLkt3oxJ3lpZHuce4eF2apVf8MCsT7pJXp fkJcXXbQPhH3m0wl7rcF2ZiawotjGR3abTkGIhfhPPvqkN4bnejGcKiEO1IPFKwzbCRo c4xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZNb6lvsmFY029PAoHUQJ86/j2UKCuHhWug1SrZz+LIU=; b=k31iwSuVEb1TUr+bsV4a2LktEYlI+Td2ttKNWkFCZq0IY9wFh+luX+CQ6oOIrY6U5z 6HsXF984wJHDUV21mOwUn4xBYhuljCjhRXUJG4oaeBPSbeciJF0K/XTzSLaWg9fOub/j 9t4fBqAe7Jo93g58RWGa4OOjp0YfQ9qSRYYjdKZc1rJk3B1dxEGBHmjxzijtkXpVZ+6X CypAoQNFgw1/MFRR/l4pDJXRPs500Y2vy3Wb1kxnBmoqJ0samqr0YK5fhsNo1bR2S8UA TIjftcdve7v8D3cyTorUAf5kARQM5GVEKRYEeJ/10yqHaVLYpxx8n8RLotdUI3zQfGyd F0sw== X-Gm-Message-State: ALQs6tDhd+BNUFRVUzmA8hY5PvwkiTeZ++cfgOrVcMlxrOT3fF0kR9PQ 7PhxB7zRf4OLej4ezA2cM2pGS6WjGMM= X-Received: by 2002:a65:4784:: with SMTP id e4-v6mr11416360pgs.196.1525138942477; Mon, 30 Apr 2018 18:42:22 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id f21sm15149490pfa.106.2018.04.30.18.42.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Apr 2018 18:42:21 -0700 (PDT) From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Steven Rostedt , 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 , kernel-team@android.com, Joel Fernandes Subject: [PATCH RFC v5 2/6] srcu: Add notrace variants of srcu_read_{lock,unlock} Date: Mon, 30 Apr 2018 18:42:00 -0700 Message-Id: <20180501014204.67548-3-joelaf@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180501014204.67548-1-joelaf@google.com> References: <20180501014204.67548-1-joelaf@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" This is needed for a future tracepoint patch that uses srcu, and to make sure it doesn't call into lockdep. tracepoint code already calls notrace variants for rcu_read_lock_sched so this patch does the same for srcu which will be used in a later patch. Keeps it consistent with rcu-sched. [Joel: Added commit message] Cc: Steven Rostedt Cc: Peter Zilstra Cc: Ingo Molnar Cc: Mathieu Desnoyers Cc: Tom Zanussi Cc: Namhyung Kim Cc: Thomas Glexiner Cc: Boqun Feng Cc: Paul McKenney Cc: Frederic Weisbecker Cc: Randy Dunlap Cc: Masami Hiramatsu Cc: Fenguang Wu Cc: Baohong Liu Cc: Vedang Patel Cc: kernel-team@android.com Signed-off-by: Paul McKenney Signed-off-by: Joel Fernandes --- include/linux/srcu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 33c1c698df09..2ec618979b20 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -161,6 +161,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. @@ -175,6 +185,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 * -- 2.17.0.441.gb46fe60e1d-goog