Re: Linux futexes
On Sat, Jul 27, 2019 at 06:05:25AM -0700, Jason Thorpe wrote: > > > > On Jul 27, 2019, at 5:05 AM, Robert Swindells wrote: > > > > > > I don't think the Linux futex emulation code is correct/good enough. > > I have be on/off working on an updated futex implementation written by > Taylor, with the intent of making it a native call (in order to improve or > own semaphore and mutex implementations). You are correct in that the > current implementation is lacking. > > I will try to focus on finishing up the new implementation soon. But even > the stuff written by Taylor is a little lacking compared to what modern Linux > uses futexes for, so some additional work is going to be required. > Hi jason, it's probably good practice to share your own code in these circumstances. I believe it's https://github.com/thorpej/netbsd-src/tree/trc-jrt-futex
Re: Linux futexes
But glibc might be using the PI operations, which we don’t implement yet. -- thorpej Sent from my iPhone. > On Jul 27, 2019, at 7:51 AM, Robert Swindells wrote: > > > Jason Thorpe wrote: >>> On Jul 27, 2019, at 5:05 AM, Robert Swindells wrote: >>> >>> I don't think the Linux futex emulation code is correct/good enough. >> >> I have be on/off working on an updated futex implementation written by >> Taylor, with the intent of making it a native call (in order to improve >> or own semaphore and mutex implementations). You are correct in that >> the current implementation is lacking. >> >> I will try to focus on finishing up the new implementation soon. But >> even the stuff written by Taylor is a little lacking compared to what >> modern Linux uses futexes for, so some additional work is going to be >> required. > > Linux OpenJDK isn't using any extra futex features, it isn't using a > bitmask to selectively wake up threads for example, it just seems to > get into a loop of waking threads up then all of them going back to > sleep. > > Robert Swindells
Re: Linux futexes
Jason Thorpe wrote: >> On Jul 27, 2019, at 5:05 AM, Robert Swindells wrote: >> >> I don't think the Linux futex emulation code is correct/good enough. > >I have be on/off working on an updated futex implementation written by >Taylor, with the intent of making it a native call (in order to improve >or own semaphore and mutex implementations). You are correct in that >the current implementation is lacking. > >I will try to focus on finishing up the new implementation soon. But >even the stuff written by Taylor is a little lacking compared to what >modern Linux uses futexes for, so some additional work is going to be >required. Linux OpenJDK isn't using any extra futex features, it isn't using a bitmask to selectively wake up threads for example, it just seems to get into a loop of waking threads up then all of them going back to sleep. Robert Swindells
Re: Linux futexes
> On Jul 27, 2019, at 5:05 AM, Robert Swindells wrote: > > > I don't think the Linux futex emulation code is correct/good enough. I have be on/off working on an updated futex implementation written by Taylor, with the intent of making it a native call (in order to improve or own semaphore and mutex implementations). You are correct in that the current implementation is lacking. I will try to focus on finishing up the new implementation soon. But even the stuff written by Taylor is a little lacking compared to what modern Linux uses futexes for, so some additional work is going to be required. > > Trying to use Linux OpenJDK 11 to compile itself it stops making > any progress fairly quickly with all threads blocked waiting on > a futex. > > Also seen with the installer for the latest Xilinx Vivado FPGA tools, > the UI stops responding to mouse clicks after one action has been > selected. > > Robert Swindells > > > > -- thorpej
Linux futexes
I don't think the Linux futex emulation code is correct/good enough. Trying to use Linux OpenJDK 11 to compile itself it stops making any progress fairly quickly with all threads blocked waiting on a futex. Also seen with the installer for the latest Xilinx Vivado FPGA tools, the UI stops responding to mouse clicks after one action has been selected. Robert Swindells