tech-kern archive

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

Re: compat linux futex problem



Hi,

On 2015/10/29 21:59, Christos Zoulas wrote:
> In article <20151029002500.7A35630285B%ren.fdy2.co.uk@localhost>,
> Robert Swindells  <rjs%fdy2.co.uk@localhost> wrote:
>>
>> I'm trying to run a fairly large Linux application that is a mixture of
>> Java and native code, it spawns off several threads but all of them
>> end up waiting on futex and not using any cpu time.
>>
>> I have run it with DEBUG_LINUX_FUTEX enabled which produces a *lot* of
>> debug, anybody got any idea what to look for in it ?
> 
> I think that the FreeBSD futex code is much more complete than ours. Perhaps
> we should replace ours with theirs...

Comments in sys/compat/linux/common/linux_futex.c read as follows.

 * Our implementation provides only private futexes. Most of the apps
 * should use private futexes but don't claim so. Therefore we treat
 * all futexes as private by clearing the FUTEX_PRIVATE_FLAG. It works
 * in most cases (ie. when futexes are not shared on file descriptor
 * or between different processes).

If the application lunches not only threads, but also different processes,
our implementation may not work.

At first sight, FreeBSD seems to support shared futexes:
  https://svnweb.freebsd.org/base/head/sys/compat/linux/linux_futex.c?view=markup#l682

Rin


Home | Main Index | Thread Index | Old Index