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 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.

    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.

    Alan

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