From patchwork Thu Jan 23 18:58:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13948545 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F384915CD41; Thu, 23 Jan 2025 18:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658714; cv=none; b=gKByp+tCmQrjsZgou8TN7VnK8/jA6yMigZr8LVDaUOy1sl9LhTIWM16h24/60/jjqmfM064ZrINeGugokmp4KWPMRqk/+h0bjnMJHRtg/FDQgRXXALxPPhsf1YzVogUh31YQut1UWjRWZe23njbpoQvOdbbZo6eELE51jjwWb1k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658714; c=relaxed/simple; bh=IUKbhUTV6qNRIQ6CrUPX0BLVJHE2EqTKqTbQbf4ECMY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NZsMYfCNpsVA0/wifcCn5lvKGSkowVmJ+aoUlKkH/8z7t69ekHDWl9/7e3ylS6ogdeEH3L89HPIIHX1P8cUnhIUYYnGM4Yzli1KsFX7Gxj5VTU4vJ7OV56dLAO++EyxhXD5zT7LEwlvK/lZNGATSMpywQwiBl2SpxyS+LfWhxMg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g6avThUz; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g6avThUz" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-5401ab97206so1343574e87.3; Thu, 23 Jan 2025 10:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737658711; x=1738263511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YaQKQ/zepaWFn+uFpcOiGerEdCgq6w0dgGCa8PCB/Ps=; b=g6avThUz+Yud3NNekrfgm/hhAlrt8f7lAmpA9bougqaQKt6yxugVX5g84ezLcwB2DJ f9TYPHRIJsEfNjTsJ7xiR7GCe8K+I3tNAGTBiBWilGip0WOxa3gyCzVSvc4wYmD6r4iN oG4/unD9Ivowr/nfjrU6Uq6POh4Xpu/+3+R+zZG0nex4e3ZOOEAjMq0pgE2Arq/3h4BW +MN4JpX6pUYXlv8647MBdwN09CvYQfqHa/5dHyPhnkQHeI35egBoRvBwlE1Oosf9d6sY v/wah1d+PYVn3CFyPpDbjr6qFOqHhNj2TlY/tuvz3iJD3I7sXpqunwfk8TaARClGQ/hg wLaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737658711; x=1738263511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YaQKQ/zepaWFn+uFpcOiGerEdCgq6w0dgGCa8PCB/Ps=; b=GOtbeoN1N4uP8d1W7F4oNaqf2MBu0MWgmy1LjItMFAu59CXNLHwDFcbirgBfVKygNJ kG8BHlphACcQugOq/SaB8U3Pz6rHd05w535QLYo0MXO+3UvbOFofvbGYr1G4VV6GEToE De8WU5Z0qQB1hs6TjN9myfbpoWR4722HzY84VMFU0oI1U8v/OV2LEtG2dQ1fxegz0zaf GLQcyZm0kCcKmvISAbhOuuJ2E/5rDhxU83r9wpFrY2PPLHEDkaA2X7nd1DtcoJo7yk5/ lF4czKLnWU/QCsDPygJDN0wT6lmiAi1K1faIPbGxkJldhmoefaZDtJaqAks3Er54VTok RoSQ== X-Forwarded-Encrypted: i=1; AJvYcCWxrSIOBschqeMvXHkbUtRfcAVJILryKVFNQl5SWxe7gqEBMiAWE+bKS+pmuixzAco90/XLRB3JFL5Vb4Q=@vger.kernel.org X-Gm-Message-State: AOJu0YzaLOW+sNYP9kbJtfPQ3odYkreC4wwQwMpdgRslm051WO1GPe4B 4Et9h6qg3F9kc4++gTZjtEPVM0v7icHsE8pjvJqsIMMG6K6QXBt+CmQ0dw== X-Gm-Gg: ASbGncv79y7BtRgP7RhotwRR7wzYbri+f3q3NKtTHGuhYF0DRV6W322DGmMpFrMPCfF 16Dj3l/1O0PZ7Xyv21PNtIaxQ9dKJRAPNH+fDNd//bd5bdR+pXHGGEkDWmc4tEv/s9v63nx48am 0JnwXhDr11XhTb6NXogz9peVMKfpM/FxVSxLrAKSOFWttdr7EulMX+u0GeF9lhSfSstSOGNs2ia 7wk52HhN+3/hLXNYkHgiDRe2kLXyCxPszbhk8TjapOEp9I4MxKPGmk9+M3sKlGt4eSGO/VcTs+R rSD3LrX9Zns= X-Google-Smtp-Source: AGHT+IHh3AmH1ph+V8URM1jevFYQtKyPWBWH/uwqsjNOlAJTP3oOM0zdyWDbliYAHofpWqCLocjjmA== X-Received: by 2002:a05:6512:2246:b0:542:218a:343 with SMTP id 2adb3069b0e04-5439c28af0emr10348519e87.52.1737658710689; Thu, 23 Jan 2025 10:58:30 -0800 (PST) Received: from pc638.lan ([2001:9b1:d5a0:a500:2d8:61ff:fec9:d743]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-543c8368497sm9644e87.151.2025.01.23.10.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 10:58:29 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Boqun Feng Cc: RCU , LKML , Frederic Weisbecker , Cheung Wall , Neeraj upadhyay , Joel Fernandes , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 1/4] rcutorture: Allow a negative value for nfakewriters Date: Thu, 23 Jan 2025 19:58:25 +0100 Message-Id: <20250123185828.460836-1-urezki@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently "nfakewriters" parameter can be set to any value but there is no possibility to adjust it automatically based on how many CPUs a system has where a test is run on. To address this, if the "nfakewriters" is set to negative it will be adjusted to num_possible_cpus() during torture initialization. Signed-off-by: Uladzislau Rezki (Sony) --- kernel/rcu/rcutorture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index d26fb1d33ed9..6bc161e1e8ac 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -4050,6 +4050,10 @@ rcu_torture_init(void) writer_task); if (torture_init_error(firsterr)) goto unwind; + + if (nfakewriters < 0) + nfakewriters = (int) num_possible_cpus(); + if (nfakewriters > 0) { fakewriter_tasks = kcalloc(nfakewriters, sizeof(fakewriter_tasks[0]), From patchwork Thu Jan 23 18:58:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13948546 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E76516F858; Thu, 23 Jan 2025 18:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658715; cv=none; b=NodwM5p7RD7ZHZqecZIKU0ruMtD17zHdEXILmuw29+pyBE9o1LzpjgbxQa9DWPTi1eiLW+Z/CKT0Sjrham8FWJ0dRvZCyEfcxL6eef1gHvZwdWbRd+phxUxZl4IeubDjcHRgMr87M6vQylBG1aYdiYS3qflQw7IBDp2NWAGay1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658715; c=relaxed/simple; bh=huvA0Eqmf5vb3szR3jUX+yxvj+JUOxupUW3Bf9sh2ys=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TglDE5JDF7MRZzYpC+76Q90YeHqO4Mcym1TJ3OibWIPlNdwBvFg6Zdpglcuff8zu4+YfSBqiekbR8SlpRXgW9a9urF9Oy3GycA5ALqar4rn9HnKok6UlxE95M2BpsJAW7y4rJXcADqrZlsgzrMTrXKgpIY0CEg6JqbtWj2Abo84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fhb+9O0V; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fhb+9O0V" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-3002c324e7eso10823921fa.3; Thu, 23 Jan 2025 10:58:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737658712; x=1738263512; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sVvT7NP9aO9EIv6Tv5VTAY7tEo9/tNIuoTqsrg0VSvk=; b=fhb+9O0Vd6YpE1Ob9kKXN+2LOPc9SVLM+PC/cR+GUXKYvTksyX2iWRk9gR+iDGOi9+ RiVfQ5cRDcQJ8ESOIkNKK+gfOQB1phwbPob7SyG4cLnLloQ2rzlk1QajSr0pRsbMkh7t +0ynwdFJObqBTjUm2sCxN/UPsKlVTeu5dUE2M99cLst07n/vab3FTZjedaH25toVJggJ JPT6vLpns9LGejRgW12V/2m/zSBS7Q9CPeqrHOoAliZqde4kcb5xa/OFRsiNBzcwzATP xodHm5ubOhlQiD6T1hya8Qfdk5RwEcHDc1o+Z48OtX+Iv3YRHSKUjdgRSI4gxy6JsqDJ l0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737658712; x=1738263512; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sVvT7NP9aO9EIv6Tv5VTAY7tEo9/tNIuoTqsrg0VSvk=; b=wfrSot7qWa8foQx8lOL/W6oxnS+Rv5LawcNZRhW1Dc95D2aoNesQs98u0OAmyMj9kS O+NFZgRa22Jnj/POyL2rZ/4beWHObL+I9qfRofGeJpxudgp24GJtnG5Aq5s+Sw4eSGID eDHM6Knm0gr5OWRGqLRyB2+EV2zloFsPhUUIikXVH6ub1upw9wRXnMUOW8szBFVdNK4h 2r23ek5e0WCncyGwbCsR9LLfaJ+Yeggrfz/1XKAwchgpapQYzvHbzKMqOFCvkbQjZ39k 3CYoVdCWzInYjLsozkmSiPi9cvFwA0RtEVVqoBDUlgZfvceURNpdWnqsk1oZGYchW3nt R9Cw== X-Forwarded-Encrypted: i=1; AJvYcCXbyFSbFu+XaUZ03Erw6zwYJBVIyEye30tB+IXa3C/yiBL+0EnQMazDJcYgyeFQUPibdEOmS/kYBdvjrsk=@vger.kernel.org X-Gm-Message-State: AOJu0YzVihSpZWsioeCOXHGjTW6EvqUsvimWRQa4NeNNod89nRjHPebc GSmRGbTa27Xm0NNb2ybWlq+j4sifr8lMuSy1aivEAsBnLnII7o3UskY1Gw== X-Gm-Gg: ASbGncuMY2h3w2KsfpBXXH7JQ+zYKQfPzB5vYu9xUS7kclEoyLmm2MMbO1shRHcubbW GYI7AKvwqZXv1FITc1FPN/Ms7+25Z2dVFiFVjXUdoSF6PKFLglmFuVgLP4N9wXFeHAwdDDxInmL bIQ1oIBCqAUxDvgZCSY6tiR4NAGj51oGR9LBv2xn+oqmlUSigYQKI7LIIZiwhx4LHlzNfcL6wd0 XmLIYKt+NxZZRdH2TuoVP7ajIzoJf/0BQLObmjnQeaO4Ne2odgH/mCCxiz0Diii8Hsf60htZGsb X-Google-Smtp-Source: AGHT+IGx/gyP6KI6eRMVx44Gk3ldDLPOP4RK1jdSV2B9MGmB0gTv/bbqBcGmx/zbccrw+Kcozo/u4A== X-Received: by 2002:ac2:41d1:0:b0:540:2ff1:3c7c with SMTP id 2adb3069b0e04-5439c22a843mr7377804e87.7.1737658711804; Thu, 23 Jan 2025 10:58:31 -0800 (PST) Received: from pc638.lan ([2001:9b1:d5a0:a500:2d8:61ff:fec9:d743]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-543c8368497sm9644e87.151.2025.01.23.10.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 10:58:31 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Boqun Feng Cc: RCU , LKML , Frederic Weisbecker , Cheung Wall , Neeraj upadhyay , Joel Fernandes , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 2/4] torture: Remove CONFIG_NR_CPUS configuration Date: Thu, 23 Jan 2025 19:58:26 +0100 Message-Id: <20250123185828.460836-2-urezki@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250123185828.460836-1-urezki@gmail.com> References: <20250123185828.460836-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This configuration specifies the maximum number of CPUs which is set to 8. The problem is that it can not be overwritten for something higher. Remove that configuration for TREE05, so it is possible to run the torture test on as many CPUs as many system has. Signed-off-by: Uladzislau Rezki (Sony) Tested-by: Uladzislau Rezki (Sony) --- tools/testing/selftests/rcutorture/configs/rcu/TREE05 | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE05 b/tools/testing/selftests/rcutorture/configs/rcu/TREE05 index 9f48c73709ec..d6fbb82e3e6d 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE05 +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE05 @@ -1,5 +1,4 @@ CONFIG_SMP=y -CONFIG_NR_CPUS=8 CONFIG_PREEMPT_NONE=y CONFIG_PREEMPT_VOLUNTARY=n CONFIG_PREEMPT=n From patchwork Thu Jan 23 18:58:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13948547 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D97E517C220; Thu, 23 Jan 2025 18:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658716; cv=none; b=luG65ruOC0TSLjTyIXzu4242zJODxVitbtEPn8ogmlSAIR/fqJhe5z6PcuvSbXbSr6lggyHQBB7zW7rLd8lQ0y642f6OLTPtLSRBxA4fqngvlPTGHh/X1NJD8xFXlafcE692xOuVtyPcg5x4f0Nys2FlH97DSekz/6tdQ+ammmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658716; c=relaxed/simple; bh=RwZvbgX910S4UG3GAt47ssRn0Spn1KbQiiaXn8iPpK0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MWP/1gFJxZZXsAVjTsjiCU8pX/vJ29UF738CxCt4PgaJDt4QZQW4opoclEQklvUdGkhP6mn/eJkKw5AzvGrIk/b3dMqJqVzw1mB24q1iLm+14VrWkSfhPNyC3XgSGPIaYYwJsYka1X21C4iumnh/IrXV+z6BSSRwkjDQxdHRcfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QD1Mu12m; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QD1Mu12m" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-5401be44b58so1466653e87.0; Thu, 23 Jan 2025 10:58:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737658713; x=1738263513; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CnQF6orToOjnS8khCdzt3y/vz48zz2lcz2DYFQDQYZA=; b=QD1Mu12mbcwnjq5yXQjTbTCbPImEwJIqTsP9fsG8lUiIp4b2/qd+h4PFarHb8L9AwT Rpc+ap5bwue2gywVnSW7uR5yjidKigbYNopQv/JKuvZLDZPeFVOrRIzPjIWo5eRCPWYX llgX4Nj19vXBQh/lO7dmEPvygT/hPcuu56ZMvOzHjGXNHcmxPwEIPqdsHizmjoMEZudA ZHfme5/cUrGlNTLwKHlpaHYHiPFIdv5YCRXTCraHVwz8HukKCp0bHEfOFdb8ridW3keN WaXH7+1aQmu3b5TTnfqpfwkd+prHnQyhmgVFh3PCEbzBJsDF6SZ6nYM5gkJBIS9+ANcr ZK0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737658713; x=1738263513; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CnQF6orToOjnS8khCdzt3y/vz48zz2lcz2DYFQDQYZA=; b=GLQlzVwYVqh+F6adHk/b6RHy5s7v6Ip95ZD6VIcrZg/JTLgCJkAa4abXFPVuhuaBQe 9Y753n8WUIJ+PGxFgLNVwfEg80tJU10SE/2pha0Zm7La0p7QKXYZQC3CfWqsDLKu+bgI y5U6TMKXkr4dI4NXiNxQlzxDM/0V0v7AjqIvUsITF2kLEnKr0e6cfQh1x1SmnuhO1t6n 6+4+CtcmEFB2BJI3oi7IwQnFO9qw0QO+wUEg03vdayWrSzl+tMRtUnD+QDzFvfzoS/je 625k0V4EGe3pTMlyTU2f9bBVB3oAVRqibaNjdy6j02OhJr09GT5EJiVE9Yy9W34fvaSF NHpg== X-Forwarded-Encrypted: i=1; AJvYcCXccw/4R/XUTTix5T9kj4hA8bSSYBx2SLxv5GOXO2MkSAH7zzxSEK+7mJgm8PO4YcI1//YCmNg+ESgngxk=@vger.kernel.org X-Gm-Message-State: AOJu0YwTrCevU5zzOnyIqQAJfcNYIbhmgLKUtEYnD5YwvV9vDbbED4oB 2jn7lgn+h3aB9nR6ivMWECDOlVx6liWOCQaaGZ/8rQdbaSzAgG7F X-Gm-Gg: ASbGncvaaM8CLDxJgdIQ624qim0Ak6lpvUTB3Irk9ohQytcZIkQJhd4zFT49gq6ZO5f tUo5ZV6/TKdC0a8+3hYsZWVNtojtiQPSbxf9rnUP7/+j/FF/01kZIXxPvq2vzTChi8KDWSrELQV 1eN+h4UTVpp8vlMOVRa9QaP43zK2Zw8l47vEHPJurs1yQfUg+SyMFVuJ+hleTjDyE2eAVCsSj3/ 9ZaB1t4UmXuOtkzwkLD3OtyZ8TTuBS1gI5OIV4foS2xn6sVuXFAY551ieOGbNxxZq1NVETQZ64n X-Google-Smtp-Source: AGHT+IF7vFmZuDaTLDCmNgIIbMtb1JMs0Aig/nla69iRPjNnFd3xWEZdHUXKBa+ExJUMJotCbKF+tw== X-Received: by 2002:a05:6512:3189:b0:540:2fbb:22cb with SMTP id 2adb3069b0e04-5439c221527mr9171939e87.13.1737658712747; Thu, 23 Jan 2025 10:58:32 -0800 (PST) Received: from pc638.lan ([2001:9b1:d5a0:a500:2d8:61ff:fec9:d743]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-543c8368497sm9644e87.151.2025.01.23.10.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 10:58:32 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Boqun Feng Cc: RCU , LKML , Frederic Weisbecker , Cheung Wall , Neeraj upadhyay , Joel Fernandes , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 3/4] rcu: Update TREE05.boot to test normal synchronize_rcu() Date: Thu, 23 Jan 2025 19:58:27 +0100 Message-Id: <20250123185828.460836-3-urezki@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250123185828.460836-1-urezki@gmail.com> References: <20250123185828.460836-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add extra parameters for rcutorture module. One is the "nfakewriters" which is set -1. There will be created number of test-kthreads which correspond to number of CPUs in a test system. Those threads randomly invoke synchronize_rcu() call. Apart of that "rcu_normal" is set to 1, because it is specifically for a normal synchronize_rcu() testing, also a newly added parameter which is "rcu_normal_wake_from_gp" is set to 1 also. That prevents interaction with other callbacks in a system. Signed-off-by: Uladzislau Rezki (Sony) Reviewed-by: Paul E. McKenney --- tools/testing/selftests/rcutorture/configs/rcu/TREE05.boot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/rcutorture/configs/rcu/TREE05.boot b/tools/testing/selftests/rcutorture/configs/rcu/TREE05.boot index c419cac233ee..54f5c9053474 100644 --- a/tools/testing/selftests/rcutorture/configs/rcu/TREE05.boot +++ b/tools/testing/selftests/rcutorture/configs/rcu/TREE05.boot @@ -2,3 +2,9 @@ rcutree.gp_preinit_delay=3 rcutree.gp_init_delay=3 rcutree.gp_cleanup_delay=3 rcupdate.rcu_self_test=1 + +# This part is for synchronize_rcu() testing +rcutorture.nfakewriters=-1 +rcutorture.gp_sync=1 +rcupdate.rcu_normal=1 +rcutree.rcu_normal_wake_from_gp=1 From patchwork Thu Jan 23 18:58:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 13948548 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17EBB18A6AE; Thu, 23 Jan 2025 18:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658717; cv=none; b=hKYgvYZRGlftYkDWwlP2eI1ooeBahJ7p6iEo820FRaCzrnTwn8qaDw0Gt09Y8DtwbUWRQT+TMZEbCdbzeW0zPVPzgKWzSdpVCjgMWoUDO5SgY3UquqEzr/Mhkpq/zplHpGeJhjUGys/7ElDyDDUS2qP2dgQCTtO+geqWOmVSJqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737658717; c=relaxed/simple; bh=1sllsi9F/Q/N7eTgfTFGVbPA87tR/DUWvo5VkBPNlPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CkXRTyKueyUzYs8ujmM7V5zjwD7KWwOZoOYhtrJglZHUAR23nhOQr7THO0hKGbv7ulCyC3YWyp/n4+ernWwn+ItQ4JmX/MvsLL+KvRjUemGsj1Dbib3ySp76o+k9fsELMYGMNkIosWE35CJ1h/t8wEqpZnl6d2wvOhRj+Efnjqk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=M1PYfeWJ; arc=none smtp.client-ip=209.85.167.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M1PYfeWJ" Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-540218726d5so1429933e87.2; Thu, 23 Jan 2025 10:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737658714; x=1738263514; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PQMpcEzLxZWnBlEPxsQY2sa6eEqK7zJT3M51w1wAnJ8=; b=M1PYfeWJqsehadbgbBgdvIJ3sAa7s9NyB4u3ta+ia1KhXZgzagyGz0QZWFHHhdfuaf 6M4YyHgqYkJL9wJf5e9EQxjZfVPz3Y/wRweBOp6gGNNjXOdkAhjDmW94UgHkmmwny7ru im4Dmq3bR02CQEzEGd0tFE7nBQTqh7f2c3tIJT2RqeeMdEBk6+zCOQPDDNAxnq8+VvA4 AYulXiADbSd6bDr91zQmpJSo3u8K2GyUBMfj94XJlwQ04miIyV/D+rzm6KmISDANj7cv bR2MN3N2Onih3DxT+piYp8q64i4FNkGWv6uSOJoodgg9+nKV+p/5SUD+PB8xc69xj3Oe jfgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737658714; x=1738263514; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PQMpcEzLxZWnBlEPxsQY2sa6eEqK7zJT3M51w1wAnJ8=; b=di3rxV0nqpyZ2EqUPhcjVKFIdxMDN8+qdApJvEi53aVF03kTQBOWcegQc4M/Hes4Q/ +rM3NQoYzzKvWk5uNrPRK1Bk+6o1cPr22HwNsgpeFgdDNgQpCjSEOQSMytgaS7BBJKQ3 lyqQmA97RKYwG+UzAsS3IogUjganAVgcAhDJhLEx3lqBSBkhVYWtnB21VhnlEa357NW0 xfvflv7A9LaLncJcnCxCPScoyiSGCPSogDoGBhkdjXpfIZorf4BjyQq7hn8sQg+llAfj kjxhP/mogDdQyegnTWz9UYQEsDr9ZWpzlr0yo93S8926lTj/PsYW4iPmIiHD+Q7y1B8P tTDQ== X-Forwarded-Encrypted: i=1; AJvYcCX5DHtHaZ+5I1UUT/uXncLKA/GaY760RGNhkGy/k2O/qeDUnaUgw1Tu366qlG36TQTpEB2PoHweJhIh/NY=@vger.kernel.org X-Gm-Message-State: AOJu0YyybCIOO8YAI5Xcu1+fCTvCh53v0vnI8XplV7S+WiWtXMGIvhGY vas9HxBvxSr5lfwpU5QjBV8yqS5LJ2dF7w8ERc28Q2e3i+OLiPjD X-Gm-Gg: ASbGnctknoWXtvfUMBIDUSzBhXUNkS6Gfj+NiwTc6BkjiRFT87KofPK+N08EcxyO6jh OVefhXwBOpzllmAPKHrba4cLoaxRkxdb5IAnLMcI0PYAq86bpd18GTfJDNWn5x+46srAZgLo3rx je2sF37/ng2mR0QmiofCjZfYDdn/JGXu7DCl8xer+b3vIG3WYzM+D/AB/iqmxPiHsphalP263av 1gD8nFY2hIM6hFbqW5yi1AGxzV0vFkwGF4I8k2vWRBNvAbHyfwCWuISbhtjzbQQa1KBzZVKx1LD X-Google-Smtp-Source: AGHT+IG8HDMu/dBffQQYFZIQ8XixOEGsiXfgz39zicgDR+ac6qtsBNYC7P3vQR7esdELtQTbMcLelA== X-Received: by 2002:ac2:41d7:0:b0:542:2a8b:d56f with SMTP id 2adb3069b0e04-5439c22ca36mr8146588e87.4.1737658713713; Thu, 23 Jan 2025 10:58:33 -0800 (PST) Received: from pc638.lan ([2001:9b1:d5a0:a500:2d8:61ff:fec9:d743]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-543c8368497sm9644e87.151.2025.01.23.10.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 10:58:33 -0800 (PST) From: "Uladzislau Rezki (Sony)" To: "Paul E . McKenney" , Boqun Feng Cc: RCU , LKML , Frederic Weisbecker , Cheung Wall , Neeraj upadhyay , Joel Fernandes , Uladzislau Rezki , Oleksiy Avramchenko Subject: [PATCH 4/4] rcu: Use _full() API to debug synchronize_rcu() Date: Thu, 23 Jan 2025 19:58:28 +0100 Message-Id: <20250123185828.460836-4-urezki@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250123185828.460836-1-urezki@gmail.com> References: <20250123185828.460836-1-urezki@gmail.com> Precedence: bulk X-Mailing-List: rcu@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Switch for using of get_state_synchronize_rcu_full() and poll_state_synchronize_rcu_full() pair for debug a normal synchronize_rcu() call. Just using "not" full APIs to identify if a grace period is passed or not might lead to a false kernel splat. Signed-off-by: Uladzislau Rezki (Sony) --- include/linux/rcupdate_wait.h | 4 ++++ kernel/rcu/tree.c | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_wait.h index f9bed3d3f78d..a16fc2a9a7d7 100644 --- a/include/linux/rcupdate_wait.h +++ b/include/linux/rcupdate_wait.h @@ -16,6 +16,10 @@ struct rcu_synchronize { struct rcu_head head; struct completion completion; +#ifdef CONFIG_PROVE_RCU + /* This is for testing. */ + struct rcu_gp_oldstate oldstate; +#endif }; void wakeme_after_rcu(struct rcu_head *head); diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 2795d6b5109c..0ae90089ef09 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -1612,12 +1612,10 @@ static void rcu_sr_normal_complete(struct llist_node *node) { struct rcu_synchronize *rs = container_of( (struct rcu_head *) node, struct rcu_synchronize, head); - unsigned long oldstate = (unsigned long) rs->head.func; WARN_ONCE(IS_ENABLED(CONFIG_PROVE_RCU) && - !poll_state_synchronize_rcu(oldstate), - "A full grace period is not passed yet: %lu", - rcu_seq_diff(get_state_synchronize_rcu(), oldstate)); + !poll_state_synchronize_rcu_full(&rs->oldstate), + "A full grace period is not passed yet!\n"); /* Finally. */ complete(&rs->completion); @@ -3214,7 +3212,7 @@ static void synchronize_rcu_normal(void) * snapshot before adding a request. */ if (IS_ENABLED(CONFIG_PROVE_RCU)) - rs.head.func = (void *) get_state_synchronize_rcu(); + get_state_synchronize_rcu_full(&rs.oldstate); rcu_sr_normal_add_req(&rs);