Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp877617pxb; Thu, 5 Nov 2020 15:50:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1iPlG9XcUtvlQI8ei2V4ORGtnKkzLsTVnZteusdOA2H6vjtxiWutxNY2Rd5b8FjcLxmY5 X-Received: by 2002:a50:d615:: with SMTP id x21mr5488489edi.200.1604620215894; Thu, 05 Nov 2020 15:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604620215; cv=none; d=google.com; s=arc-20160816; b=neityBUOnfbG8R/0Mt3BD4GjYnc8IJ7ALjZ4+Xh/e2lFBqMMPYCMfxXns9qsjvfl0D cZxo0zb+2A4WKBEiM2/Ij7WyUc43P/tKuImKsvAr4NFq7ewRfD2M0uahrHUdSqkK0Nz7 BzBZbwk8TWXZTIljnhRfA2/G/0cBII7bQQBsHG87K9yRT6vZ8/B4ULwJPAdPGhx+dUvb aqr7yKojL00WwnCDMtUBaWKqjgwFVSNeDB1ryaUf9nEGQBxbVETqVypXG6IonYQd1zti hsDgci/Yt0tj2UPICm0wnQrNNpnJxsBFfrovvgI/cvZh8oPZVgJGS+/Z7Hy+hhv+yQVy axpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=4+afVAHZPBEZshf9xFowloYCLcPL0UdxfyEOY2VOiBw=; b=lY7511chVPSfAWI1MtPMwpzPYxzIab5yb0adLWCwWfMasO1y0SaoFYBGAMkc7+VrsN yPEOhOEZ1HWjpV9fZmFu0Pwez2bBeCXad8X3aLQYXgmRQR1OScmYNX+c5vkXpXMOY5Ij 4OPnhL3PrDR//CTIXZJGKc+f8UpBRBEpn647Ew9wCpZWTAXDnOTAq57n+AG0zaaIcaVL gXWO3W3ETUXnfXvaOrMrv+g7NvO2qQyBcOvn+psR7if60MbuTE6IqR8XFmv6Dpi3gL4N sWp0pYCKtDYJUFWYi+5XwqzqC+18N8Y3WUuK3PZjBarClbRoZM0dWcDY9GeWS++suL+U p/Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HFz0NGKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si2378295edp.497.2020.11.05.15.49.53; Thu, 05 Nov 2020 15:50:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HFz0NGKX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732880AbgKEXrh (ORCPT + 99 others); Thu, 5 Nov 2020 18:47:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:46182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732696AbgKEXr1 (ORCPT ); Thu, 5 Nov 2020 18:47:27 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-104-11.bvtn.or.frontiernet.net [50.39.104.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B4703221F8; Thu, 5 Nov 2020 23:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604620046; bh=HzwUWY2YZpUynALsoJs6v6eJGIe4fiNOIxvviiTKnro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HFz0NGKXnKM+wvqk4o+HAhGUXUDFHAaX2fcdS+kUJZuD00SXvKfPezQwzKSqHXbvF CmevWn7+sgIWlCvJml9D2fdA972Ldl7YJ7nnGufjtCeho/udJOKGZJjTL312pQhVqZ MCVNQfpdQ4edxlSUCnuOEZlwWmfR0ATwGhbMePHk= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.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, Hou Tao , "Paul E . McKenney" Subject: [PATCH tip/core/rcu 13/28] locktorture: Ignore nreaders_stress if no readlock support Date: Thu, 5 Nov 2020 15:47:04 -0800 Message-Id: <20201105234719.23307-13-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201105234658.GA23142@paulmck-ThinkPad-P72> References: <20201105234658.GA23142@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hou Tao Exclusive locks do not have readlock support, which means that a locktorture run with the following module parameters will do nothing: torture_type=mutex_lock nwriters_stress=0 nreaders_stress=1 This commit therefore rejects this combination for exclusive locks by returning -EINVAL during module init. Signed-off-by: Hou Tao Signed-off-by: Paul E. McKenney --- kernel/locking/locktorture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 316531d..046ea2d 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -870,7 +870,8 @@ static int __init lock_torture_init(void) goto unwind; } - if (nwriters_stress == 0 && nreaders_stress == 0) { + if (nwriters_stress == 0 && + (!cxt.cur_ops->readlock || nreaders_stress == 0)) { pr_alert("lock-torture: must run at least one locking thread\n"); firsterr = -EINVAL; goto unwind; -- 2.9.5