Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5915145rwp; Mon, 17 Jul 2023 11:27:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEyBml2c4fvDSiFh49woAeEEpVnS/UgzQpJM0ZtiZ7BXXPjsqGdi6AhSNGNedO9xG9IKTt/ X-Received: by 2002:a05:6402:6ca:b0:51e:2a57:1d93 with SMTP id n10-20020a05640206ca00b0051e2a571d93mr11095912edy.16.1689618461288; Mon, 17 Jul 2023 11:27:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689618461; cv=none; d=google.com; s=arc-20160816; b=1Bea1sTvo1RRURIEFZROltr1/wFN7i/w9XX6JhHhUo8ch3bn9WUsC+Z1zfIJyBrSdR uRFbo1xt1y2zyrc0zJ4TLSHBuf3GPNHMx44Slwp83mVOvCUBL3Ld2wLbc6hJYom4aI4N Xy4U/cVg3Rbnjp2OAhXZfXzMygelvfzLUgjFeJmL5Sji9S750usmg6ia9rKtSEtGGmce 2tbeVabkWYu8oL8KuypL4fkxnNbAcGybAW4/cdyGaxXCAzmomfpImiGRv2DvBYYD5Q8C LUIkPmdI6mIN88pKVKhX+B+ysZHqHAYARkh1nv84Gd4sfOYNqub0IWpO0rurO5pVT6NU TqDQ== 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 :dkim-signature; bh=+qX+LkYK4oItHYSM3qR+QTP8rv6ig8u1xwWnDrPjNf4=; fh=+6SS9+sPKx2/jCReCJL9vk5CEA0Em9eT7ErpbawzEjo=; b=0o8PrPX/3l9Beb7LYhZbKAbjjPOD4GygH+mKQr9cW5d2tR+kxw1IM6W50xMOzB/+Uk NoGNH0r7a/T0q8b561aVtkzuzfn6/m2Fsze0LFAfbuvNGFWwr97eYeh7EXtyTGuWADd0 YdDbAXV3AxyUl1VVf7a/b51Ffgk3PqfDw/vwC/XiLnJwtVcFoRXWw1ZXzdwlTX71nw8P +bxDqR/FDEgYpASuwcBNyMoILr8qbOKW6J+nPp3xm0N4nCliDQio+S3JFsnasDjAv037 Y5rgm2nxCNzHOf9QzBfA4ORc4BhgfC+3cfdxpsJs3TNFqxKrG0m95kib8XiEAjTGwtJB 7o+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XyUAvZde; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r9-20020aa7cb89000000b00521a6decedfsi5130edt.245.2023.07.17.11.27.16; Mon, 17 Jul 2023 11:27:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XyUAvZde; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231840AbjGQSVA (ORCPT + 99 others); Mon, 17 Jul 2023 14:21:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbjGQSUs (ORCPT ); Mon, 17 Jul 2023 14:20:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EEA5F7; Mon, 17 Jul 2023 11:20:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 97DFB611EB; Mon, 17 Jul 2023 18:20:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F31EFC433C8; Mon, 17 Jul 2023 18:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689618044; bh=pE4BWqzV7aB/0f8qofy45VqlKrCym7gg/FrxizK5ypg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XyUAvZde7u8wWUU35mWpc2I0qIsa6NqvdKSCIO6VHJBj47drCQ535vmhgE1cGT4v5 XdLe7pQArfVoJo7626fkN24yd/Lon2OKQ2POTAzTQOAKbXetcUVdmdZvAPFI2XjJhZ BQh27eG9BWYjsDYmatpQfB+fEGTBPpgSEQZtwxp4Q2O7/OcMtZ8Rb0wMNF8O1CV6PT 9oP6CN76aQ74aA1ZkVt0y373rp39HnU66v8m8K40ITVhphtiBBL/H/HJktLJSb53Et uFIk3eBhE7Urg2ScrJsH1Emkm4M276rpk7LeIfQXBfsKmuELZYjcfgXXjG9f+vr9gF gvBLyZTNzeckQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 908DFCE0806; Mon, 17 Jul 2023 11:20:43 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, Dietmar Eggemann , "Paul E. McKenney" , Josh Triplett , Joel Fernandes , Juri Lelli , Valentin Schneider , kernel-team@android.com, John Stultz , Davidlohr Bueso Subject: [PATCH rcu 3/9] torture: Add lock_torture_writer_fifo module param Date: Mon, 17 Jul 2023 11:20:36 -0700 Message-Id: <20230717182042.1098651-3-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dietmar Eggemann Modifies locktorture writer to run as RT task. To use it: insmod /lib/modules/torture.ko random_shuffle=1 lock_torture_writer_fifo=1 ^^^^^^^^^^^^^^^^^^^^^^^^^^ insmod /lib/modules/locktorture.ko torture_type=mutex_lock rt_boost=1 rt_boost_factor=50 nested_locks=3 This patch has been helpful to uncover issues with the proxy-execution series. Cc: "Paul E. McKenney" Cc: Josh Triplett Cc: Joel Fernandes Cc: Juri Lelli Cc: Valentin Schneider Cc: Dietmar Eggemann Cc: kernel-team@android.com Signed-off-by: Dietmar Eggemann [jstultz: Include header change to build, reword commit message] Signed-off-by: John Stultz Acked-by: Davidlohr Bueso Signed-off-by: Paul E. McKenney --- kernel/locking/locktorture.c | 3 ++- kernel/torture.c | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c index 949d3deae506..aac48d323254 100644 --- a/kernel/locking/locktorture.c +++ b/kernel/locking/locktorture.c @@ -809,7 +809,8 @@ static int lock_torture_writer(void *arg) bool skip_main_lock; VERBOSE_TOROUT_STRING("lock_torture_writer task started"); - set_user_nice(current, MAX_NICE); + if (!rt_task(current)) + set_user_nice(current, MAX_NICE); do { if ((torture_random(&rand) & 0xfffff) == 0) diff --git a/kernel/torture.c b/kernel/torture.c index 8be83fdc6be1..db79197e257a 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "rcu/rcu.h" MODULE_LICENSE("GPL"); @@ -57,6 +58,9 @@ module_param(verbose_sleep_duration, int, 0444); static int random_shuffle; module_param(random_shuffle, int, 0444); +static int lock_torture_writer_fifo; +module_param(lock_torture_writer_fifo, int, 0444); + static char *torture_type; static int verbose; @@ -734,7 +738,7 @@ bool stutter_wait(const char *title) cond_resched_tasks_rcu_qs(); spt = READ_ONCE(stutter_pause_test); for (; spt; spt = READ_ONCE(stutter_pause_test)) { - if (!ret) { + if (!ret && !rt_task(current)) { sched_set_normal(current, MAX_NICE); ret = true; } @@ -944,6 +948,11 @@ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m, *tp = NULL; return ret; } + + if (lock_torture_writer_fifo && + !strncmp(s, "lock_torture_writer", strlen(s))) + sched_set_fifo(*tp); + wake_up_process(*tp); // Process is sleeping, so ordering provided. torture_shuffle_task_register(*tp); return ret; -- 2.40.1