Parameterized Verification of Deadlock Freedom in Symmetric Cache - - PowerPoint PPT Presentation

parameterized verification of deadlock freedom in
SMART_READER_LITE
LIVE PREVIEW

Parameterized Verification of Deadlock Freedom in Symmetric Cache - - PowerPoint PPT Presentation

Parameterized Verification of Deadlock Freedom in Symmetric Cache Coherence Protocols Brad Bingham 1 Jesse Bingham 2 Mark Greenstreet 1 1 University of British Columbia, Canada 2 Intel Corporation, U.S.A. November 2, 2011 FMCAD Outline What is


slide-1
SLIDE 1

Parameterized Verification of Deadlock Freedom in Symmetric Cache Coherence Protocols

Brad Bingham1 Jesse Bingham2 Mark Greenstreet1

1University of British Columbia, Canada 2Intel Corporation, U.S.A.

November 2, 2011 FMCAD

slide-2
SLIDE 2

Outline

1

What is Deadlock-Freedom?

2

Mixed Abstractions for Parameterized Systems

3

Tightening Mixed Abstractions

4

Results

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 2 / 20

slide-3
SLIDE 3

The Problem: Deadlock-Freedom

reachable quiescent init

“Is it deadlock-free?” ≡ “Is there a path from each reachable state to a quiescent state?”

“quiescent” ≡ “nothing is pending” In CTL: AG EF q (more generally, AG (p → EFq)) Cheap to model check; rules out some liveness bugs; avoids fairness

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 3 / 20

slide-4
SLIDE 4

Overview: Parameterized Systems

A system S = (S, I, T) is a tuple of states S, initial states I and transitions T A parameterized system is a mapping from the naturals to systems. S(N) = (S(N), I(N), T(N)).

In cache coherence protocols, the parameter might correspond to “number of caches”, “number of address”, “length of some buffer”,

  • etc. In our examples, it’s “number of caches”.

Verifying a safety property of S(N) for all N is algorithmically undecidable. Previous work addresses this problem. One promising approach is based on compositional reasoning (CEGAR + Human Ingenuity).

[McMillan99], [Chou+04], [O’Leary+09]

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 4 / 20

slide-5
SLIDE 5

Parameterized Cache

cache 2 cache N Interconnect Symmetric directory cache 1

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 5 / 20

slide-6
SLIDE 6

Parameterized Cache Abstraction

cache 2 Interconnect "Others" directory cache 1 Overapproximates behavior of caches 3, ..., N; no local state

Finite-state, overapproximate abstraction of S(N) for all N > 2 Suitable for model checking

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 6 / 20

slide-7
SLIDE 7

Abstraction Relation

Reachable states: Reachable states:

Abstract System A Concrete System S(N)

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 7 / 20

slide-8
SLIDE 8

Abstraction Relation

concretization

Reachable states: Reachable states:

Concrete System S(N) Abstract System A

Overapproximation:

Abstraction allows us to infer concrete safety properties

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 7 / 20

slide-9
SLIDE 9

Abstraction Relation

1 1 2 3 2 3

concretization

Reachable states: Quiescent states: Reachable states: Quiescent states:

Concrete System S(N) Abstract System A

Overapproximation:

Abstraction allows us to infer concrete safety properties × Cannot infer concrete deadlock-freedom properties

Paths don’t (necessarily) concretize

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 7 / 20

slide-10
SLIDE 10

Underapproximate Transitions

Suppose (s, s′) is an abstract transition where every reachable state in the concretization of state s has a path to some state in the concretization of state s′. This transition is called underapproximate.

Reachable states: Reachable states:

Concrete System S(N) Abstract System A underapprox concretization concretization s s′

Overapproximation: Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 8 / 20

slide-11
SLIDE 11

Mixed Abstraction

A Mixed Abstraction[LT88][Dams+97] is like an abstract transition system, but has two sets of transitions: overapproximate (O) and underapproximate (U). Model checking AG(p → EF q) in mixed abstraction M: for each O-reachable p-state, find a U-path to some q-state.

U s’ O O

U−path

O

O−path

U s initial state p−state q−state

Theorem

If M | = AG(p → EF q), then S(N) | = AG(p → EF q).

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 9 / 20

slide-12
SLIDE 12

Insufficiency

What if model checking fails?

U no U transitions out of s’ NOT a q−state; s’ O O

U−path

O

O−path

initial state s p−state U

1

Perhaps O is too weak

State s has no reachable concretization in S(N) Remedied by strengthening O (covered by previous literature in parameterized safety)

2

Perhaps U is too strong

A U-path from s gets “stuck” before a q-state is reached Proving that transitions are underapproximate is not addressed by extensive previous work; this is our focus

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 10 / 20

slide-13
SLIDE 13

Strategy

Assume a symmetric, parameterized system S(N) expressed with guarded commands (or “rules”); assume an overapproximate abstraction of S(N)

Some restrictions to syntactic form

Use the abstraction as a starting point for the mixed abstraction Approach: Use syntactic analysis to find “trivially” underapproximate transitions U Then: Prove selected guarded commands of O are in fact underapproximate by leveraging symmetry and model checking the mixed abstraction.

The approach depends on the syntactic form of the rule All of our methods rely on “path symmetry”

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 11 / 20

slide-14
SLIDE 14

Concrete States

global boolean variables ranging over {T, F}

× × × × L[N] × L[1] L[2] × G P L[3]

L[i] symmetric local variables ranging over {T, F} parametric variables, ranging over {1, 2, ..., N}

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 12 / 20

slide-15
SLIDE 15

Abstract States

HIDDEN

global boolean variables ranging over {T, F}

× × × × L[N] × L[1] L[2] × G P L[3]

L[i] symmetric local variables ranging over {T, F} parametric variables, ranging over {1, 2, Other} {1, 2, ..., N}

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 13 / 20

slide-16
SLIDE 16

(Symmetric) Guarded Commands

× × × × × L[2] L[3] L[N] × G ∈ A L[1] ∈ B ptr = 1

⇒ Command Guard

× × × × × L[2] L[3] ∈ B L[N] × G ∈ A L[1] ptr = 3 × × × × × L[2] L[N] × G′ ptr = 3 rule r3 fires L[1] L′[3] × × × × × L[2] L[3] L[N] × G′ L′[1] ptr = 1 rule r1 fires

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 14 / 20

slide-17
SLIDE 17

(Symmetric) Guarded Commands

HIDDEN BY ABSTRACTION

× × × × × L[2] L[3] L[N] × G ∈ A L[1] ∈ B ptr = 1 × × × × × L[2] L[N] × G′ L[1] L′[3] × × × × × L[2] L[3] ∈ B L[N] × L[1] ptr = 3 ptr = 3 × × × × × L[2] L[3] L[N] × G′ L′[1] ptr = 1 rule r3 fires G ∈ A rule r1 fires underapprox! not sure...

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 14 / 20

slide-18
SLIDE 18

Abstracted Local State: L[ptr] ∈ B ∧ G ∈ A

× × × × × L[2] L[3] ∈ B L[N] × L[1] G ∈ A × × × × × L[2] L[N] × G′ L[1] L′[3] ptr = 3 ptr = 3 rule r3 fires

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 15 / 20

slide-19
SLIDE 19

Abstracted Local State: L[ptr] ∈ B ∧ G ∈ A

HIDDEN BY ABSTRACTION

× × × × × L[2] L[3] ∈ B L[N] × L[1] G ∈ A × × × × × L[2] L[N] × G′ L[1] L′[3] ptr = 3 ptr = 3 × × × × × L[2] L[N] L[1] G ∈ A × ptr = 3 L[3] / ∈ B indistinguishable in abstraction rule r3 fires

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 15 / 20

slide-20
SLIDE 20

Abstracted Local State: L[ptr] ∈ B ∧ G ∈ A

HIDDEN BY ABSTRACTION

× × × × × L[2] L[3] ∈ B L[N] × L[1] G ∈ A × × × × × L[2] L[N] × G′ L[1] L′[3] ptr = 3 ptr = 3 × × × × × L[2] L[N] L[1] G ∈ A × ptr = 3 ptr = 1 ptr = 1 L[3] / ∈ B path symmetry × × × × G ∈ A × L[2] L[3] L[N] × L[1] × × × × G ∈ A L[2] L[3] L[N] × L[1] ∈ B × Model Checking Mixed Abstraction indistinguishable in abstraction implied path rule r3 fires

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 15 / 20

slide-21
SLIDE 21

Abstracted Universal Quantifier: G ∈ A ∧ ∀i. L[i] ∈ B

× × × × G ∈ A × L[2] ∈ B L[3] ∈ B L[N] ∈ B × P L[1] ∈ B r1 fires × × × × G′ × L[2] L[1] L[N] × P L[3]

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 16 / 20

slide-22
SLIDE 22

Abstracted Universal Quantifier: G ∈ A ∧ ∀i. L[i] ∈ B

HIDDEN BY ABSTRACTION

× × × × G ∈ A × L[2] ∈ B × × × × × G ∈ A × L[2] ∈ B L[3] ∈ B L[N] ∈ B × P L[1] ∈ B r1 fires L[1] ∈ B P × × × × G′ × L[2] L[1] L[N] × P L[3] L[N] / ∈ B L[3] / ∈ B indistinguishable in abstraction

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 16 / 20

slide-23
SLIDE 23

Abstracted Universal Quantifier: G ∈ A ∧ ∀i. L[i] ∈ B

HIDDEN BY ABSTRACTION

× × × × G ∈ A × L[2] ∈ B × × × × × G ∈ A × L[2] ∈ B L[3] ∈ B L[N] ∈ B × P L[1] ∈ B r1 fires L[1] ∈ B P × × × × G′ × L[2] L[1] L[N] × P L[3] × × × × G ∈ A × L[2] L[3] L[N] × P L[1] × × × × G ∈ A L[2] L[3] L[N] × P L′[1] ∈ B × L[N] / ∈ B L[3] / ∈ B indistinguishable in abstraction Model Checking Mixed Abstraction path symmetry implied path

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 16 / 20

slide-24
SLIDE 24

Case Studies

German and Flash cache coherence protocols Proved “For any number of caches, the system can always clear the communication channels and directory is not in a waiting state” Overapproximate transitions from Murϕ models of strengthened abstractions borrowed from [Chou+04] Underapproximate transitions proven “on-demand”

Some transitions are trivially underapproximate by syntactic analysis Others are proven underapproximate with our methods, when the model checker indicates a rule will help, i.e., enabled transitions of O at s′

U no U transitions out of s’ NOT a q−state; s’ O O

U−path

O

O−path

initial state s p−state U

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 17 / 20

slide-25
SLIDE 25

Automation?

Can this process be automated? YES: Detection of a “useful” rule to prove underapproximate YES: Application of model checking for the appropriate reasoning (depends on the form of the guard) UNSURE: What to do if our tricks fail HOWEVER: When our tricks don’t work, it’s a sign that the rule may NOT be underapproximate. WHAT THEN?: Perform some manual strengthening similar to previous work!

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 18 / 20

slide-26
SLIDE 26

Future Work

Automation: As mentioned, in a theorem proving environment.

Automatically extract from O the weakest U supported by our methods

Other Problems: Parameterize over addresses? (OpenSPARC)

Still symmetric, but guards of rules take different syntactic form

Other Properties: Consider request req and response resp:

Prove “When req is outstanding, there exists a path to resp” AG(req-pend → EFresp)

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 19 / 20

slide-27
SLIDE 27

Wrap-Up

Presented a tractible method for proving parameterized deadlock-freedom Builds directly on previous work in parameterized safety ([McMillan99,Chou+04]) Expectation: Method offers low-hanging deadlock-freedom result following application of these methods, leveraging a tight

  • verapproximation

Thank-you! Questions?

Bingham, Bingham, Greenstreet (UBC, Intel) Parameterized Deadlock Freedom November 2011 20 / 20