Received: by 10.192.165.148 with SMTP id m20csp2927926imm; Sun, 22 Apr 2018 19:32:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+bZPpi21eQ1Me3RT7slzn+Z/9E5U3r0OnG46uHynCwyZ0OeHxFplYK78YdqxF0iDqZleoP X-Received: by 10.101.96.47 with SMTP id p15mr15531380pgu.430.1524450767146; Sun, 22 Apr 2018 19:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524450767; cv=none; d=google.com; s=arc-20160816; b=YxcgpnoQDQUleuBYZpAnV268yiKMoJ4m88hrI0UGqjtBzkfoQrOJ7gq5Ben1BR63vG R51DvNNOYiqxYwlEyLkUeYtTIVMX2qA6/6hTqliruN5tfeYhjAA683WYVqSUy42hz7Mi +Fz2alFnXf/b34RZdm1X7+fE2enrBFPUVu7hSVnXFhwsPIy+i6vCrYOBbi3MCVhuKIsE fKDZ8mDxEnkcWLjGppPpl2wWBXx0IYKYGdAk5gHLDMxcSntG41c5SUcGZhDeke71Jt3f 7V39F2a+Z3MxMMYxHRIVsqx33Mv9Zu99grGDWa1ebBbNYVlhQDQ6HfOZflE/iEJARBew Rixw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=ExrMfsCFknQ+Jrw1VedOA5inXt3jLNk7xt/U4sNh0kw=; b=o+ZMwMOzuQMCsRYkCGxyR2BS0KhFh+YPFOMhUImUSI1DX25iVrO/6a6wglD9693fjK RZdsvlmIv96MeOQwPT7EbTPzU9JQbwJJgFX9+AL+xWgYSZTZQVG/3pf9FrCp77+fcE2x O/D+D29dbIuphH2MGKTdG5jIK3hlL2pHPCjrZ9XwBdVWxda7wIS2lztmEPU+PnjUkKGv qaleGLoFET+QGcLL7dyMwfHLEOOTo6qc3SOIebpORIuE62vv2ieNWPBr1Z7bMrP2CTGU wxGHkwmhrSJwLDN6AKlY8AFh2/GGbwzGWI7xExzCEujpLYG01cumapU29zdQoSanREtl Ceyg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o64si10331374pfb.245.2018.04.22.19.32.32; Sun, 22 Apr 2018 19:32:47 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753976AbeDWCbX (ORCPT + 99 others); Sun, 22 Apr 2018 22:31:23 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52186 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753848AbeDWCbU (ORCPT ); Sun, 22 Apr 2018 22:31:20 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3N2Sw9w042222 for ; Sun, 22 Apr 2018 22:31:19 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0b-001b2d01.pphosted.com with ESMTP id 2hh39j5nn1-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 22 Apr 2018 22:31:19 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 22 Apr 2018 22:31:18 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e17.ny.us.ibm.com (146.89.104.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 22 Apr 2018 22:31:15 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w3N2VE3O53805306; Mon, 23 Apr 2018 02:31:14 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DE91B2054; Sun, 22 Apr 2018 23:33:17 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.85.149.45]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id 620AAB204D; Sun, 22 Apr 2018 23:33:17 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 5E15116C6DFB; Sun, 22 Apr 2018 19:32:28 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel.opensrc@gmail.com, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 01/22] sched: Make non-production PREEMPT cond_resched() help Tasks RCU Date: Sun, 22 Apr 2018 19:32:06 -0700 X-Mailer: git-send-email 2.5.2 In-Reply-To: <20180423023150.GA21533@linux.vnet.ibm.com> References: <20180423023150.GA21533@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18042302-0040-0000-0000-00000420725E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008903; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000257; SDB=6.01021888; UDB=6.00521536; IPR=6.00801123; MB=3.00020719; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-23 02:31:18 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18042302-0041-0000-0000-000008267BD3 Message-Id: <1524450747-22778-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-04-23_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804230025 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In CONFIG_PREEMPT=y kernels, cond_resched() is a complete no-op, and thus cannot help advance Tasks-RCU grace periods. However, such grace periods are only an issue in non-production benchmarking runs of the Linux kernel. This commit therefore makes cond_resched() invoke rcu_note_voluntary_context_switch() for kernels implementing Tasks RCU even in CONFIG_PREEMPT=y kernels. Reported-by: Steven Rostedt Signed-off-by: Paul E. McKenney --- include/linux/sched.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/sched.h b/include/linux/sched.h index b3d697f3b573..fe8f7178a22d 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1617,6 +1617,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) */ #ifndef CONFIG_PREEMPT extern int _cond_resched(void); +#elif defined(CONFIG_TRACEPOINT_BENCHMARK) +static inline int _cond_resched(void) +{ + rcu_note_voluntary_context_switch(current); + return 0; +} #else static inline int _cond_resched(void) { return 0; } #endif -- 2.5.2