From patchwork Thu May 24 01:21:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10422581 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 E1A9A6016C for ; Thu, 24 May 2018 01:22:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB1C2292E9 for ; Thu, 24 May 2018 01:22:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF959292F2; Thu, 24 May 2018 01:22:43 +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 11567292EF for ; Thu, 24 May 2018 01:22:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935428AbeEXBWe (ORCPT ); Wed, 23 May 2018 21:22:34 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:44068 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935324AbeEXBWa (ORCPT ); Wed, 23 May 2018 21:22:30 -0400 Received: by mail-pg0-f66.google.com with SMTP id p21-v6so185987pgd.11 for ; Wed, 23 May 2018 18:22:30 -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=J0OAmBpi/2oy+zspB+rY7svjAYXLVQazUSL+5hOji8A=; b=UkYak0zKNNJQZTwpHhobIdvgZ3pbdRrORSWNmvcMf0XDRFxC8coNTXb+aVYVnxvDPH 8G7hkZsIjKTcRggW53hPR5AHKSTscSzWexbnWr50CmWeLUFfSPFj3NgufcxVb3+V2Nh6 C4Qx7IVqtnpfJj2LYcH3BQOmqLLA3ht+TBNVHwpTAwyyOvuaq0HEVhrycQdt784JoQe0 7W8KS2bhdU1PUVCfZkIePCmznOXfaNgyZpKZPPtqNZ4S7tzu9jo3ee9e7eor9aBkpb5H lzIr93OamUSGwECMaGnq5F+fD1GypaJzw8eLYeQlunxNNDEfayD/L8MzzPV2KxGryJsg zczw== 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=J0OAmBpi/2oy+zspB+rY7svjAYXLVQazUSL+5hOji8A=; b=k66jIslmNwy1BFPVt14q2D2AelGz+sMJjCksingqgXN7Yh/6mak8RnRAhQOg1DdW3K whkgfknDAecYlzuvYX6YKtBKJoiMksA88UkBJsDZRlsdGc9WJ+rEfg3gRzHw3YQ/wJek iIBQFl92a6Et855AnBk0R1kVCiIbMRhNxjCiXh954KtGRn2Zw+VBQV9TwTL9Nuj/j+41 uydCiGPSCIRZYX7zHC+2CJcIcy9Z7ZCuVeSahMC0aepcO3ArEpq/HW4y3heJLCrW1Z+l lWNSzMRXghcCCzHVsCH92j/nlepMf+1IVwY7HB86SdD4NLotH6ezaZfR+JkFxHDY/V2w A/1Q== X-Gm-Message-State: ALKqPwfXl5lqPFXkYQFkt42MsGFmokz1Kq1/4kBvteIUwCL3pauPTvj3 AR+V+d/OL2pS4XV/kuoVrsNyvA== X-Google-Smtp-Source: AB8JxZowrWs+ZQuqKjJojfYqLXUe/Aka0UdPGSAVoYqYQnFASP1tv2oENUM1aBG+BYryxDer0HBm5w== X-Received: by 2002:a65:628a:: with SMTP id f10-v6mr4106013pgv.6.1527124949496; Wed, 23 May 2018 18:22:29 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id g15-v6sm26070996pgv.58.2018.05.23.18.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 18:22:28 -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 v7 2/8] srcu: Add notrace variants of srcu_read_{lock, unlock} Date: Wed, 23 May 2018 18:21:51 -0700 Message-Id: <20180524012157.181277-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180524012157.181277-1-joel@joelfernandes.org> References: <20180524012157.181277-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 *