• No results found

Trivial Token Lock for S-Aware Analysis

In document Ward_unc_0153D_16612.pdf (Page 84-86)

Chapter 3: Real-Time Nested Locking Protocol ( RNLP )

3.4 Token Locks

3.4.3 Trivial Token Lock for S-Aware Analysis

The token locks discussed above lead to asymptotically optimal implementations under spin-based or s-oblivious analysis. However, these locking protocols do not perform well under s-aware analysis. Under s-aware analysis, it is best to chooseT =nto allow for maximal concurrency, thus the TTL is used. From the TTL, we have the following lemma.

Lemma 3.11. The TTL satisfies Properties T1 and T2.

Proof. By the assumption thatT =n, and the fact that each job can hold at most one token, Property T1 is satisfied. Because there is a token per job, there is no blocking waiting for a token, and therefore Property T2 holds vacuously.

Next we consider pairing the TTL with several of the RSMs previously presented. B-RSM. We pair the TTL with the B-RSM under partitioned scheduling.

Theorem 3.6. On a partitioned system, the maximum duration of s-aware pi-blocking per outermost resource request is(n1)Lmaxunder the B-RSM and TTL.

Proof. Follows from Theorem 3.1 andT =n.

Under s-aware analysis we must carefully consider the pi-blocking boosting itself may cause.

Theorem 3.7. Letnp be the number of tasks assigned toJi’s partition. The worst-case s-aware progress- mechanism-related pi-blocking of jobJicaused by the boosting of other jobs in the B-RSM is(np−1)Lmax. Proof. In the worst case, all requests are serialized by the B-RSM, as any concurrency would decrease s-aware pi-blocking. In this case, the blocking behavior is the same as theFMLP+ (Brandenburg, 2011) because both the B-RSM and theFMLP+employ unrestricted priority boosting. Thus, the bound follows directly from the bound for theFMLP+in Theorem 6.4 of (Brandenburg, 2011).

Note that the progress-mechanism-related and per-request pi-blocking are bothO(n)(Theorems 3.7, and 3.1, respectively) for the pairing of the TTL and the B-RSM. Given the s-aware lower bound ofΩ(n) discussed in Chapter 2, theRNLPwith the TTL and B-RSM is asymptotically optimal for partitioned systems.

RSB-RSM. The RSB-RSM can be used to construct optimalRNLPvariants under partitioned, clustered, and global scheduling when paired with the TTL andT =n. Notably, when using the TTL, the timestamp of token acquisition is also the request-segment start time, because there is no blocking for tokens.

Theorem 3.8. On partitioned, clustered, and globally scheduled systems, the maximum duration of s-aware pi-blocking per outermost resource request is(n−1)Lmaxunder the RSB-RSM and TTL.

Proof. In the worst case, all requests execute serially by Rule RSB1, because only one request can be boosted at a time. Thus, the bound follows directly from Theorem 3.1 andT =n.

The co-boosting required by Rule RSB2, which is derived from theFMLP+(Brandenburg, 2014), is used to ensure smaller progress-mechanism-related pi-blocking bounds. In particular, co-boosting ensures the following property.

Lemma 3.12. (Brandenburg, 2014, Lemma 13)Let[t0,t1]denote an independent segment of jobJi. During [t0,t1],Jiincurs s-aware pi-blocking for the cumulative duration of at most one critical section per each other task in its cluster.

Theorem 3.9. The worst-case s-aware progress-mechanism-related pi-blocking per job caused by the TTL and the RSB-RSM under partitioned, clustered, or global scheduling isO(n).

Proof. Consider a jobJiin clusterk. Letnkdenote the number of tasks in clusterk. By Lemma 3.12, each independent segment may experiencenk1 critical sections of progress-mechanism-related pi-blocking. The number of independent segments per job Ji is a constant (Ni+1), and therefore the total s-aware progress-mechanism-related pi-blocking isO(n).

Priority inheritance. Priority inheritance is only applicable on globally scheduled systems and in general it has the sameΩ(φ)s-aware pi-blocking bound as priority boosting (Brandenburg, 2011), as was discussed

in Chapter 2. It is therefore preferable in most cases to use RSB under s-aware analysis instead of priority inheritance. However, underG-FPscheduling, as well asconstrained, fixed priority-point schedulers(e.g., FIFO, andG-EDFwith relative deadlines at most periods), a special class of JLFP schedulers in which each task’srelative priority pointdoes not exceed its period, priority inheritance yields an asymptotically optimal locking protocol.

Theorem 3.10. The worst-case s-aware progress-mechanism-related pi-blocking per job caused by the TTL and I-RSM under eitherG-FPor any constrained, fixed priority-point global scheduler isO(n).

Proof. In the worst case, all requests are serialized by the I-RSM as any concurrency would decrease s-aware pi-blocking. In this case, the I-RSM is equivalent to theFMLP. From (Brandenburg, 2011), the maximum s-aware pi-blocking caused by priority inheritance isO(n)forG-FPand constrained, fixed priority-point global schedulers.

Theorem 3.11. The maximum duration of s-aware pi-blocking per outermost resource request is(n1)Lmax under the TTL and I-RSM.

Proof. Follows from Theorem 3.1 andT =n.

Note that asymptotically, theRNLPperforms no worse than any existing locking protocols under s-aware analysis. However, the increased concurrency afforded by the RSM leads to improved s-aware pi-blocking in practice.

3.5 Dynamic Group Locks

In the preceding discussion, fine-grained locking was supported through nested locking. Next, we present dynamic group locks(DGLs), as an alternative technique to support fine-grained locking.

In document Ward_unc_0153D_16612.pdf (Page 84-86)