Skip to contentSkip to conversation

futex_atomic_cmpxchg_inatomic is missing

DISCUSSION Andreas Schwab 3 participants 5 messages Sep 26, 2018 – Oct 9, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

The riscv port does not define futex_atomic_cmpxchg_inatomic, but glibc is assuming that set_robust_list always works.

Andreas.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#1 lore raw
Quoted 2 lines · schwab at suse.de

The riscv port does not define futex_atomic_cmpxchg_inatomic, but glibc is assuming that set_robust_list always works.

Yes. Someone has pointed this out before, but we haven't had time to figure out the correct kernel implementation yet. Properly implementing the whole API is probably only a hundred lines of code, but any of this lock stuff is always very slow going.

Christoph published a simple Kconfig workaround a while ago to turn on the generic support for non-SMP systems, which might help you work around your issue. My plan was to construct a for-next branch over the weekend, but I managed to do so today so I might have time to take a look -- no promises, though :)

#2 lore raw
Quoted 3 lines · Palmer Dabbelt

Christoph published a simple Kconfig workaround a while ago to turn on the generic support for non-SMP systems, which might help you work around your issue.

What kind of workaround? If you disable SMP this should be automatically enabled. But of course, being non-SMP, this is also useless.

Andreas.

Signature · 3 lines
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
#3 lore raw
Quoted 9 lines · schwab at suse.de
Quoted 3 lines · Palmer Dabbelt

Christoph published a simple Kconfig workaround a while ago to turn on the generic support for non-SMP systems, which might help you work around your issue.

What kind of workaround? If you disable SMP this should be automatically enabled. But of course, being non-SMP, this is also useless.

I think we just need some sort of CONFIG_WE_HAVE_GENERIC_FUTEX_CMPXCHG_FOR_NONSMP selected by default in arch/riscv/Kconfig. I punted on it because having this support only for non-SMP systems didn't seem so useful.

#4 lore raw
In reply to Palmer Dabbelt
Quoted 5 lines · Palmer Dabbelt

Christoph published a simple Kconfig workaround a while ago to turn on the generic support for non-SMP systems, which might help you work around your issue. My plan was to construct a for-next branch over the weekend, but I managed to do so today so I might have time to take a look -- no promises, though :)

Can you pull that commit in at least? It has been dandling in various riscv tree for more than half a year now..