Re: PATCH libatomic

2020-05-08 Thread Martin Husemann
On Fri, May 08, 2020 at 10:24:43PM +, m...@netbsd.org wrote: > The indirection only applies to the first call. The magic is within > rtld. You are comparing PLT calls with ifunc (where even normal PLT calls have initial resolution overhead, but very tiny - while ifuncs may have arbitrary first

Re: PATCH libatomic

2020-05-08 Thread Thor Lancelot Simon
On Fri, May 08, 2020 at 10:24:43PM +, m...@netbsd.org wrote: > > The indirection only applies to the first call. The magic is within > rtld. If it's not binary patch, no magic can avoid at least one level of indirection. -- Thor Lancelot Simon t...@p

Re: PATCH libatomic

2020-05-08 Thread maya
On Fri, May 08, 2020 at 06:23:01PM -0400, Thor Lancelot Simon wrote: > On Fri, May 08, 2020 at 10:03:06AM +0200, Kamil Rytarowski wrote: > > On 08.05.2020 02:14, Thor Lancelot Simon wrote: > > > > > > Not without performance penalty for every atomic operation, unless you > > > propose > > > to do

Re: PATCH libatomic

2020-05-08 Thread Thor Lancelot Simon
On Fri, May 08, 2020 at 10:03:06AM +0200, Kamil Rytarowski wrote: > On 08.05.2020 02:14, Thor Lancelot Simon wrote: > > > > Not without performance penalty for every atomic operation, unless you > > propose > > to do this by binary patch as is done in the kernel. > > There is atomic penalty, but

Re: PATCH libatomic

2020-05-08 Thread maya
On Fri, May 08, 2020 at 04:09:02PM +0200, Kamil Rytarowski wrote: > I object to opinions that libatomic is generally broken, if that would > be the cause, it wouldn't be available and used on relatively all > relevant generic purpose Operating Systems. Personally, I already > received last year a f

Re: PATCH libatomic

2020-05-08 Thread Kamil Rytarowski
On 08.05.2020 14:44, Martin Husemann wrote: > On Fri, May 08, 2020 at 02:26:45PM +0200, Kamil Rytarowski wrote: >> With _Atomic() we can mark any arbitrary struct to have serialized >> accesses. As I said, with your attitude we shall remove FPU support (and >> softfloat) as they are not async safe,

Re: PATCH libatomic

2020-05-08 Thread Joerg Sonnenberger
On Fri, May 08, 2020 at 02:44:14PM +0200, Martin Husemann wrote: > On Fri, May 08, 2020 at 02:26:45PM +0200, Kamil Rytarowski wrote: > > With _Atomic() we can mark any arbitrary struct to have serialized > > accesses. As I said, with your attitude we shall remove FPU support (and > > softfloat) as

Re: PATCH libatomic

2020-05-08 Thread Martin Husemann
On Fri, May 08, 2020 at 02:26:45PM +0200, Kamil Rytarowski wrote: > With _Atomic() we can mark any arbitrary struct to have serialized > accesses. As I said, with your attitude we shall remove FPU support (and > softfloat) as they are not async safe, not safe in virtualization for > MMU accesses an

Re: PATCH libatomic

2020-05-08 Thread Kamil Rytarowski
On 08.05.2020 14:12, Joerg Sonnenberger wrote: > On Thu, May 07, 2020 at 11:09:03PM +0200, Kamil Rytarowski wrote: >>> (1) They introduce non-trivial blocking conditions, often defeating the >>> reason for using atomics in first place. >>> (2) They don't work in a constrained environment and are br

Re: PATCH libatomic

2020-05-08 Thread Joerg Sonnenberger
On Thu, May 07, 2020 at 10:49:39PM +, m...@netbsd.org wrote: > I am under the impression that (at least GCC) compilers will not emit > intrinsic calls if they are guaranteed to be available on the target. This is true, but only a minor complication compared to the rest. Joerg

Re: PATCH libatomic

2020-05-08 Thread Joerg Sonnenberger
On Thu, May 07, 2020 at 11:09:03PM +0200, Kamil Rytarowski wrote: > > (1) They introduce non-trivial blocking conditions, often defeating the > > reason for using atomics in first place. > > (2) They don't work in a constrained environment and are broken by > > common UNIX primitives like memory ma

Re: PATCH libatomic

2020-05-08 Thread Kamil Rytarowski
On 08.05.2020 02:14, Thor Lancelot Simon wrote: > On Fri, May 08, 2020 at 01:51:16AM +0200, Kamil Rytarowski wrote: >> A runtime detection could be a part of ifunc (is it ready for NetBSD?). >> >> The standard C/C++ feature is to detect whether atomic operations are >> real (lock-free) through atom