Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp562483pxk; Thu, 17 Sep 2020 10:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJQgTyUfwgIiKRDxkUCdmfV4s8B2t4cu7/YqhqsOwNprBHkWJNKRaUrR0wbp92HvTFBfvG X-Received: by 2002:a17:906:3e90:: with SMTP id a16mr29913429ejj.363.1600362084030; Thu, 17 Sep 2020 10:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600362084; cv=none; d=google.com; s=arc-20160816; b=0WQayMoX24Eva36O4/Kn5lUs9/j7eM0Cp5ZtdojUJn9Cl/tAZZfUUAga+BtTHMnny8 YEX3yMXTGS7zLsUK34yGhYMPdkZUPsLDGnLCay3aq0XlHC1NHKaGcmUZdX7znE4CnJVy Y0dzFUsDiH7xC1fJ4WYlPpiR5dAvkeaqS5SgdgTqyCa//Gxo7RpEEvefKTFV9YORjqIR 0l53XkLsuIA0i73EBt5GeA+WsAqDhNLb1Q2hp6blQDXwOYl997Lhubo/nCKko0X9wwcp P2kUvum0ZTLONdLLWT4EH4JHTSPqUD8eubA61a7mXl+MgiWICHhVBaGCl5rnI/JF77xa 2vNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2oAMA+lNuw+4Z7Yj0yjcuKkziAcU/iwrZ9qTfqZyEoo=; b=0qpLJIWN95HJHKNJ6WWdCEWaYzf6QXEI4HjG4NqJWnYpfNSeDUpz146kHuMu6spuXx KE5cSu71xeEEoYoVaGaJpC8408SWpTVDEVlI7DJ/pIWSeQZtk7ka+3av7BreI/OQSm2y cH096qDGKXlKJMMLVB7KEgpZx7grUZ0QImOtNL7Da5iILc4lBl6yE2iOai67VVlHUHcj Fm0yyGGcXi6/u08dCOvQc4tytPeVj2nsUSnwxzaTYCSu04BZ0LN6Z7U9gBDMIF0mlPBx ojfOILZ62pIc8EIf3FPv3cUsnCYRcnl3Q9PuRP5fKt7pUvkEu3pTYIS03zTxmgnV2zts +/mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xF2R6RMc; 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 z9si338101ejj.34.2020.09.17.10.00.46; Thu, 17 Sep 2020 10:01:24 -0700 (PDT) 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=xF2R6RMc; 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 S1728800AbgIQQ7f (ORCPT + 99 others); Thu, 17 Sep 2020 12:59:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728790AbgIQQ6S (ORCPT ); Thu, 17 Sep 2020 12:58:18 -0400 Received: from paulmck-ThinkPad-P72.home (unknown [50.45.173.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C1A4206A4; Thu, 17 Sep 2020 16:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600361898; bh=NUy17Wp9AvMVlvP9VNsHeGbqpNFRkHeKJDWptL5/lrE=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=xF2R6RMc1vzJUadr+hUQyZjdO9B40AKvv6SePne9Wkj/G9gGKnY5KNJvRE54NgoPc JVsMA1WTn26sjfyxI3f96nNbdldTIprcr9dCLLk+blJiGDjgmx6N0KBTtUyHW4uj1a JhVwFXjHbX+4DkRh8WBDn4HjeAKsQ29FwACmmMDQ= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id EED3335225FA; Thu, 17 Sep 2020 09:58:17 -0700 (PDT) Date: Thu, 17 Sep 2020 09:58:17 -0700 From: "Paul E. McKenney" To: Hou Tao Cc: Davidlohr Bueso , Josh Triplett , linux-kernel@vger.kernel.org, rcu@vger.kernel.org Subject: Re: [PATCH 1/2] locktorture: doesn't check nreaders_stress when no readlock support Message-ID: <20200917165817.GK29330@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200917135910.137389-1-houtao1@huawei.com> <20200917135910.137389-2-houtao1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917135910.137389-2-houtao1@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 09:59:09PM +0800, Hou Tao wrote: > To ensure there is always at least one locking thread. > > Signed-off-by: Hou Tao > --- > 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 9cfa5e89cff7f..bebdf98e6cd78 100644 > --- a/kernel/locking/locktorture.c > +++ b/kernel/locking/locktorture.c > @@ -868,7 +868,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)) { You lost me on this one. How does it help to allow tests with zero writers on exclusive locks? Or am I missing something subtle here? Thanx, Paul > pr_alert("lock-torture: must run at least one locking thread\n"); > firsterr = -EINVAL; > goto unwind; > -- > 2.25.0.4.g0ad7144999 >