Date: Sun, 1 Aug 2021 23:47:35 -0400 From: Alexander Motin <mav@FreeBSD.org> To: Mateusz Guzik <mjguzik@gmail.com> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8bb173fb5bc3 - main - sched_ule(4): Use trylock when stealing load. Message-ID: <443ba55d-aff1-1f36-e3e7-00df95f4abdc@FreeBSD.org> In-Reply-To: <CAGudoHEeOZ8aSijNnyU3UU4Cb2BfTXoYiM%2BBHD-A1JgnU_OD0A@mail.gmail.com> References: <202108020258.1722walG094152@gitrepo.freebsd.org> <CAGudoHEeOZ8aSijNnyU3UU4Cb2BfTXoYiM%2BBHD-A1JgnU_OD0A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 01.08.2021 23:43, Mateusz Guzik wrote: > Mostly related, I just had a look at the code and noticed: > > static uint32_t > sched_random(void) > { > uint32_t *rndptr; > > rndptr = DPCPU_PTR(randomval); > *rndptr = *rndptr * 69069 + 5; > > return (*rndptr >> 16); > } > > Except randomval starts at 0 for all CPUs. Should be easy to pre-init > with an actual random value. Is that something you played with? It is pretty old code, so no, at least not this time. But I doubt it would make a any difference, since different CPUs should have different number of calls to this, so they should naturally run away from each-other. -- Alexander Motin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?443ba55d-aff1-1f36-e3e7-00df95f4abdc>