Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3787739imm; Sun, 13 May 2018 20:18:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruhj054mlJXA/kfEEREPKBXD+dSMLV02yJPbCgoghKfCJX/XNapTeVlbgOPJMZfHTh9EHR X-Received: by 2002:a17:902:bb84:: with SMTP id m4-v6mr7871689pls.339.1526267891732; Sun, 13 May 2018 20:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526267891; cv=none; d=google.com; s=arc-20160816; b=ldWo2XSpRkgi7Ugx1WFdq+EoucaxWegKF1tBQ2vBRtu5GveqlXMt9OMuL/q/sn1w0E xm8h19HSQkPetFw0ysr9zHBmnQY7IwNu80BG63R0t1jLQ0InCrhcDywQ5UryNmxDNR3v Gjm+tLQ1Ho9V6UZwAQWDI7Vqcn4j3bi5HxDS8bJijyoM1UjkJc/YeIKDhSeptkZznYVq o7TV69WOaZlyFM21+42MOQlv3wUCvt6jNpgQHb2dOOT1CsMMLjJC5LeDDP6PBQ/MDWWm ZAoGF9yAnXQafjwpDWvDETFTEMWzI7jL90M+NruBnTKQbxAo0cK06SxDVnUdSvH79WUt Ia8w== 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=bmy5L2ir2S/5w3OSCLLwO9n+9WEk4SI+NilDFNuaNJY=; b=Gk8SXEnNxKUERcu5htyMTgVi2szjgHazqBKRR85pIbf/ZZZbv5rpD1uymhDD1czt4w 8BCCEHAH9CsFaDjp5r+CqYPvxo2gZH8E9ua7aicv2XLLmSX5rW56lzPL6UU8qLdCU8Ze 7OuHei+7MHxmsRTUHtZv1crFDzwVp4xbJvxK7i8x26SSERI6uDPLb30BFeI8jjbAiCen a5Pd4bPRZnqYSy0MXiPMOeEZt/t12n1yh5x98cp7X8effsArTcwxS4zqv0ODbu/j3SVe ANC+PiT+3E/vP7igOOb2ffvwnz9TsnexY/KdR9V8R3OT1VCmMO93F3CZjf/NeN6N/jAB JLfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=rHgU3DXw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4-v6si2866321pgr.366.2018.05.13.20.17.57; Sun, 13 May 2018 20:18:11 -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=@joelfernandes-org.20150623.gappssmtp.com header.s=20150623 header.b=rHgU3DXw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752365AbeENDQE (ORCPT + 99 others); Sun, 13 May 2018 23:16:04 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44131 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbeENDQB (ORCPT ); Sun, 13 May 2018 23:16:01 -0400 Received: by mail-pl0-f65.google.com with SMTP id e6-v6so6490238plt.11 for ; Sun, 13 May 2018 20:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bmy5L2ir2S/5w3OSCLLwO9n+9WEk4SI+NilDFNuaNJY=; b=rHgU3DXwQCSzObsDPhO/PGTOgShUD7NnTjxAoW0CjSshySj/xrPddfByjCMOHZfNee sHEDu9D39r0dXQutjQ1SnrcfLiIXYMjQyxJsxpLWz6oQoapY9060NuXkTu19ElanBZl5 SrXSusCbc5jJ3zW0oI4S8eCUtbxVF1SKLJSYAjoGGXXYE7lLSr4og9rNj/NP+ocgrAcf Zwv03CoVE8pDW9EwKqKpxsiH1gcQ46kbzk4Xm5P8N3x34rc9x7CPe//FWlSlh7dVMnHV OU6aTzWVkyevqwqmploP4BkWLVpD7Cxn98OA9tciABdLAel5ZPlaS6EbxhfXgP3rWb2X RmdA== 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=bmy5L2ir2S/5w3OSCLLwO9n+9WEk4SI+NilDFNuaNJY=; b=LN+CZk09AslsL8OBEOqSidPbWKnRd6n4YH+ZJN8/SgnD5Iumez8Vt+2Ine5aYXGu4U w8vdAjsV3MZnbj1k6WWGhQ76k8CoRpYgjcRIKdm5JlUznshyop0qGY1z5/yfBIhtcDeE e9JvEtIR4FT43wbEbHJAZ0zCWgTh6i0qm5upVldq4eWcHbEJH6y4MRaz9nh/NsLBjRiQ LiJkHb2MD5WP4CpLAGJ0Ej7tlRXSJsFuFiwiBT4BY5Kdno4LqSNCXrGoknaQUgJAnx4M Drwx3kcfOgwhdccPYW09UQ4Iz6/S+8ooVjWBjpdggJaRIJL523OSH/m5Iimwer+xMi4y vdAQ== X-Gm-Message-State: ALKqPweov3ssiWL1uZ7VD9FqjUyCk51hsybEuxKAAS3L4GBYGOLGTppH zJpl06Fd9Sy6Ndm+H16QhvwrJVna1/U= X-Received: by 2002:a17:902:708a:: with SMTP id z10-v6mr7662742plk.283.1526267761153; Sun, 13 May 2018 20:16:01 -0700 (PDT) Received: from joelaf.mtv.corp.google.com ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id u14-v6sm19265635pfa.101.2018.05.13.20.16.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 May 2018 20:16:00 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , "Paul E. McKenney" , Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , byungchul.park@lge.com, kernel-team@android.com Subject: [PATCH RFC 2/8] rcu: Clarify usage of cond_resched for tasks-RCU Date: Sun, 13 May 2018 20:15:35 -0700 Message-Id: <20180514031541.67247-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180514031541.67247-1-joel@joelfernandes.org> References: <20180514031541.67247-1-joel@joelfernandes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recently we had a discussion about cond_resched unconditionally recording a voluntary context switch [1]. Lets add a comment clarifying that how this API is to be used. [1] https://lkml.kernel.org/r/1526027434-21237-1-git-send-email-byungchul.park@lge.com Signed-off-by: Joel Fernandes (Google) --- include/linux/rcupdate.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 743226176350..a9881007ece6 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -159,8 +159,12 @@ static inline void rcu_init_nohz(void) { } } while (0) /* - * Note a voluntary context switch for RCU-tasks benefit. This is a - * macro rather than an inline function to avoid #include hell. + * Note an attempt to perform a voluntary context switch for RCU-tasks benefit. + * + * This is called even in situations where a context switch didn't really + * happen even though it was requested. The caller uses it to indicate + * traversal of an RCU-tasks quiescent state. This is a macro rather than an + * inline function to avoid #include hell. */ #ifdef CONFIG_TASKS_RCU #define rcu_note_voluntary_context_switch_lite(t) \ @@ -187,7 +191,8 @@ static inline void exit_tasks_rcu_finish(void) { } #endif /* #else #ifdef CONFIG_TASKS_RCU */ /** - * cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU + * cond_resched_tasks_rcu_qs - Report potential quiescent states to RCU. + * The quiescent state report is made even if cond_resched() did nothing. * * This macro resembles cond_resched(), except that it is defined to * report potential quiescent states to RCU-tasks even if the cond_resched() -- 2.17.0.441.gb46fe60e1d-goog