From patchwork Thu Jun 7 20:38:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10453549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE6BF60146 for ; Thu, 7 Jun 2018 20:40:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D936029B98 for ; Thu, 7 Jun 2018 20:40:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBB7E29BFC; Thu, 7 Jun 2018 20:40:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6944E29B7A for ; Thu, 7 Jun 2018 20:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbeFGUkl (ORCPT ); Thu, 7 Jun 2018 16:40:41 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:33637 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932323AbeFGUiv (ORCPT ); Thu, 7 Jun 2018 16:38:51 -0400 Received: by mail-pl0-f66.google.com with SMTP id n10-v6so6862175plp.0 for ; Thu, 07 Jun 2018 13:38:51 -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=AWoBYQ8bMrAiiXbUJHYe7Jit5HOxGoUa1mPhDkxbGUg=; b=sxdZUW+gWhu5r9nI3nLuF6/h6853wnkAaZcrtt/l0mpkm4BO4WKaaleSr/UryJPYKM wQRaC/+/03rpyJsbs3wBZ6yLdEQlgvOVBjb1x/tt1nPD8Ia4qLBHNN+0T9OcC72o+gG5 ZW5pPI0OBvKUmtWaAJHFERJ9WpgJrpf+IA0pZ8txpSv9c6L/9Ww4rMjmVT/Wkj6YFkJG TVmWPzxR/191XCG+tn1p0KKQuQOuaohI4eHP17+q46X2GHAtfjHa8kQriAKKwUeJiCMS RocXft4GrRVDBLQBPE1r8Be1G1HZDFYmZXwDNwkd4KH/51BWhUK+QL+S2fNGWWF7RADK kjqg== 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=AWoBYQ8bMrAiiXbUJHYe7Jit5HOxGoUa1mPhDkxbGUg=; b=o078WxYjQ1dbKu+SPXINIOBomV1OndM77hZUJH9no2Y/el8nkuBtiQL4JHgPzdIxS1 Lwo2+nV+DESyb5X2yRULe/KAE8zblWRwxwqoeiY/jD2NxHHMuLIy8cIuVl1YfZpSp7or kezL3SAyBl+krZ77dVT1MZ9OmI22Kr+QrGvunGuFuMPICzlcjZFq9tynuI4lIv2+AOVX GzTF67cnbMzPcuZCBSoA+XRq3ww54Nfjro6oSIwoaMAa2Khj/X6Cvkq7QqoimyaP2ovX V9RQ8zYPxMkientE5QeVLzAF0vszA55Yumiy9o6S8Afh21jhf9u7rLDygPJRl6d5fmcO vALg== X-Gm-Message-State: APt69E3tlo0U3a4c3U6W3p6I/Hm9zzVVSj5whbyVLL9UWy/vAchyg6pT TSuDvz4tDgLBrPYNtd7Y/BVRDA== X-Google-Smtp-Source: ADUXVKKGpfTlmGQBiR81/aLVTWxNO7kcsbYyTapLTETvnfOcGeWbPMvt643h/AHePAgtnm+rsKUX/w== X-Received: by 2002:a17:902:6b8b:: with SMTP id p11-v6mr3463423plk.212.1528403930567; Thu, 07 Jun 2018 13:38:50 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id v27-v6sm10324174pfi.23.2018.06.07.13.38.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 13:38:49 -0700 (PDT) From: Joel Fernandes X-Google-Original-From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, Paul McKenney , Joel Fernandes , Boqun Feng , Byungchul Park , Erick Reyes , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Peter Zijlstra , Shuah Khan , Steven Rostedt , Thomas Glexiner , Todd Kjos , Tom Zanussi Subject: [PATCH v9 1/7] srcu: Add notrace variants of srcu_read_{lock, unlock} Date: Thu, 7 Jun 2018 13:38:09 -0700 Message-Id: <20180607203815.255845-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.1.1185.g55be947832-goog In-Reply-To: <20180607203815.255845-1-joel@joelfernandes.org> References: <20180607203815.255845-1-joel@joelfernandes.org> Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Paul 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] Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Paul McKenney Signed-off-by: Joel Fernandes (Google) --- 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 *