Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp447005pxk; Thu, 17 Sep 2020 07:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXH3r4iX+KNgvTpBbv6clT7MsWphWDa9tHweUP6mn/yCSaobYdEBb1k0R9c/Tj5pE1hAAo X-Received: by 2002:a50:fa94:: with SMTP id w20mr32479025edr.206.1600352352675; Thu, 17 Sep 2020 07:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600352352; cv=none; d=google.com; s=arc-20160816; b=XiehJps995YqMe0Gj9WzKZplweTUbY8pOxXXTVTgJgzn/CEiJWchqUTLE3Cb+iz1K/ lK6o9kOm6dsGJSwj8Z8fxhTt3y0nI4auQqbDqH2L4MaBxeE/qnDSt+jx0zb88jarGRdR pgI7mXtI1rjykwwPvTALaTfUVKjzkbATAdOnDWNTIes49zHng4aaKlh1IW4ICHC15TwO 04cLivuiODjOLSZceEoFUIYVWTI8/Yj+1qNZXdLC/Bcu9+jyWIca6JlkDnbh4NFrHTlE rrPVoJ2c+Qm3cEcm0LEoDtcor25W6DNqHOAvyqwqUb/A0sqFg0kAe2SfzGxHwNn+bdSl 4bnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=68dMkNdO3KZ78DAdDCiJLfBM2V6LmcayF5HlPqEwixs=; b=C9yyKeq5/+zVgwfQHBp/bykTvV+MwQGtGlKl73z3nMkpVaSjoviQuZ9xuA0Uc/E7jQ grKwZ9uHkS9iV+sNsqei+fFR7I9b9R8SfN5S1sNI68TC5Drzo8gomgtBTfylsv3GDYAw vfS02mjKWRo3CyGASqJ7FhbLmaevGQHWEB/B+8jPFH6wahpeRJS4feJ2gMwNKLMiGf5n haEjj4bb1L3CT8YsWWYbQQqi5vRZWFgBjEC9rFv9G3kHWFEO7Oy5QOlkNZdPvUJVwUcp oPJesQWINqImpk58J0AOvDasnfrQOLwNmY8Y3a3WS+5PzVLkzaEoWjMnK+fJOxHog7OR 9lHw== 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 mb24si6532ejb.583.2020.09.17.07.18.49; Thu, 17 Sep 2020 07:19:12 -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 S1727329AbgIQORU (ORCPT + 99 others); Thu, 17 Sep 2020 10:17:20 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:51550 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727315AbgIQOL0 (ORCPT ); Thu, 17 Sep 2020 10:11:26 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 278EDF9982682377EC19; Thu, 17 Sep 2020 21:52:26 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Thu, 17 Sep 2020 21:52:16 +0800 From: Hou Tao To: "Paul E. McKenney" , Davidlohr Bueso , Josh Triplett CC: , , Subject: [PATCH 1/2] locktorture: doesn't check nreaders_stress when no readlock support Date: Thu, 17 Sep 2020 21:59:09 +0800 Message-ID: <20200917135910.137389-2-houtao1@huawei.com> X-Mailer: git-send-email 2.25.0.4.g0ad7144999 In-Reply-To: <20200917135910.137389-1-houtao1@huawei.com> References: <20200917135910.137389-1-houtao1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) { pr_alert("lock-torture: must run at least one locking thread\n"); firsterr = -EINVAL; goto unwind; -- 2.25.0.4.g0ad7144999