lkml.org 
[lkml]   [2018]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: LKMM litmus test for Roman Penyaev's rcu-rr
On Mon, Jun 04, 2018 at 10:17:47AM -0400, Alan Stern wrote:
> On Sat, 2 Jun 2018, Paul E. McKenney wrote:
>
> > One crude but effective workaround is to replicate the code following the
> > "if" statement into both legs of the "if" statement. This has the effect
> > of extending the control dependency to cover all of the code that used to
> > follow the "if" statement, leveraging herd's current limited knowledge of
> > compiler optimization. This workaround would of course be hopeless for
> > general Linux-kernel code, but should be at least semi-acceptable for the
> > very small snippets of code that can be accommodated within litmus tests.
> >
> > Please see the litmus test shown below, which uses this workaround,
> > allowing the smp_store_release() to be downgraded to WRITE_ONCE().
> >
> > Given this workaround, crude though it might be, I believe that we can
> > take a more measured approach to identifying a longer-term solution.
> >
> > Thoughts?
>
> Yes, this works, although it is clearly just a stopgap. And obviously
> it can't be applied in situations where one of the legs of the "if"
> statement contains a non-trivial branch.

A non-trivial branch as in a goto? If so, that could be problematic
depending on exactly what herd does in that case.

> In the long run, I don't think this problem is solvable. At least, not
> for all cases. It requires too much guesswork about what optimizations
> a compiler might do.

I agree that it cannot be perfect, but I bet that we can come extremely
close. But yes, we need to think carefully about nested "if" statements
at the very least. And there might well be some other way to get in
trouble. ;-)

Thanx, Paul

\
 
 \ /
  Last update: 2018-06-04 18:01    [W:2.439 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site