Re: [PATCH v3 1/3] KVM: selftests: Implement random number generation for guest code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ricardo Koller <ricarkol@xxxxxxxxxx> writes:

On Thu, Sep 01, 2022 at 07:52:35PM +0000, Colton Lewis wrote:
+
+/* Park-Miller LCG using standard constants */
+static uint32_t perf_test_random(uint32_t seed)
+{
+	return (uint64_t)seed * 48271 % ((uint32_t)(1 << 31) - 1);
+}

Nit: I would prefer moving this to include/kvm_test_util.h, maybe
something like: get_next_random(seed). There could be other users of
this.


Agree this might be useful elsewhere. Whoever needs it can move it to
the common header then.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux