elehcim / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

futex handling is weird (and wrong on arm) #693

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The existing handling of futexes is massively out of date. Notably, you're 
calling sys_futex with four args, when all modern Linux instances expect six. 
You're also disabling futexes entirely on ARM, when futexes work fine there.

Attached is a patch to drop mentions of sys_futex1, to change sys_futex to a 
six arg syscall, and to use futex on ARM (tested on a cubietruck). Thanks to 
Paolo Bonzini <pbonzini@redhat.com> for making the patch.

Original issue reported on code.google.com by spo...@gmail.com on 9 Jun 2015 at 9:42

Attachments:

GoogleCodeExporter commented 9 years ago
It's more than just weird. It's pretty suboptimal in many case.

The only thing that prevents me from just dropping it is that it's fast-path is 
inlined. Unlike with pthread_{lock,unlock}.

If you know of any library/code that has inlined and quick fastpath but correct 
and well polished and robust slow path (just like in glibc's 
pthread_lock/unlock), please share.

Thanks for the patch.

I'd prefer patch in git format-patch format. So that I can preserve your 
authorship. I'll wait one week and merge patch in it's current form unless you 
send me improved version.

Original comment by alkondratenko on 14 Jun 2015 at 4:34

GoogleCodeExporter commented 9 years ago
Thanks. Applied.

Original comment by alkondratenko on 28 Jun 2015 at 4:28