On Tue, Apr 26, 2016 at 07:32:39 +0100, Alex Bennée wrote: > Emilio G. Cota <c...@braap.org> writes: > > With two code_gen "halves", if two tb_flush calls are done in the same > > RCU read critical section, we're screwed. I added a cpu_exit at the end > > of tb_flush to try to mitigate this, but I haven't audited all the callers > > (for instance, what does the gdbstub do?). > > I'm not sure we are going to get much from this approach. The tb_flush > is a fairly rare occurrence its not like its on the critical performance > path (although of course pathological cases are possible).
This is what I thought from the beginning, but wanted to give this alternative a go anyway to see if it was feasible. On my end I won't do any more work on this approach. Will go back to locks, despite Paolo's (justified) dislike for them =) > > If we end up having a mechanism to "stop all CPUs to do something", as > > I think we'll end up needing for correct LL/SC emulation, we'll probably > > be better off using that mechanism for tb_flush as well -- plus, we'll avoid > > wasting memory. > > I'm fairly certain there will need to be a "stop everything" mode for > some things - I'm less certain of the best way of doing it. Did you get > a chance to look at my version of the async_safe_work mechanism? Not yet, but will get to it very soon. Cheers, Emilio