From patchwork Thu Jun 28 18:21:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10494685 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 9F5006022E for ; Thu, 28 Jun 2018 18:24:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5C732A18C for ; Thu, 28 Jun 2018 18:24:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A2B72A194; Thu, 28 Jun 2018 18:24:06 +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_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 378242A1B4 for ; Thu, 28 Jun 2018 18:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030409AbeF1SVo (ORCPT ); Thu, 28 Jun 2018 14:21:44 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:42670 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965867AbeF1SVb (ORCPT ); Thu, 28 Jun 2018 14:21:31 -0400 Received: by mail-pg0-f67.google.com with SMTP id c10-v6so2822420pgu.9 for ; Thu, 28 Jun 2018 11:21:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0y0Y6HhK02jQ+sXqM8QUkLbOeY++kM/KqedsahzGKIA=; b=KcVU1SmZc5IpCf44NhAy8Pqh3eRt9lKH1WVNZwcFCRIVYuvnN21/R9mmAvkIgS4rXs khW7D/YAdFZjgz/rFWqRlCkm7DL8HsMVEcUA8SudqlaJ6IWqtoVFwrB8GLRSnwc+RSq0 UKsYhNh2qEIdLAiuVsuZ+HO3i2e+o9AFFYteU= 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=0y0Y6HhK02jQ+sXqM8QUkLbOeY++kM/KqedsahzGKIA=; b=khPMkVtSnRWouE6A6VoeEcf8dp/WoOtTJwh6iA85WdXC+ViXVmNvhE6A/r75cYTEBo MwNq6Q0IXP+IuV/u2Oeo4IYcI9YYXmHbYNIrigNr7HVrBTizINRIiipY7pBHpwydDn+7 oj/EU6SF4Oot28itN2qM2WJYrRPZXQTof+nqwNo+zTfXKZGMEJW1nowtz3rNxIFXbo05 UrYZm2cj7tuY/c6F9vR9uWU8Z1K9lONI4TtEXIfUdYI4nnLxudQYvpyfrniOkBP/fghs 5gsXoN9/ipAGFwiUiNjfER6x/yojpmylsGKPSFuhJyHcLzxPjJAELAghGUOjs3G6Rn2M iezg== X-Gm-Message-State: APt69E2FIQ1Y3HeZ8s0dp0KYuCcr1SIr5PjVNUtgM0/eOsJeO85EtUuK zeypuVTUh+q7NZNZo2OYyph61w== X-Google-Smtp-Source: AAOMgpdOOuow3O9F4L6v2rmPd6vRSgsRCxMlO+4AuyDIJpnDaHZBjQp8tWxWCFGumlXVjbWu9814Lw== X-Received: by 2002:a62:6941:: with SMTP id e62-v6mr11261820pfc.56.1530210090656; Thu, 28 Jun 2018 11:21:30 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id o4-v6sm16055767pfa.128.2018.06.28.11.21.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jun 2018 11:21:30 -0700 (PDT) From: Joel Fernandes To: linux-kernel@vger.kernel.org Cc: Paul McKenney , Joel Fernandes , Boqun Feng , Byungchul Park , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Peter Zijlstra , Steven Rostedt , Thomas Glexiner , Tom Zanussi Subject: [PATCH v9 1/7] srcu: Add notrace variants of srcu_read_{lock, unlock} Date: Thu, 28 Jun 2018 11:21:13 -0700 Message-Id: <20180628182119.226030-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog In-Reply-To: <20180628182119.226030-1-joel@joelfernandes.org> References: <20180628182119.226030-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 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 *