Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp89852imm; Wed, 29 Aug 2018 14:50:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY6APwWTNwbxzM24c/6NBH1njpIKbUirtOTRsrJCupuobC126GnZv1CQLGyyWK4mIDPUJ9n X-Received: by 2002:a65:5c4b:: with SMTP id v11-v6mr6966768pgr.98.1535579430800; Wed, 29 Aug 2018 14:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535579430; cv=none; d=google.com; s=arc-20160816; b=Ra0zE9G1vvGINABwQoUwl7EFLlfTwi6G8QN8e1lBGqf56Kp2NO6+1Eft/Hvfuuxf86 3X2xd/L+WZSdGXWFt0oG9Lb1vRCOWKefP9IcvxuO7V6IfNHWAOjWh4stG9CZcRdOKuk+ 3pXBLOfc6WHbYWCgXuTPMLYoin9of2p9lCOHZqTXGsnhkSCjSlHffMdOcVpp984Fgz73 +wQy4cnzL/DNb0TrP1RbpnTG5YD811iHDewoxArZHgSgmdU46a4KlLhsR2xNB7z8keRt d05/dOVOwDPabC/XfQktDWjnvjZRbDnN/UXfpCSSiFX7nqQu3c86phar9JQJuupNenJx AAag== 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=JXYd+E1dwkIg16tj3LkfbbUdBLdyVn8Q+StcnzViP0Y=; b=HvkR+rzP3Byoz3EUDpTQ12t94K7L51+cJ4bYFyTfV895cNmo0pYL2rBFPaP++776MJ jjbYNVmIpbioT0DyqYi73m9IdQIeafUS9zacpmIvThmCPWD055wVq2NLen4jE3rXbMoR tMqMTjIJgc6FSaw88ibLuetoR7A0hVGZ0ZgE09tlQV9OKnj+l7DyLzERfZ0Ro73Po1ug evFSAt9tFirzhCO9GYN7sFgc3VB8Clm7/1xud5zQ1ZUvZTB1I7hOvQD1kE36Ez9nufI1 qiRytoppKPZ3dmFFqZM1Duz3cXH085xtcQsk8i1srGXWZPiKMmBYVMS5ZkJYKCF74T7r 5K8A== 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 n13-v6si5145569pfd.50.2018.08.29.14.50.16; Wed, 29 Aug 2018 14:50:30 -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 S1727615AbeH3Br2 (ORCPT + 99 others); Wed, 29 Aug 2018 21:47:28 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60384 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727390AbeH3Bqv (ORCPT ); Wed, 29 Aug 2018 21:46:51 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7TLcpmU121201 for ; Wed, 29 Aug 2018 17:47:59 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m61rcvc9t-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 Aug 2018 17:47:59 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Aug 2018 17:47:58 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 29 Aug 2018 17:47:53 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7TLlrF946530588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 29 Aug 2018 21:47:53 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F14BAB2065; Wed, 29 Aug 2018 17:46:48 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D262EB205F; Wed, 29 Aug 2018 17:46:48 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 29 Aug 2018 17:46:48 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id DED6916C91D7; Wed, 29 Aug 2018 14:47:51 -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@joelfernandes.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 16/17] rcutorture: Check GP completion at stutter end Date: Wed, 29 Aug 2018 14:47:49 -0700 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180829214722.GA23411@linux.vnet.ibm.com> References: <20180829214722.GA23411@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18082921-0052-0000-0000-000003281C84 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009636; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01080727; UDB=6.00557487; IPR=6.00860713; MB=3.00023001; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-29 21:47:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18082921-0053-0000-0000-00005DE5E2B9 Message-Id: <20180829214750.26972-16-paulmck@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-29_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 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-1807170000 definitions=main-1808290211 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rcu_torture_writer() function invokes stutter_wait() at the end of each writer pass, which occasionally blocks for an extended time period in order to ensure that RCU can handle intermittent loads. But part of handling a busy period is invoking all the callbacks before the end of the idle period induced by stutter_wait(). This commit therefore adds a return value to stutter_wait() indicating whether stutter_wait() actually waited. In addition, this commit causes rcu_torture_writer() to test this value and if set, checks that all the elements of the rcu_tortures[] array have been freed up. Signed-off-by: Paul E. McKenney --- include/linux/torture.h | 2 +- kernel/rcu/rcutorture.c | 5 ++++- kernel/torture.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/torture.h b/include/linux/torture.h index 61dfd93b6ee4..48fad21109fc 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -77,7 +77,7 @@ void torture_shutdown_absorb(const char *title); int torture_shutdown_init(int ssecs, void (*cleanup)(void)); /* Task stuttering, which forces load/no-load transitions. */ -void stutter_wait(const char *title); +bool stutter_wait(const char *title); int torture_stutter_init(int s); /* Initialization and cleanup. */ diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 7df8142a6a22..ae10ad531993 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1144,7 +1144,10 @@ rcu_torture_writer(void *arg) !rcu_gp_is_normal(); } rcu_torture_writer_state = RTWS_STUTTER; - stutter_wait("rcu_torture_writer"); + if (stutter_wait("rcu_torture_writer")) + for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++) + if (list_empty(&rcu_tortures[i].rtort_free)) + WARN_ON_ONCE(1); } while (!torture_must_stop()); /* Reset expediting back to unexpedited. */ if (expediting > 0) diff --git a/kernel/torture.c b/kernel/torture.c index 1ac24a826589..17d91f5fba2a 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -573,7 +573,7 @@ static int stutter; * Block until the stutter interval ends. This must be called periodically * by all running kthreads that need to be subject to stuttering. */ -void stutter_wait(const char *title) +bool stutter_wait(const char *title) { int spt; @@ -590,6 +590,7 @@ void stutter_wait(const char *title) } torture_shutdown_absorb(title); } + return !!spt; } EXPORT_SYMBOL_GPL(stutter_wait); -- 2.17.1