From patchwork Wed May 30 00:04:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10437399 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 4DBD5601E9 for ; Wed, 30 May 2018 00:05:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AEDD2875F for ; Wed, 30 May 2018 00:05:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F60C2877B; Wed, 30 May 2018 00:05:21 +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 9BF2A27FB0 for ; Wed, 30 May 2018 00:05:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755381AbeE3AFR (ORCPT ); Tue, 29 May 2018 20:05:17 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:39260 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755230AbeE3AFO (ORCPT ); Tue, 29 May 2018 20:05:14 -0400 Received: by mail-pl0-f65.google.com with SMTP id f1-v6so9462745plt.6 for ; Tue, 29 May 2018 17:05:14 -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=h1GRsT0rXGYwe3RQJY2wKHpSKtEsvNplNFJad5KShbE=; b=VuNFGxm+RZ0eUHZD9t2NnKCe78XfKbn5QvQ0PF4rmL0VUVFEjvhNC5enp7+XmpM8IM OOgKkjqcIku32o6k+WPTE4ihaXE7eGO9Da2isoTfv3qAApxFQuPoqtpxvTDGHBKQNMVo awYLtRd5wuuc/EGBr6zadHYGKs73mEAErzEXmISJL2GLqftcLE3UaViHD8XYriKdYTjE fIHrESvymXWygJbtpMJ1ILBpAfZAlFp0PGfMUxPiNI6GM5GaQpAQez1onj3F0hCuhyjm ALPw3H2JSb1MclC0T2iCO9NAZG09PUGoCHAcu3T42REnTwiFyBbRGr2v6XJ2v2QLnGha JNgw== 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=h1GRsT0rXGYwe3RQJY2wKHpSKtEsvNplNFJad5KShbE=; b=hBKPVfjPbrRQBqKc9/Grhe9ZdzdTeoYW5/z4Drv0l8XEx8ZWonHmjuD296Dg67kAmu JKaklEssshRDAOwYExPHJrYZfAd6nrfITIdm0ZtDMtgqLeOHkoWk7avYa/epXvObETxx LEyRvBqAyDDqlQMxSea8+BeVHIJ8Ns5Stou7ZNoH+ALHrGHzJtL0tz6P5mYYP5NuCGHx heeslB46IRXMJXo64TeigACdeQoZNsUmVBVRm5pW8Ao/h9skUli2AUf3w53Dj5oso0T3 y3+tIxQA5FLVaoRpe+Kdx2/9z9cAjxU9urBCIgiT816LgDsRzr42DUdclj/sU8zilkNM gyKw== X-Gm-Message-State: ALKqPweh8/yigSTnSR5TwNQP/IEbDjqCAsndsvRtyhItULg/BhDKbbsu udEnCLgW09MDAOmxFxejdA55Hw== X-Google-Smtp-Source: ADUXVKK+DDlrHOEFtccOE+/eB4g1l+dPxtiDxw1OFBK6j3dNATkqBvtzy7ZPpE9WRADrkLI7e+If/A== X-Received: by 2002:a17:902:b7ca:: with SMTP id v10-v6mr512332plz.224.1527638713447; Tue, 29 May 2018 17:05:13 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id w12-v6sm86979211pfi.158.2018.05.29.17.05.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 May 2018 17:05:12 -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 v8 2/8] srcu: Add notrace variants of srcu_read_{lock, unlock} Date: Tue, 29 May 2018 17:04:54 -0700 Message-Id: <20180530000500.257225-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180530000500.257225-1-joel@joelfernandes.org> References: <20180530000500.257225-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 *