Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5930274rwp; Mon, 17 Jul 2023 11:46:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnJo0+22r1YLS67A7QN6LWSpAbtigUSvWqtnCKKTFmtDLl/XwPpKa+sWk+OCVaGCOu6e7m X-Received: by 2002:a17:906:4a47:b0:993:a396:ac64 with SMTP id a7-20020a1709064a4700b00993a396ac64mr9777615ejv.38.1689619579774; Mon, 17 Jul 2023 11:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689619579; cv=none; d=google.com; s=arc-20160816; b=D4Bei0WAxzmw1S3m6gjZSD3UVp1G0gqHACylx/BdghH6aYsvHI1Bki9G6QMohoU5rg 4wE/v4nbH/7MV6AzGKR40NO1wn2G+xnLLvf7w8iAs+4VNSp4wGYN6bhS+HAA2/Nka1lr FXVW0q8P+w1oGWI1wPpcxKQvSrGjSzizL/I75hzkudZ5E4d3IQMj7dydt3ghDvnVRbh0 97SNgX5WknLAzWY9TSszBQ6hfHdZts7kMVGxGzHGcCtxNVpG7puYdmg7uq0JPgXTRr+/ RMNnjBMTlIAclyQbif1NwCpgmqSEJGuzON6IlvuGiDgMUUEI3PJRVDVc4M6ZzMZccmUE h84g== 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=d9RjV0kfELcLr+qQ7NvYxvgDv+tVo98pt0A/SKXbB6E=; fh=Ag0RbRk3LxdpQ9OdMLAf8hbnmFe6FOAHRGAvgVTwgEc=; b=qbzuw3C2DXLJD23DpjjoW2Xi64MeemDWR6x9mNbo9WB9kFW6Ias0pKMo/wwf6CMV0F rZ91Dt77iRC8BhLNoh7rLotNqxrM5Y/kuZT6dXwZum1MgQE58I9cVV1hNBTXw9gMofbl MXYqtra3zL25oMk1rygmMq0++eMiXUE4e3eKEW/+5OIJmr0Lq8DJxdwTwzO8+S7HqAXy 7KXulW5uQ7qgaNONmvwJKrmMpo3tAUPtOnxMeP+pV30eVNKzJLW6T68PYDsJSTX2/uld RWo97NftDPLyQjxKvZODq44KGDgBXrJsORdIYaawxLg629lQHVH4sObHQw3bMq6xLpb0 9+mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EEdtDlDd; 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 fy2-20020a170906b7c200b00993181656b0si21652ejb.475.2023.07.17.11.45.54; Mon, 17 Jul 2023 11:46:19 -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=EEdtDlDd; 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 S231833AbjGQSVM (ORCPT + 99 others); Mon, 17 Jul 2023 14:21:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231720AbjGQSUv (ORCPT ); Mon, 17 Jul 2023 14:20:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9383412A; Mon, 17 Jul 2023 11:20:48 -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 297F6611F9; Mon, 17 Jul 2023 18:20:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E68BC433AB; Mon, 17 Jul 2023 18:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689618044; bh=rjWu88ZInJ4JHuHDuFwXlfJM5irHmICbqQMPaTiPJrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EEdtDlDdtsm4f4+b40C0oOQzkiSZJU0C/5DEMh5WPQ73XD56n52u3rs8cW9pvRDb7 iF9LnrMCv9gB4K3mqVpe6uvusmeOcCZ5m2QnatwWtv1Qhw0uBguiUI1Jg36qviyygR 05HTvrAk1jm6sjrJOmAiVQjL3+2Hb29TFhX4zT/pzsA4NpQj+mgiLfN8fQdsycfa9e 4O2VI/fJp+8UnPcTPGE/5Y4uXiREqdvwDCTV6GmQZaz+Vqg9ys3ZHcP3XO1fJlfvgT lQ4GHi8fFPuwNaEjGIoHUmIhSmOgXJNPfdnKqCwJLKTlhlOgt7h0M7PxflS/mP48k2 uMIu+Wkzlyz5A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 9B20ECE093C; 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, "Paul E. McKenney" Subject: [PATCH rcu 8/9] torture: Stop right-shifting torture_random() return values Date: Mon, 17 Jul 2023 11:20:41 -0700 Message-Id: <20230717182042.1098651-8-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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Now that torture_random() uses swahw32(), its callers no longer see not-so-random low-order bits, as these are now swapped up into the upper 16 bits of the torture_random() function's return value. This commit therefore removes the right-shifting of torture_random() return values. Signed-off-by: Paul E. McKenney --- kernel/torture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/torture.c b/kernel/torture.c index 92704f04a141..b59eb6048eab 100644 --- a/kernel/torture.c +++ b/kernel/torture.c @@ -95,7 +95,7 @@ int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_s ktime_t hto = baset_ns; if (trsp) - hto += (torture_random(trsp) >> 3) % fuzzt_ns; + hto += torture_random(trsp) % fuzzt_ns; set_current_state(TASK_IDLE); return schedule_hrtimeout(&hto, HRTIMER_MODE_REL); } @@ -365,7 +365,7 @@ torture_onoff(void *arg) torture_hrtimeout_jiffies(HZ / 10, &rand); continue; } - cpu = (torture_random(&rand) >> 4) % (maxcpu + 1); + cpu = torture_random(&rand) % (maxcpu + 1); if (!torture_offline(cpu, &n_offline_attempts, &n_offline_successes, &sum_offline, &min_offline, &max_offline)) -- 2.40.1