Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp169538rwl; Wed, 4 Jan 2023 17:10:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXu5EDIGa042A5WXkFPvhWrXOjBcGi3O4PC7H3dj59DHXVCkMyF8Btl8VzUVd5CVrKAsSI0l X-Received: by 2002:a17:902:8688:b0:192:fc9c:a238 with SMTP id g8-20020a170902868800b00192fc9ca238mr797834plo.66.1672881038044; Wed, 04 Jan 2023 17:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672881038; cv=none; d=google.com; s=arc-20160816; b=BlhslTOn1zyq312fC0dC+Y0XCpmN9LlBaUVfaatptUshvXH7RDPnPY7a6iFAy0UXQh 8lOI/VcmmSslML5pS+G53uQNQJrUF5GvNRCa/M3S8a34N1ayy1gD4ds/DObhUKy+llb1 zG8ml6W9ZdqJdy3TL80Ryfyzm4TPMzh+uGgyYkRhWMacl09OfwpT5/oDpEtn6XO4HyRE gST4pPstCkJWlxHkIA4gKWov+2WFLzG3slzG3pxoIEB4ycbt+hkf2XLhOKekayR7kGBn 591G8IYLt3fdSDfDJ5p/bmlINVshRen9A74V+7MNz8hDlqU4bc5C6C19aGK+92DFaq7r PRIg== 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=KGmzY2PgSTgaovOwEsnVd7JCd97Y/ZVdYNjzDirgVLs=; b=tdHzxTf+mVgTlrbz8hvjkD7SxLcnbJQrjwZkOLpvYnjpb1ZEa/XeUIs/V44XXUjVO7 0QPK8nOLAKp+4zYrXBJ8aOfbjmZtKc2falm7JSsgxFqhhfhFKdbdCwQ97WK6xYeBherf eA+Cep1hjLGw9lBV7HFSvNQB4p5REYdfmEgHJcUTOiQHxr4hRUpHtJinc88/kho2BBxO mOHFaWqeVwyabJgbvR9eP+5Dxg/bHN4gXM4Vl8roBK6dt3cjN5YVsiDwMzmluw8wHpQi b9S6KD/zWGuNy1ltM4uETS6o7ppDkjStyGN51gj+nTKaMAVRiUnPB9SMdLPt1Kywl1Jo 3xpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QLorTwpX; 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 p2-20020a170902b08200b00192a9a8fffasi15918221plr.183.2023.01.04.17.10.30; Wed, 04 Jan 2023 17:10:38 -0800 (PST) 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=QLorTwpX; 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 S229875AbjAEAun (ORCPT + 56 others); Wed, 4 Jan 2023 19:50:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjAEAuS (ORCPT ); Wed, 4 Jan 2023 19:50:18 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4673D4A958; Wed, 4 Jan 2023 16:46:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BFEAA6189B; Thu, 5 Jan 2023 00:45:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DA6AC433F0; Thu, 5 Jan 2023 00:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672879503; bh=p1n9Oin+2YJ+fvK62lOQ034ZZbRWfu52tpQVaVSIkgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QLorTwpXRP7RHiZKX9ilE9mVj9i5l3CORa+QRtRWE+Kx19J2SebW01pokDz4o6JEh MyvcQSJiy9wvDjZ/1T1BD2qQywHYDCI1X/yX+iD/Zu/LgP2ae3GHqJoyz0nxY6bMvn u8v6y0E9SbbMkH3WfR3zMp/fv65Y5+UFSPch+dQ1o3bx9CSxtUS7E89ZxDcoPzwyuO XSVB30zD+a/KEYDOwl2riDc2/PQEtO060vXa8t4UxYzqKiFJVDkPo+BRhnFk5JcCtJ +qD7rLianEGQEq7SYsmxTv9EesqnLQKR2XKR4Hm/UhGclpTlIGZf8ZW9bIWEnSGckA w6sBAi480clcQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id DAE285C086D; Wed, 4 Jan 2023 16:45:02 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 1/7] torture: Seed torture_random_state on CPU Date: Wed, 4 Jan 2023 16:44:50 -0800 Message-Id: <20230105004501.1771332-2-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20230105004454.GA1771168@paulmck-ThinkPad-P17-Gen-1> References: <20230105004454.GA1771168@paulmck-ThinkPad-P17-Gen-1> 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 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 The DEFINE_TORTURE_RANDOM_PERCPU() macro defines per-CPU random-number generators for torture testing, but the seeds for each CPU's instance will be identical if they are first used at the same time. This commit therefore adds the CPU number to the mix when reseeding. Signed-off-by: Paul E. McKenney --- kernel/torture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/torture.c b/kernel/torture.c index 789aeb0e1159c..29afc62f2bfec 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -450,7 +450,7 @@ unsigned long torture_random(struct torture_random_state *trsp) { if (--trsp->trs_count < 0) { - trsp->trs_state += (unsigned long)local_clock(); + trsp->trs_state += (unsigned long)local_clock() + raw_smp_processor_id(); trsp->trs_count = TORTURE_RANDOM_REFRESH; } trsp->trs_state = trsp->trs_state * TORTURE_RANDOM_MULT + -- 2.31.1.189.g2e36527f23