[compiler-rt] Revert "[scudo] Use getMonotonicTimeFast for tryLock." (PR #86590)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 11:29:51 PDT 2024


ChiaHungDuan wrote:

> > > We could also continue to use this function if we did a right shift to get better resolution.
> > > However, I'm not sure that using a random seed here make a lot of sense. It almost might be better to just use a round-robin especially when there are only two TSDs.
> > > But that requires more experimentation.
> > 
> > 
> > In this case, for example, `getMonotonicTimeFast()` in the interval of 0~4 ms returns the same value, so the shifting still gives the same value. I did some experiments with different strategies, it has very small improvements but I think it's still worth of adopting new algorithm.
> 
> Yeah, I'm not sure what the original intent of making this random was. I don't think it makes anything more secure doing this, especially if there are only two TSDs. The more TSDs there are, then doing something more random is probably a better strategy, so whatever we do might need to incorporate the number of TSDs.

Agree, let's do it in a follow up CL

https://github.com/llvm/llvm-project/pull/86590


More information about the llvm-commits mailing list