On 2015-12-04 at 16:36 Barret Rhoden <[email protected]> wrote:
> The MCS-PDR locks have an optimization built in where most vcores
> ensure the lockholder runs.  The other style is to ensure whoever is
> directly ahead in line (the predecessor) runs, which we fall back to
> in some tricky corner cases.  That all is fine.
> 
> In the unlock case, the lockholder needs to ensure whoever is next in
> line runs (the lockholder's successor).  Waiting on a_tail requires
> that everyone in line is ensuring their predecessor runs, which is
> not what happens by default.  By clearing the lockholder_vcoreid, we
> can fall back to this "get out of corner cases by following the
> chain" approach.
> 
> I've been chasing this one off and on for a couple years.  I managed
> to recreate it once or twice and was able to peak at the userspace
> contexts. I could see all but one of them were calling
> ensure_vcore_runs(2), and VC 2 was calling ensure_vcore_runs(1).  Two
> other vcores were preempted.  I could see VC 2 was in an unlock.
> There were no syscalls coming from that process.
> 
> It was actually simple after that.  What happened was that a vcore
> signed up for the lock (L391), but hadn't set pred->next yet (L396).
> Then it gets preempted.  VC 2 was its pred, and it acquired the lock
> with no issues. When it went to unlock, it needed to ensure it's
> successor was running.  VC 2 was the lockholder_vcoreid.  Everyone in
> the chain behind the preempted VC kept ensuring 2 ran.  No one
> ensured the preempted VC ran.
> 
> Signed-off-by: Barret Rhoden <[email protected]>


Merged to master at a919327b0860..41e798408dfc (from, to]

You can see the entire diff with 'git diff' or at
https://github.com/brho/akaros/compare/a919327b0860...41e798408dfc

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to