Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp672982ybh; Sat, 3 Aug 2019 07:26:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSdMkaCmBXvyIG1uGCtpqn3hWXY0jq1JKX0+z4IZarjCrYFnW9C66B31H7q/KzEXfpcgkF X-Received: by 2002:a62:2ccc:: with SMTP id s195mr64404777pfs.256.1564842382838; Sat, 03 Aug 2019 07:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564842382; cv=none; d=google.com; s=arc-20160816; b=AGi1bWlMcgQh9pTGU8FXIDtRaXzHDx//H6NNVBGEHL543alzjxGk24Puqni7N8c5hF 3JMTQIdHMrW58YZuFEKcyWMLKaAAFD+LTc3jNz4NoUhJEyggMfuGj8QW6llGg6IR8p2M LpV36PhTf3O8Yi5IEuGgk89rUkBBR9aWXl60JPg3BzkpdKTaPDlY3Xa4C9103cIHlPS8 mIFjr4/z4eXBLiu/CZNMqfrwcj63kZw273EdlV6bF4osIyZuDLLCNKRQxDcqAGllEjjC G+ltNHAsu7KAPTBB0C+keB/l50EJiZ7OI9Nz5XYBFyDg+RDO3IDIpwKVsZzo5RSGBfEN 6yQA== 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; bh=KwToj33HQiLcU5AgXcpcHKB3O0PFRdSlJ7xhaXwmJZY=; b=0KqFn0stbPRMdWNbYZ31HbuRpTNc9l17LKKlfYaV+C2NwgG668+uzfwjpk/zbSYBAD SIpCAbsMwUsaQgfd+N6w1ZbnPE4QoZyin3BoQ/S+qSuvAtWi4vI2ROebpYHvGI9iZoGs 3opSezWG85HZkGyA+Qsmeo2fQOw9sEzbK0NBAmlHevT4zXaoKLVvWJLSSRoL3CuVzyUb yzZPyNRQWI8YFzccYDFw03eI4ceHssr22owHk36VJmztg3DzjLrc+jspBqHXbaPc8khH +meRNBWYswnQKxLjya4OXByIc7Tgcudv52UuiwQkN9etaWO9Ufo5pOafjzE01MbEdUTk 1DnA== 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 m15si40821014pff.267.2019.08.03.07.26.08; Sat, 03 Aug 2019 07:26:22 -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 S2391349AbfHBPPV (ORCPT + 99 others); Fri, 2 Aug 2019 11:15:21 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:2640 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388504AbfHBPPJ (ORCPT ); Fri, 2 Aug 2019 11:15:09 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x72F6d7I126230 for ; Fri, 2 Aug 2019 11:15:08 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2u4pjqk6v0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 02 Aug 2019 11:15:08 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 2 Aug 2019 16:15:07 +0100 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 2 Aug 2019 16:15:02 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x72FF1Xb12452106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Aug 2019 15:15:01 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09D56B2065; Fri, 2 Aug 2019 15:15:01 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E2E85B206B; Fri, 2 Aug 2019 15:15:00 +0000 (GMT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.154]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 2 Aug 2019 15:15:00 +0000 (GMT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 2510616C9A53; Fri, 2 Aug 2019 08:15:02 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, 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@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH RFC tip/core/rcu 12/14] rcu/nohz: Force on tick when invoking lots of callbacks Date: Fri, 2 Aug 2019 08:14:59 -0700 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190802151435.GA1081@linux.ibm.com> References: <20190802151435.GA1081@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19080215-0064-0000-0000-00000405A2A6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011538; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01241059; UDB=6.00654494; IPR=6.01022491; MB=3.00028010; MTD=3.00000008; XFM=3.00000015; UTC=2019-08-02 15:15:05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19080215-0065-0000-0000-00003E8452ED Message-Id: <20190802151501.13069-12-paulmck@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-02_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908020156 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Callback invocation can run for a significant time period, and within CONFIG_NO_HZ_FULL=y kernels, this period will be devoid of scheduler-clock interrupts. In-kernel execution without such interrupts can cause all manner of malfunction, with RCU CPU stall warnings being but one result. This commit therefore forces scheduling-clock interrupts on whenever more than a few RCU callbacks are invoked. Because offloaded callback invocation can be preempted, this forcing is withdrawn on each context switch. This in turn requires that the loop invoking RCU callbacks reiterate the forcing periodically. Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 71395e91b876..b80eb11c19e1 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2151,6 +2151,8 @@ static void rcu_do_batch(struct rcu_data *rdp) rcu_nocb_unlock_irqrestore(rdp, flags); /* Invoke callbacks. */ + if (IS_ENABLED(CONFIG_NO_HZ_FULL)) + tick_dep_set_task(current, TICK_DEP_MASK_RCU); rhp = rcu_cblist_dequeue(&rcl); for (; rhp; rhp = rcu_cblist_dequeue(&rcl)) { debug_rcu_head_unqueue(rhp); @@ -2217,6 +2219,8 @@ static void rcu_do_batch(struct rcu_data *rdp) /* Re-invoke RCU core processing if there are callbacks remaining. */ if (!offloaded && rcu_segcblist_ready_cbs(&rdp->cblist)) invoke_rcu_core(); + if (IS_ENABLED(CONFIG_NO_HZ_FULL)) + tick_dep_clear_task(current, TICK_DEP_MASK_RCU); } /* -- 2.17.1