Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp830240pxk; Thu, 17 Sep 2020 18:14:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+I4AtSOLQusUjeIs6EfzJ3B1HLAh6Uqs+UDN8tzQ+oHQXupsr9XiL45cWJOKuLwS91PHv X-Received: by 2002:a17:906:d11a:: with SMTP id b26mr32398822ejz.191.1600391697048; Thu, 17 Sep 2020 18:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600391697; cv=none; d=google.com; s=arc-20160816; b=Bu2zqpHk2m1Kdbhobc/p2+/VwDZcq7wKyJ6ecTMWCkxhjE93J6dWm6I8Be/ARVbcof 0zFz0cpDZUaT721bVaD3Bzq58d1kluRYKhOFuU+I4RyqGwT426gIwveQ7eDAxQbt+swb Zh3rB5VZwNg1b10kj/d10yc8UKQ97exxGPSBcJEwES94cGAnBXxh0aozxnXdhxhWwYC3 Rf0D3Q9gpSGbXSxrtb0zTKLyqSeDgeM/ugSGxmWDQZgygFxFC/tSHwlXnkAHcbQ/HBn9 S6CzGlU3Bn+cEU5+fL7KQyXfwsttxlT9b0OckqSAyVVz8XU2hlCi+F/FQntco9weXLZv 6v9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=UrqbMb47+7jwDGtsZdAkIjY/5OMPiVK5Wa6ALdND29w=; b=aTGRmHR7kUXIs2fqmg9vilGDGBXej+pnsv/3fdeGuVzN7p+t9LhwV65FXZfDV8Juer 1fL52UZUADz/AETXmyFC5yKRqA0H5SS3XGtiDlDeNbOfzEWM2Ha4P0OXKhZuDURm3a4x O0/E+Bp+H4AFGregB2DgQ6aPqSRUVvWscbtlg9gZ/0WJ2+2474Wuj7vqU6/CSWjVaHgy rNH0xOgNG2YgfzmiURj7LqEb+JQPAqp3dN56PUcMnbBbecVWgeKvnGZ3hrwAa2SODgaT jTFyTLF192oOcWBx88kLepMPVXrrQJLBSobyNbvummqVoxAh5YblldQL0EDZWRihOXMn eP5g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si965888eds.454.2020.09.17.18.14.34; Thu, 17 Sep 2020 18:14:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbgIRBNW (ORCPT + 99 others); Thu, 17 Sep 2020 21:13:22 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13245 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725886AbgIRBNW (ORCPT ); Thu, 17 Sep 2020 21:13:22 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 8301C5BEDA7A68142340; Fri, 18 Sep 2020 09:13:20 +0800 (CST) Received: from [10.174.177.167] (10.174.177.167) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 09:13:15 +0800 Subject: Re: [PATCH 1/2] locktorture: doesn't check nreaders_stress when no readlock support To: CC: Davidlohr Bueso , Josh Triplett , , References: <20200917135910.137389-1-houtao1@huawei.com> <20200917135910.137389-2-houtao1@huawei.com> <20200917165817.GK29330@paulmck-ThinkPad-P72> From: Hou Tao Message-ID: <86bc5a54-5dfa-4320-9e10-9660a25724d0@huawei.com> Date: Fri, 18 Sep 2020 09:13:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200917165817.GK29330@paulmck-ThinkPad-P72> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.167] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, On 2020/9/18 0:58, Paul E. McKenney wrote: > 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? > The purpose is to prohibit test with only readers on exclusive locks, not allow it. So if the module parameters are "torture_type=mutex_lock nwriters_stress=0 nreaders_stress=3", locktorture can fail early instead of continuing but doing nothing useful. Regards, Tao > Thanx, Paul > >> pr_alert("lock-torture: must run at least one locking thread\n"); >> firsterr = -EINVAL; >> goto unwind; >> -- >> 2.25.0.4.g0ad7144999 >> > . >