Re: [PATCH 11/18] seqcount: Introduce raw_write_seqcount_barrier()
From: Ingo Molnar
Date: Thu Jun 18 2015 - 05:40:29 EST
* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > > I doubt there's a single OS kernel (that supports SMP configurations) that
> > > does not rely on a whole host of 'undefined' behaviour.
> >
> > An alternative approach would be a compiler switch (or similar) that changed
> > the default atomic access from SC to relaxed. Then shared variables could be
> > marked atomic, and normal C code could be used to access them, but without the
> > compiler emitting memory barriers all over the place (yes, even on x86).
>
> See, I don;'t think that is a realistic approach. Who is going to audit our ~16
> million lines of code to mark all shared variables? Or all the other existing
> code bases that rely on this behaviour?
Sidenote: we are well beyond 19 million lines meanwhile.
But generating speculative writes unless the compiler can prove it's not shared
memory are crazy. Who on earth argues they are sane?
In what retarded use-case do unasked for speculative writes even make any sense
beyond as a sadistic tool to make parallel, threaded code even more fragile??
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/