Introduction
Paging is one of the most fundamental problems in online computation. In weighted paging, a cache holds up to k k k of n n n pages, and a requested page that is not in the cache must be fetched, at a cost equal to its weight, while another page is evicted. Classical paging requires every request to be served immediately. In many applications of caching, however, requests can wait for some time, for example in prefetching, cloud computing, or video-on-demand streaming. An algorithm can then save cost by batching requests to the same page instead of fetching it repeatedly. In paging with deadlines , waiting is free, but every request must be served by its deadline. More generally, in paging with delay , every request accrues delay cost until it is served, and the goal is to minimize the total fetch cost plus delay cost. Paging with delay belongs to an active line of work on online problems with delay, including TCP acknowledgment [13 ] , matching [14 ] , online service with delay [3 ] , multi-level aggregation [7 , 11 ] , and network design [1 , 2 ] .
When all pages have the same weight, delay does not make paging harder, since unweighted paging with delay reduces to classical paging [3 ] . For general weights, however, the best known randomized algorithm, due to Gupta, Kumar, and Panigrahi, is O ( log k log n ) O(\log k \log n) O ( log k log n ) -competitive [17 ] , where the number n n n of pages can be much larger than k k k . Without delay, the optimal competitive ratio of randomized algorithms is Θ ( log k ) \Theta(\log k) Θ ( log k ) [15 BNV07] , and the lower bound carries over to paging with delay. The factor log n \log n log n comes from one step of the LP-based approach of Gupta, Kumar, and Panigrahi. The natural relaxation over fractional cache states has integrality gap Ω ( k ) \Omega(k) Ω ( k ) , and Gupta, Kumar, and Panigrahi circumvent this with a hitting-set relaxation that records when pages are fetched and evicted, but not the cache contents. This requires a separate step that decides online which pending requests to serve and when, which costs only a constant factor offline, but a factor log n \log n log n online. They leave closing the gap to the lower bound as an open problem [17 ] .
We give an O ( log k ) O(\log k) O ( log k ) -competitive randomized algorithm for weighted paging with delay, in the same clairvoyant model as [17 ] . This matches the lower bound, does not depend on n n n , and also applies to deadlines. Hence, weighted paging with delay is as hard as without delay, up to constant factors. For deterministic algorithms, this was already known, with optimal competitive ratio Θ ( k ) \Theta(k) Θ ( k ) [ST85; CL91; Aza+21]. We establish the same equivalence for randomized algorithms, where the optimal competitive ratio is Θ ( log k ) \Theta(\log k) Θ ( log k ) .
Our algorithm combines mirror descent , used by Bubeck et al. for classical weighted paging [9 ] , with preemptive service , a standard tool for online service with delay [3 ] . With delay, the potential function in the analysis of mirror descent can increase when we serve a request, because Opt may serve the same request at another time than we do. We compensate for this increase by preemptive service: when serving a request, we also serve other pending requests, with a budget derived from the mirror descent path. To our knowledge, this is the first use of mirror descent for a problem with delay. Since the fractional cache states of our algorithm also determine when requests are served, no separate step has to decide this, and the classical online rounding for weighted paging [4 ] applies with only a constant loss.
We state our result formally below, and outline our technique in § 1.2 .
Our results
We give a randomized algorithm for weighted paging with delay with tight competitive ratio that, in particular, does not depend on the number n n n of pages.
Theorem 1. There exists a clairvoyant randomized online algorithm for weighted paging with delay with competitive ratio O ( log k ) O(\log k) O ( log k ) .
Together with the lower bound of Ω ( log k ) \Omega(\log k) Ω ( log k ) from classical paging [15 ] , this gives a tight bound on the competitive ratio of randomized weighted paging with delay and deadlines. We obtain this result by combining the mirror descent technique from [9 ] for classical paging with a preemptive service approach typical for online service with delay [3 ] . The resulting algorithm PMD is explicit (Algorithm 1) and handles delay directly, with three rules: when to serve (once the delay of a page is large compared to the cost of serving it), how to serve (along a mirror descent path in closed form), and what else to serve (pending requests in order of urgency, paid from budgets).
Technique
Fractional model. Instead of defining a randomized algorithm for paging with delay that makes randomized decisions about which pages to fetch and evict, we design a fractional algorithm. This approach was first introduced by Bansal, Buchbinder, and Naor for weighted paging [4 ] and later reused by Gupta, Kumar, and Panigrahi for paging with delay [17 ] . A fractional algorithm maintains, at every time, a fractional state x ∈ [ 0 , 1 ] n x \in[0,1]^n x ∈ [ 0 , 1 ] n , where the antimass x i x_i x i represents the fraction of page i i i that is not cached. Equivalently, 1 − x i 1-x_i 1 − x i is the fractional cached mass the algorithm has on page i i i . Throughout the execution, we maintain that the fractional state satisfies ∑ i x i ≥ n − k \sum_i x_i \ge n-k ∑ i x i ≥ n − k , meaning that the total cached mass is at most k k k . Bansal, Buchbinder, and Naor showed for classical paging that the state x x x of a fractional algorithm can be transformed online into a randomized integral paging algorithm realizing the state as its marginal probabilities, i.e., the probability of page i i i being cached is 1 − x i 1-x_i 1 − x i [4 Theorem 4.1] . In the design of our algorithm, we ensure that a requested page i i i has x i = 0 x_i=0 x i = 0 at some time, so that the resulting randomized algorithm caches i i i almost surely at this time.
Mirror descent in classical paging. Bubeck et al. [9 ] demonstrated how a fractional solution for classical paging (without delay) can be defined via a mirror descent path , recovering the tight O ( log k ) O(\log k) O ( log k ) bound already proven in [4 ] . Upon a request to an uncached page p p p , their algorithm redistributes cached mass from other pages to p p p by following a path x x x through fractional states defined by the differential inclusion
x ′ ( t ) ∈ ∇ 2 Φ ( x ( t ) ) − 1 ⋅ ( − 1 p − N S ( x ( t ) ) ) . (1) x'(t) \in\nabla^2\Phi(x(t))^{-1}\cdot\left(-\mathbf{1}_p-N_S(x(t))\right). \tag*{(1)} x ′ ( t ) ∈ ∇ 2 Φ ( x ( t ) ) − 1 ⋅ ( − 1 p − N S ( x ( t )) ) . (1)
Here, 1 p \mathbf{1}_p 1 p is the vector with entry 1 at p p p and 0 at all other pages, S S S denotes the set of possible states x ∈ [ 0 , 1 ] n x \in[0,1]^n x ∈ [ 0 , 1 ] n with ∑ i x i = n − k \sum_i x_i=n-k ∑ i x i = n − k , N S ( x ) N_S(x) N S ( x ) is the normal cone of S S S at x x x , and Φ \Phi Φ is a strongly convex function called the mirror map . Intuitively, x ′ x' x ′ is defined to reduce the antimass at p p p (via the term − 1 p -1_p − 1 p ), while being forced into the possible state space S S S (via the term − N S ( x ( t ) ) -N_S(x(t)) − N S ( x ( t )) ), and following some distortion defined by Φ \Phi Φ . It can be shown that this mirror descent path indeed reduces the antimass at p p p , while increasing the antimass at all other pages. The algorithm by Bubeck et al. follows this path until p p p is cached. Upon each request, a new mirror descent path is followed and the resulting paths are concatenated to give a full execution of the algorithm.
To analyze this algorithm, [9 ] use the Bregman divergence
D ( x , y ) : = Φ ( y ) − Φ ( x ) − ⟨ ∇ Φ ( x ) , y − x ⟩ D(x,y) := \Phi(y) - \Phi(x) - \langle\nabla\Phi(x), y-x\rangle D ( x , y ) := Φ ( y ) − Φ ( x ) − ⟨ ∇Φ ( x ) , y − x ⟩
as a potential function. Using the weighted entropy function Φ = ∑ i w i x i log ( x i ) \Phi= \sum_i w_i x_i \log(x_i) Φ = ∑ i w i x i log ( x i ) as the mirror map, an analysis of mirror descent paths with the Bregman potential shows that
∫ 1 p T x ( t ) d t ≤ L ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t + ∫ 1 p T Opt ( t ) d t . \int1_p^{\mathsf T}x(t)\,\mathrm{d}t \le L\int\lVert\operatorname{Opt}'(t)\rVert_{\ell_1(w)}\,\mathrm{d}t + \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t. ∫ 1 p T x ( t ) d t ≤ L ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t + ∫ 1 p T Opt ( t ) d t .
Here, ℓ 1 ( w ) \ell_1(w) ℓ 1 ( w ) is the weighted ℓ 1 \ell_1 ℓ 1 -norm, ∥ x ∥ ℓ 1 ( w ) = ∑ i w i ∣ x i ∣ \lVert x\rVert_{\ell_1(w)} = \sum_i w_i|x_i| ∥ x ∥ ℓ 1 ( w ) = ∑ i w i ∣ x i ∣ , so that, for a given differentiable path y y y of fractional states, ∫ ∥ y ′ ( t ) ∥ ℓ 1 ( w ) d t \int\lVert y'(t)\rVert_{\ell_1(w)}\mathrm{d}t ∫ ∥ y ′ ( t ) ∥ ℓ 1 ( w ) d t is the cost of transitioning through the fractional states along y y y when moving mass into or out of page i i i costs w i w_i w i , and L L L is the Lipschitz constant of Φ \Phi Φ on the state space S S S . The terms ∫ 1 p T x ( t ) d t \int1_p^{\mathsf T}x(t)\,\mathrm{d}t ∫ 1 p T x ( t ) d t and ∫ 1 p T Opt ( t ) d t \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t ∫ 1 p T Opt ( t ) d t are called the service cost of the algorithm and the optimum, respectively, and ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t \int\lVert\operatorname{Opt}'(t)\rVert_{\ell_1(w)}\mathrm{d}t ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t is the movement cost of the optimum. Writing x − ′ : = max { 0 , − x ′ } x'_- := \max\{0,-x'\} x − ′ := max { 0 , − x ′ } for the negative part of the derivative of x x x , Bubeck et al. moreover show that the negative movement cost ∫ ∥ x − ′ ( t ) ∥ ℓ 1 ( w ) d t \int\lVert x'_-(t)\rVert_{\ell_1(w)}\mathrm{d}t ∫ ∥ x − ′ ( t ) ∥ ℓ 1 ( w ) d t of the algorithm is bounded by its service cost, yielding
∫ ∥ x − ′ ( t ) ∥ ℓ 1 ( w ) d t ≤ L ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t + ∫ 1 p T Opt ( t ) d t (2) \int\lVert x'_-(t)\rVert_{\ell_1(w)}\mathrm{d}t \le L\int\lVert\operatorname{Opt}'(t)\rVert_{\ell_1(w)}\mathrm{d}t + \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t \tag*{(2)} ∫ ∥ x − ′ ( t ) ∥ ℓ 1 ( w ) d t ≤ L ∫ ∥ Opt ′ ( t ) ∥ ℓ 1 ( w ) d t + ∫ 1 p T Opt ( t ) d t (2)
for each request to some page p p p .
In classical paging, every algorithm has to serve each requested page immediately. Therefore, when page p p p is requested, it holds that Opt p ( t ) = 0 \operatorname{Opt}_p(t)=0 Opt p ( t ) = 0 , and hence the optimum’s service cost is zero. Note that this is not the case for paging with delay, which we discuss below. The competitive guarantee of L L L then follows immediately from (2) . On the full state space S S S , the Lipschitz constant L L L of the weighted entropy turns out to be unbounded. In particular, on a domain [ δ , 1 ] n ⊆ [ 0 , 1 ] n [\delta,1]^n\subseteq[0,1]^n [ δ , 1 ] n ⊆ [ 0 , 1 ] n , the Lipschitz constant is Θ ( − log δ ) \Theta(-\log\delta) Θ ( − log δ ) . To get a better competitive guarantee, [9 ] therefore follows the mirror descent path only until x p = δ x_p=\delta x p = δ for some small threshold δ \delta δ , at which point the page is considered served. Finally, they apply a fixed transformation that maps δ \delta δ to zero, so that the requested page is truly served when x p = δ x_p=\delta x p = δ . The competitive ratio then is O ( − log δ ) O(-\log\delta) O ( − log δ ) .
Adapting mirror descent for paging with delay. A natural approach to reusing the analysis of [9 ] for paging with delay would be to act as if a page has to be served once it has accumulated large delay compared to the cost required to serve it. In contrast to classical paging, however, when fetching such a page, we cannot assume that Opt \operatorname{Opt} Opt has the requested page p p p cached at the same time that we fetch it. Opt \operatorname{Opt} Opt may serve the same request earlier or later than we do. In this case, (2) gives the competitive ratio L L L only with an additive term ∫ 1 p T Opt ( t ) d t \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t ∫ 1 p T Opt ( t ) d t per fetch (the optimum’s service cost). In the analysis leading to (2), this additive term stems from an increase of the Bregman potential while fetching the page.
This is a fundamental obstruction to reusing the analysis as is: the increase is real, as we move away from Opt \operatorname{Opt} Opt ’s state, but Opt \operatorname{Opt} Opt may pay nothing at this time, since it pays for p p p earlier or later with additional delay. The key ingredient of our analysis therefore is to charge this potential increase to costs that Opt \operatorname{Opt} Opt incurs at other times. In particular, we relate the optimum’s service cost back to the algorithm’s positive movement cost, proving that
∫ 1 p T Opt ( t ) d t ≤ 3 ∫ ∥ x + ′ ( t ) ∥ ℓ 1 ( w ) d t (3) \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t \le3\int\lVert x'_+(t)\rVert_{\ell_1(w)}\,\mathrm{d}t \tag*{(3)} ∫ 1 p T Opt ( t ) d t ≤ 3 ∫ ∥ x + ′ ( t ) ∥ ℓ 1 ( w ) d t (3)
where x + ′ : = max { 0 , x ′ } x'_+ := \max\{0,x'\} x + ′ := max { 0 , x ′ } . By itself, this does not yet yield a competitive guarantee but it shows that investing an additional cost of ∫ 1 p T Opt ( t ) d t \int1_p^{\mathsf T}\operatorname{Opt}(t)\,\mathrm{d}t ∫ 1 p T Opt ( t ) d t changes the algorithm’s cost by a constant factor, thus not deteriorating the competitive guarantee. In particular, if this additional investment is for actions whose cost can be charged to O p t \mathrm{Opt} Opt , we can cover the increase of the Bregman potential and remain O ( L ) O(L) O ( L ) -competitive.
We achieve this by adding preemptive service : besides the page whose delay triggers a fetch, we also serve other pending requests, as long as an internal budget covers the cost of doing so. Preemptive service is a key component of many existing algorithms for online service with delay [8 , 3 Tou23] . Usually, preemptive service is performed for roughly the cost of the triggering service and in order of increasing urgency. A request triggering critical service has either arrived after the last critical service, in which case O p t \mathrm{Opt} Opt could not have batched the request with others and therefore paid for it in full, or it was already present at the last preemptive service, in which case it might not cause cost for O p t \mathrm{Opt} Opt . In this case, since preemptive service is in order of increasing urgency, all preemptively served requests were more urgent than the current triggering request, and the current triggering request did not fit within the budget to be preemptively served. This certifies that either, the algorithm performed its entire budget worth of preemptive service, or the previous preemptive service did not fully use its budget because the current service is more costly than the previous one. In the first case, the cost can be charged directly to O p t \mathrm{Opt} Opt , and in the second case, the cost of one service is charged to that of the next service. This creates a chain of increasingly heavy pages and the competitive ratio then measures the depth of such charging chains.
In our case, most cost is already covered through the Bregman potential, and the quantity to be bounded is instead the excess term ∫ 1 p O p t ( t ) d t \int_1^p \mathrm{Opt}(t)\,dt ∫ 1 p Opt ( t ) d t . When a page is fetched due to high delay cost, we measure the length of the mirror descent path it follows and declare this amount as a budget for preemptive service to pending requests. This length is at least the excess term ∫ 1 p O p t ( t ) d t ≤ ∫ 1 p 1 d t \int_1^p \mathrm{Opt}(t)\,dt \le\int_1^p 1\,dt ∫ 1 p Opt ( t ) d t ≤ ∫ 1 p 1 d t and can be bounded as in (3), altering the cost of the algorithm by at most a constant factor. Unlike in the previous work on online service with delay, the excess to be bounded here can be much larger than the cost of the service, and this cannot be easily predicted. Therefore, we allow every service to trigger preemptive services with high cost, irrespective of its own cost. Moreover, every service can deposit budget for high-cost preemptive services, and we keep track of these budgets over the span of the entire execution, instead of per service or per page.
As usual in online service with delay, we perform preemptive service to pending requests in order of increasing urgency. Here, urgency is defined by the time at which the pending delay on a page exceeds the cost of serving it. If this time has already passed, either O p t \mathrm{Opt} Opt has served the pending request already, incurring the same fetch cost as we do, or O p t \mathrm{Opt} Opt serves it later and pays the same cost in delay. Either way, we can show that O p t \mathrm{Opt} Opt ’s cost covers the cost of our preemptive service. In cases where budget was deposited by a service that increased the Bregman potential, we can show that almost the entire preemptive budget is spent on visits to such urgent requests, so that the increase in the potential is covered by the cost of O p t \mathrm{Opt} Opt .
Online rounding. To transform the resulting sequence of fractional states into a feasible one with x i = 0 x_i=0 x i = 0 for every requested page i i i at some point, we apply a fixed map to our fractional states, analogously to the approach in [9 ] . To maintain the competitive guarantee, this map may not distort the cost of the resulting state transitions by more than a constant factor. The distortion can be measured by the norm of the transformation map’s derivative. To optimize the competitive guarantee, we choose δ \delta δ maximal such that we can define a transformation mapping mass δ \delta δ to 0 with bounded derivative. The optimal choice turns out to be δ : = 1 / ( 2 k + 1 ) \delta:= 1/(2k+1) δ := 1/ ( 2 k + 1 ) (see also Section B), giving the mirror map Lipschitz factor L = log 1 δ = log ( 2 k + 1 ) L=\log\frac{1}{\delta}=\log(2k+1) L = log δ 1 = log ( 2 k + 1 ) and competitive guarantee O ( log ( k ) ) O(\log(k)) O ( log ( k )) .
Related work
Paging with delay can be seen as a special case of the online service with delay (OSD) problem, where k k k agents serve requests in a metric space, which arrive over time and accrue delay cost while waiting to be served. Weighted paging with delay can be understood as OSD on a star metric, and weighted paging with deadlines is the special case where delay costs remain zero up to the deadline, at which point they start growing rapidly. A ray of the star then corresponds to a page with weight proportional to the ray’s length, and the k k k agents represent the k k k cache slots.
Online service with delay was introduced by Azar et al. in 2017 [3 ] together with a randomized O ( k log 5 n ) O(k\log^{5} n) O ( k log 5 n ) -competitive clairvoyant algorithm for general metric spaces of size n n n , which is based on a deterministic O ( k d 4 ) O(kd^{4}) O ( k d 4 ) -competitive clairvoyant algorithm for hierarchically separated trees (HSTs) of depth d d d , combined with a randomized embedding of general metrics into HSTs. In particular, since any star metric is an HST of depth 1, this implies a clairvoyant deterministic O ( k ) O(k) O ( k ) -competitive algorithm for paging with delay or deadlines. For unweighted stars, Azar et al. give a simple reduction to classical paging, providing an O ( log k ) O(\log k) O ( log k ) bound for unweighted paging with delay. The authors complement this with a lower bound of Ω ( n ) \Omega(\sqrt{n}) Ω ( n ) for the competitive ratio of deterministic nonclairvoyant weighted paging with deadlines with in the case of k = 1 k=1 k = 1 . In [18 ] and [MTW26], the competitive ratio of both clairvoyant and nonclairvoyant unweighted paging with delay has since been shown to lie in [ 2 k + 1 , 2 k + 2 ] [2k+1, 2k+2] [ 2 k + 1 , 2 k + 2 ] .
For online service with delay on general metrics, the upper bound for the competitive ratio of deterministic clairvoyant algorithms has been reduced to O ( log n ) O(\log n) O ( log n ) in the case of k = 1 k=1 k = 1 [Tou23], while no better bounds have been proven for general k k k . In the nonclairvoyant case, a deterministic upper bound of O ( n log n ) O(\sqrt{n\log n}) O ( n log n ) can be achieved [Tou25]. For randomized algorithms, Gupta, Kumar, and Panigrahi [16 ] gave an improved dependence on k k k through an O ( polylog ( n , Δ ) ) O(\operatorname{polylog}(n,\Delta)) O ( polylog ( n , Δ )) -competitive algorithm, where n ≥ k n \ge k n ≥ k is the size of the metric space and Δ \Delta Δ is the metric’s aspect ratio max x , y d ( x , y ) / min x ≠ y d ( x , y ) \max_{x,y} d(x,y)/\min_{x\ne y} d(x,y) max x , y d ( x , y ) / min x = y d ( x , y ) . In [17 ] , Gupta, Kumar, and Panigrahi present an O ( log k log n ) O(\log k\log n) O ( log k log n ) -competitive randomized clairvoyant algorithm for paging with delay or deadlines through a primal-dual approach. We improve the competitive ratio to O ( log k ) O(\log k) O ( log k ) for this setting.
We can recover the classical paging problem as a special case of paging with delay by giving all requests immediate deadlines. In particular, this implies that the lower bounds of k k k for deterministic algorithms [21 ] and H k ≈ log k H_k \approx\log k H k ≈ log k for randomized algorithms [15 ] transfer directly to both clairvoyant and nonclairvoyant paging with delay, leading to a tight analysis of deterministic weighted paging with delay and a Θ ( log n ) \Theta(\log n) Θ ( log n ) gap between the known randomized upper and lower bounds, which we close in this paper.
Our algorithm uses the mirror descent technique, which was initially introduced in the context of convex optimization [20 ] and has recently seen many applications in randomized online decision making [6 , 10 , 5 ] . Notably, Bubeck et al. [9 ] used the continuous-time mirror descent framework to derive an O ( log 2 k ) O(\log^{2} k) O ( log 2 k ) -competitive randomized algorithm for the k k k -server problem on HSTs. In their paper, they demonstrate how mirror descent can be used to recover the O ( log k ) O(\log k) O ( log k ) guarantee for randomized online paging already achieved through the primal-dual analysis in [4 ] .
Problem definition
An instance of weighted paging with delay is given by a finite sequence of requests r = ( p r , a r , d r ) r=(p_r,a_r,d_r) r = ( p r , a r , d r ) where p r ∈ { 1 , … , n } p_r \in\{1,\ldots,n\} p r ∈ { 1 , … , n } is the requested page, a r ≥ 0 a_r \ge0 a r ≥ 0 is the request’s arrival time, and d r : [ 0 , ∞ ) → [ 0 , ∞ ) d_r\colon[0,\infty) \to[0,\infty) d r : [ 0 , ∞ ) → [ 0 , ∞ ) is its delay cost function. Delay cost functions are nondecreasing, continuous and unbounded, with d r ( 0 ) = 0 d_r(0)=0 d r ( 0 ) = 0 . We consider the clairvoyant version of the problem where delay functions are revealed upon the arrival of a request.
An algorithm holds a set of up to k k k pages at any given time in its cache , and every algorithm, as well as the optimum, starts with a fixed initial cache of k k k pages. The algorithm may alter its cache instantaneously at any time, and may go through multiple cache configurations at one instant of time. Each page i i i is associated with a weight w i w_i w i and fetching a page incurs a cost equal to its weight. The eviction of pages does not incur any cost. A request r r r is served at time τ \tau τ if τ ≥ a r \tau\ge a_r τ ≥ a r is the first time such that p r p_r p r is cached at time τ \tau τ (i.e., it is part of some cache configuration that the algorithm goes through at time τ \tau τ ). The request then incurs delay cost d r ( τ − a r ) d_r(\tau-a_r) d r ( τ − a r ) . The cost of an algorithm is its total fetch cost plus its total delay cost.
An algorithm is online if its actions at time t t t depend only on the requests with arrival time at most t t t . Furthermore, if its actions at time t t t do not depend on the trajectory of the delay cost curves beyond t t t , the algorithm is nonclairvoyant , otherwise it is clairvoyant .
An algorithm is ρ \rho ρ -competitive if, for every input σ \sigma σ , its cost satisfies Alg ( σ ) ≤ ρ ⋅ Opt ( σ ) + c \operatorname{Alg}(\sigma) \le\rho\cdot\operatorname{Opt}(\sigma) + c Alg ( σ ) ≤ ρ ⋅ Opt ( σ ) + c , where Opt ( σ ) \operatorname{Opt}(\sigma) Opt ( σ ) is the cost of the optimal offline algorithm on σ \sigma σ , and c c c is a constant that is independent of the input sequence. A randomized algorithm is ρ \rho ρ -competitive if its expected cost satisfies E [ Alg ( σ ) ] ≤ ρ ⋅ Opt ( σ ) + c \mathbb{E}[\operatorname{Alg}(\sigma)] \le\rho\cdot\operatorname{Opt}(\sigma) + c E [ Alg ( σ )] ≤ ρ ⋅ Opt ( σ ) + c , where the expectation is taken over the algorithm’s random choices.
For the analysis we use the following convention of order. At a time t t t , first the requests with a r = t a_r = t a r = t arrive, then the optimal offline schedule performs its cache updates and finally the online algorithm updates its cache. “Before” and “after” refer to this order.
Furthermore, we assume w.l.o.g. that the optimum schedule is lazy in the sense that every eviction is delayed until the next fetch, so that the cache is full at all times, and every eviction is immediately followed by a fetch. This does not increase its delay or fetch cost: The lazy schedule caches a superset of the pages of the original schedule at all times and fetches every page at the same time as the original schedule, or not at all.
Algorithm definition
In this section, we define our algorithm PMD (Preemptive Mirror Descent ) for weighted paging with delay. The pseudocode of PMD is given in Algorithm 1. For the definition of PMD, we assume that all weights are powers of two (see the proof of Theorem 1). Moreover, we assume w.l.o.g. that the minimum page weight is 1. Throughout, we fix the threshold δ : = 1 2 k + 1 \delta:= \frac{1}{2^{k+1}} δ := 2 k + 1 1 and let L : = log 1 δ = log ( 2 k + 1 ) L := \log\frac{1}{\delta} = \log(2^{k+1}) L := log δ 1 = log ( 2 k + 1 ) , where log is the natural logarithm.
PMD keeps a fractional state x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n , starting with the initial cache.4 A request r r r for page p p p is served at the first time τ r ≥ a r \tau_r \ge a_r τ r ≥ a r at which x p = δ x_p = \delta x p = δ , and it is pending from its arrival until it is served. Because we define the randomized algorithm after applying a transformation that maps δ \delta δ to 0 0 0 (Proposition 30 ), every realization of the randomized algorithm has p p p cached with probability 1 at time τ r \tau_r τ r . In case a page’s antimass is strictly positive, it may be cached even before this time in some realizations of the algorithm.
PMD remains idle until the delay of pending requests pays for serving some page. We then call this page critical, and two types of service are performed. First, the critical page is served during a critical service , which is followed by preemptive services to other pending requests.
Critical service When a page p p p becomes critical (see below), PMD serves it by following a mirror descent path. We call this part of the execution a critical service to p p p and say that it has level w p w_p w p , where w p w_p w p is the weight of page p p p .
To serve p p p , PMD decreases the antimass at p p p and increases it at all other pages. It does so by virtually following the mirror descent path from [9 ] defined in (1). We denote this path by λ \lambda λ and write λ x → p \lambda_{x \to p} λ x → p when we need to make the critical page p p p and the start state x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n explicit. To simplify the analysis, we specify the path λ = λ x → p \lambda= \lambda_{x \to p} λ = λ x → p explicitly as
λ ( s ) i : = min { 1 , x i e s / w i } ( i ≠ p ) , λ ( s ) p : = n − k − ∑ i ≠ p λ ( s ) i ( s ≥ 0 ) \lambda(s)_i := \min\{1, x_i e^{s/w_i}\} \quad(i \ne p), \qquad\lambda(s)_p := n-k-\sum_{i \ne p}\lambda(s)_i \quad(s \ge0) λ ( s ) i := min { 1 , x i e s / w i } ( i = p ) , λ ( s ) p := n − k − i = p ∑ λ ( s ) i ( s ≥ 0 )
and let PMD transition to the state λ ( ∣ λ ∣ ) \lambda(|\lambda|) λ ( ∣ λ ∣ ) with ∣ λ ∣ : = min { t ≥ 0 : λ ( t ) p = δ } |\lambda| := \min\{t \ge0 : \lambda(t)_p = \delta\} ∣ λ ∣ := min { t ≥ 0 : λ ( t ) p = δ } chosen minimally such that λ ( ∣ λ ∣ ) p = δ \lambda(|\lambda|)_p = \delta λ ( ∣ λ ∣ ) p = δ . We refer to ∣ λ ∣ |\lambda| ∣ λ ∣ as the length of the critical service, which is the time it takes to serve page p p p along the mirror descent path. Note that such a time ∣ λ ∣ |\lambda| ∣ λ ∣ exists because the mirror descent path is continuous, λ ( s ) p \lambda(s)_p λ ( s ) p is nonincreasing, λ ( 0 ) p = x p > δ \lambda(0)_p = x_p > \delta λ ( 0 ) p = x p > δ , and λ ( s ) p → 1 − k ≤ 0 \lambda(s)_p \to1-k \le0 λ ( s ) p → 1 − k ≤ 0 as s → ∞ s \to\infty s → ∞ . Therefore, ∣ λ ∣ |\lambda| ∣ λ ∣ is well defined and λ x → p \lambda_{x \to p} λ x → p serves all pending requests for p p p .
Intuitively, the mirror descent path evicts mass from all pages i ≠ p i \ne p i = p at rate λ ( s ) i / w i \lambda(s)_i/w_i λ ( s ) i / w i , i.e., proportional to their current antimasses divided by their weights. This way, PMD favors evicting light pages that hold a lot of antimass, intuitively following a cheap path towards a state where the antimass is divided equally among all pages.
Algorithm 1: Preemptive Mirror Descent (PMD)
for each W ∈ { 1 , 2 , 4 , … } W \in\{1,2,4,\ldots\} W ∈ { 1 , 2 , 4 , … } and page p p p : B W ← 0 B_W \leftarrow0 B W ← 0 , c p ← 0 c_p \leftarrow0 c p ← 0 // initialize budgets and claims
upon page p p p becoming critical (i.e., (5) holds):
CriticalService( p ) (p) ( p )
for each level W ∈ { 1 , 2 , 4 , … } W \in\{1,2,4,\ldots\} W ∈ { 1 , 2 , 4 , … } :
if B W ≥ 4 W B_W \ge4W B W ≥ 4 W and ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ \sum_{i:w_i\le W}(1-x_i) \ge1-\delta ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ
PreemptiveService( W ) (W) ( W )
procedure CriticalService ( p ) (p) ( p ) :
θ ← ( ∣ λ x → p ∣ / L ) / ( ∑ w q ≤ w p o q ) \theta\leftarrow(|\lambda_{x\to p}|/L)/(\sum_{w_q\le w_p}o_q) θ ← ( ∣ λ x → p ∣/ L ) / ( ∑ w q ≤ w p o q )
for each page q q q with w q ≤ w p w_q \le w_p w q ≤ w p : c q ← c q + θ o q c_q \leftarrow c_q+\theta o_q c q ← c q + θ o q // claim delay, total increase ∣ λ x → p ∣ / L |\lambda_{x\to p}|/L ∣ λ x → p ∣/ L
for each level W ∈ { w p , 2 w p , … } W \in\{w_p,2w_p,\ldots\} W ∈ { w p , 2 w p , … } : B W ← B W + ∣ λ x → p ∣ W B_W \leftarrow B_W+|\lambda_{x\to p}|W B W ← B W + ∣ λ x → p ∣ W // deposit budget
x ← λ x → p ( ∣ λ x → p ∣ ) x \leftarrow\lambda_{x\to p}(|\lambda_{x\to p}|) x ← λ x → p ( ∣ λ x → p ∣ ) , c p ← 0 c_p \leftarrow0 c p ← 0 // serve p p p , reset claim
procedure PreemptiveService ( W ) (W) ( W ) :
x s t a r t ← x x^{\mathrm{start}} \leftarrow x x start ← x
θ ← ( 1 − δ ) / ( ∑ w i ≤ W ( 1 − x i ) ) \theta\leftarrow(1-\delta)/(\sum_{w_i\le W}(1-x_i)) θ ← ( 1 − δ ) / ( ∑ w i ≤ W ( 1 − x i ))
for each page i i i with w i ≤ W w_i \le W w i ≤ W : x i ← x i + θ ( 1 − x i ) x_i \leftarrow x_i+\theta(1-x_i) x i ← x i + θ ( 1 − x i ) // open a hole, total increase 1 − δ 1-\delta 1 − δ
B W ← B W − W ( 1 − δ ) B_W \leftarrow B_W-W(1-\delta) B W ← B W − W ( 1 − δ ) // pay for closing the hole
E ← { page q : w q ≤ W } E \leftarrow\{\text{page }q:w_q\le W\} E ← { page q : w q ≤ W } ordered by increasing deadline( q ) (q) ( q ) // eligible pages E E E
while E ≠ ∅ E\ne\varnothing E = ∅ and B W ≥ W B_W\ge W B W ≥ W :
q ← E . pop ( 0 ) q \leftarrow E.\operatorname{pop}(0) q ← E . pop ( 0 ) // get and remove first page from E E E
B W ← B W − w q ( x q − δ ) B_W \leftarrow B_W-w_q(x_q-\delta) B W ← B W − w q ( x q − δ ) // pay for the round trip
x q ← δ ← x q x_q \leftarrow\delta\leftarrow x_q x q ← δ ← x q , c q ← 0 c_q \leftarrow0 c q ← 0 // set x q x_q x q to δ \delta δ and back (serve q q q ), reset claim
x ← x s t a r t x \leftarrow x^{\mathrm{start}} x ← x start // close the hole
During the critical service, only x p x_p x p decreases, and the total incurred fetch cost therefore is
fetch ( λ x → p ) : = w p ( λ ( 0 ) p − λ ( ∣ λ ∣ ) p ) = w p ( x p − δ ) . \operatorname{fetch}(\lambda_{x\to p}) := w_p(\lambda(0)_p-\lambda(|\lambda|)_p)=w_p(x_p-\delta). fetch ( λ x → p ) := w p ( λ ( 0 ) p − λ ( ∣ λ ∣ ) p ) = w p ( x p − δ ) .
When to turn a page critical
A natural rule would turn page p p p critical once the delay of its pending requests equals the cost w p w_p w p of serving it, therefore balancing fetch and delay cost. This delay pays for fetching p p p , but not for making room for p p p . While evictions are free by themselves, they can cost the algorithm later when an evicted page needs to be re-fetched (Example 34). We therefore wait until the delay covers both the cost w p w_p w p of serving the request and of re-fetching the heaviest page evicted to make space. To determine the heaviest such page, we observe that the mirror descent path has evicted a page i ≠ p i\ne p i = p once it reaches length L w i Lw_i L w i : Using that L = log ( 1 / δ ) L=\log(1/\delta) L = log ( 1/ δ ) , it holds that
λ x → p ( s ) i = min { 1 , x i e s / w i } ≥ min { 1 , δ e L } = 1 for all x ∈ [ δ , 1 ] n , p ≠ i , s ≥ L w i . (4) \lambda_{x\to p}(s)_i=\min\{1,x_i e^{s/w_i}\}\ge\min\{1,\delta e^L\}=1\quad\text{for all }x\in[\delta,1]^n,\ p\ne i,\ s\ge Lw_i. \tag*{(4)} λ x → p ( s ) i = min { 1 , x i e s / w i } ≥ min { 1 , δ e L } = 1 for all x ∈ [ δ , 1 ] n , p = i , s ≥ L w i . (4)
Therefore, the critical service to p p p displaces all pages of weight up to ∣ λ x → p ∣ / L |\lambda_{x\to p}|/L ∣ λ x → p ∣/ L . To cover the possible re-fetching of these pages in addition to fetching p p p , PMD waits until the delay is at least w p + ∣ λ x → p ∣ / L w_p+|\lambda_{x\to p}|/L w p + ∣ λ x → p ∣/ L .
However, if many light pages are simultaneously pending and the cache is filled with heavy pages, following this rule for each page individually means that we let each pending request incur a very large delay cost. Displacing a heavy page to serve all light pages may be much cheaper than waiting for each light page to accumulate sufficient delay to warrant evicting a heavy page on its own (Example 35). Thus, instead of waiting for the delay of a single request for p p p to cover ∣ λ x → p ∣ / L |\lambda_{x\to p}|/L ∣ λ x → p ∣/ L , we consider all pages of weight at most w p w_p w p . To denote the aggregated delay cost of all pending requests for a page q q q at time τ \tau τ , we define
delay q ( τ ) : = ∑ r pending on q d r ( τ − a r ) . \operatorname{delay}_q(\tau):=\sum_{r\text{ pending on }q}d_r(\tau-a_r). delay q ( τ ) := r pending on q ∑ d r ( τ − a r ) .
Finally, we need to prevent delay from being charged multiple times, causing more critical service than it can pay for. Thus, for each page q q q , we keep track of the amount c q c_q c q of its delay that has been claimed to make another page critical and only unclaimed delay contributes to making pages critical. Whenever q q q is cached, c q c_q c q resets to 0 because there is no more delay to track.
Putting the above components together, instead of waiting for the delay on p p p beyond w p w_p w p to reach ∣ λ x → p ∣ / L |\lambda_{x\to p}|/L ∣ λ x → p ∣/ L , we wait for the overshoot
o q : = ( delay q ( t ) − c q − w q ) + o_q := \left(\operatorname{delay}_q(t)-c_q-w_q\right)_+ o q := ( delay q ( t ) − c q − w q ) +
of all lighter pages to reach this threshold, i.e., a page p p p turns critical when
o p > 0 and ∑ q : w q ≤ w p o q ≥ ∣ λ x → p ∣ / L . (5) o_p > 0 \qquad\text{and} \qquad\sum_{q:\,w_q\le w_p} o_q \ge|\lambda_{x\to p}|/L. \tag*{(5)} o p > 0 and q : w q ≤ w p ∑ o q ≥ ∣ λ x → p ∣/ L . (5)
Note that there is a well defined first time at which (5) is satisfied, because x x x and c q c_q c q remain constant between two steps of PMD and the overshoots are continuous, as delays are continuous and new requests initially have 0 delay.
Once (5) is satisfied, PMD increases the corresponding values c q c_q c q by ∣ λ x → p ∣ / L |\lambda_{x\to p}|/L ∣ λ x → p ∣/ L in total and by at most o q o_q o q each, and performs a critical service to p p p .
Preemptive service After a critical service, PMD performs preemptive services to pending requests. A preemptive service has an assigned weight level W W W (described below) and serves pending requests of weight at most W W W in order of increasing urgency. This urgency is measured in the time until the delay of pending requests on a page reaches the weight of serving them. Formally, for each page q q q we define its effective deadline at a time t t t as
deadline ( q ) : = inf { τ ≥ t : delay q ( τ ) > w q } , (6) \operatorname{deadline}(q) := \inf\{\tau\ge t : \operatorname{delay}_q(\tau) > w_q\}, \tag*{(6)} deadline ( q ) := inf { τ ≥ t : delay q ( τ ) > w q } , (6)
so that delay q ( τ ) > w q \operatorname{delay}_q(\tau) > w_q delay q ( τ ) > w q for all τ > deadline ( q ) \tau> \operatorname{deadline}(q) τ > deadline ( q ) . PMD performs preemptive service to pages in order of increasing effective deadlines.
To do so, it first evicts 1 − δ 1-\delta 1 − δ mass of pages of weight at most W W W by increasing x i x_i x i for these pages (opening a hole ), uses this mass to serve pending requests on pages q q q by decreasing x q x_q x q to δ \delta δ and back (round trips ), and then returns to its previous configuration (closing the hole ).
Preemptive services take no time and happen at the same time as the critical service that triggered them. To determine to what extent preemptive service should be performed for level W W W , PMD tracks a budget B W B_W B W for each level W W W throughout the execution. PMD starts a preemptive service for every weight level , i.e., every power of two W = 2 j W=2^j W = 2 j , for which the pages of weight at most W W W hold a total of at least 1 − δ 1-\delta 1 − δ cached mass, i.e., ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ \sum_{i:\,w_i\le W}(1-x_i)\ge1-\delta ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ (so that there is sufficient mass to open a hole), and the budget B W B_W B W is at least 4 W 4W 4 W (i.e., the budget can cover the cost of closing a hole and serving some requests). It then performs round trips as long as B W ≥ W B_W\ge W B W ≥ W , so that the budget can cover each round trip.
Each budget B W B_W B W starts with B W = 0 B_W=0 B W = 0 and can increase during critical service. To see by how much, we split the parameter range of the mirror descent path into disjoint intervals I W : = [ W ⋅ L , 2 W ⋅ L ) I_W := [W\cdot L,2W\cdot L) I W := [ W ⋅ L , 2 W ⋅ L ) . By (4) , only pages heavier than W W W are evicted during I W I_W I W . Moreover, we know that the rate of weighted eviction is at least 1 3 \frac{1}{3} 3 1 throughout (see the proof of Lemma 5 ). So if w p ≤ W w_p\le W w p ≤ W , then during I W I_W I W the relatively light page p p p causes the eviction of pages heavier than W W W . If light pages cause this repeatedly, PMD may keep evicting a heavy page for light requests, whereas it might have been cheaper to serve the light requests ahead of time and keep the heavy page cached afterwards. Therefore, we dedicate the length of the mirror descent path in I W I_W I W to preemptive service at level W W W .
To this end, we write ∣ λ ∣ W : = ∣ I W ∩ [ 0 , λ ] ∣ |\lambda|_W := |I_W\cap[0,\lambda]| ∣ λ ∣ W := ∣ I W ∩ [ 0 , λ ] ∣ for the length of the part of λ \lambda λ in I W I_W I W , and increase the budget B W B_W B W of every level W ≥ w p W\ge w_p W ≥ w p by ∣ λ ∣ W |\lambda|_W ∣ λ ∣ W . Since the intervals I W I_W I W are disjoint, a critical service with path λ \lambda λ deposits at most ∣ λ ∣ |\lambda| ∣ λ ∣ into all budgets in total. Note that, since the rate of weighted eviction is at least 1 3 \frac{1}{3} 3 1 throughout, the deposit ∣ λ ∣ |\lambda| ∣ λ ∣ is at most three times the weighted eviction (Lemma 5 ). As the total weighted eviction and fetch cost are equal up to an additive term independent of the input, preemptive service only alters the cost of the algorithm by a constant factor.
Feasibility of PMD
We establish that PMD is feasible in the sense that throughout the execution, we never cache more mass than k k k , budgets stay nonnegative, and every request is eventually served.
Lemma 2. PMD is feasible in the following sense:
(a) Throughout the execution, it holds that x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n , ∑ i x i ≥ n − k \sum_i x_i \ge n-k ∑ i x i ≥ n − k and B W ≥ 0 B_W \ge0 B W ≥ 0 . Between steps and after every critical service, it holds that ∑ i x i = n − k \sum_i x_i = n-k ∑ i x i = n − k .
(b) Every request is served.
Proof. (a) By definition of the mirror descent paths λ x → p \lambda_{x\to p} λ x → p we have x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n and ∑ i x i = n − k \sum_i x_i=n-k ∑ i x i = n − k during critical service. When opening a hole during preemptive service, the condition ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ \sum_{i:w_i\le W}(1-x_i) \ge1-\delta ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ guarantees that this is possible without violating the bounds x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n . In particular, it gives θ ≤ 1 \theta\le1 θ ≤ 1 , so that every x i x_i x i stays at most 1.
During a round trip to page i i i , x i x_i x i decreases no further than δ \delta δ . This decreases ∑ i x i \sum_i x_i ∑ i x i by at most 1 − δ 1-\delta 1 − δ , which is offset by the total increase of 1 − δ 1-\delta 1 − δ from opening the hole.
When closing the hole PMD returns to the state from before the preemptive service, which we just showed satisfies the assumptions.
Decreases to B W B_W B W only occur after conditions that ensure B W B_W B W covers the decrease: closing the hole costs W ( 1 − δ ) ≤ 4 W W(1-\delta) \le4W W ( 1 − δ ) ≤ 4 W , and a round trip on q q q costs w q ( x q − δ ) ≤ w q ≤ W w_q(x_q-\delta) \le w_q \le W w q ( x q − δ ) ≤ w q ≤ W .
(b) Each call of CriticalService( p ) (p) ( p ) performs a critical service to a page with a pending request and serves this request. Suppose some request r r r for a page p p p is never served. After the last critical service, x x x and c p c_p c p remain constant, while delay p ( t ) ≥ d r ( t − a r ) → ∞ \operatorname{delay}_p(t) \ge d_r(t-a_r) \to\infty delay p ( t ) ≥ d r ( t − a r ) → ∞ (by unboundedness of the delay cost functions), so o p → ∞ o_p \to\infty o p → ∞ . Therefore, (5) eventually holds and PMD serves the request.
Reducing to fetch cost of critical service
The aim of this section is to show that it suffices to analyze the fetch cost C f e t c h c r i t = ∑ ν ∈ S c r i t fetch ( λ ( ν ) ) C_{\mathrm{fetch}}^{\mathrm{crit}}=\sum_{\nu\in S_{\mathrm{crit}}}\operatorname{fetch}(\lambda^{(\nu)}) C fetch crit = ∑ ν ∈ S crit fetch ( λ ( ν ) ) of critical services of PMD, where S c r i t S_{\mathrm{crit}} S crit is the set of critical steps and λ ( ν ) \lambda^{(\nu)} λ ( ν ) is the path of the critical service performed in step ν \nu ν (Section 4.1). More precisely, we define the fractional fetch and delay costs of PMD, show that their sum corresponds to the expected cost of the randomized algorithm that PMD is transformed into, and prove that all costs incurred by PMD are bounded by a constant multiple of
C f e t c h c r i t + ∑ i w i , C_{\mathrm{fetch}}^{\mathrm{crit}}+\sum_i w_i, C fetch crit + i ∑ w i ,
i.e., the fetch cost of critical services and an additive term independent of the input (Proposition 12). To do so, we show the following result in Section 4.1.
Lemma 3. The total length of the critical services of PMD satisfies
∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ ≤ 3 ⋅ C f e t c h c r i t + 3 ∑ i w i . \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| \le3\cdot C_{\mathrm{fetch}}^{\mathrm{crit}}+3\sum_i w_i. ν ∈ S crit ∑ ∣ λ ( ν ) ∣ ≤ 3 ⋅ C fetch crit + 3 i ∑ w i .
Algorithms incur two types of costs: delay costs and fetch costs. PMD generates fetch cost during critical and preemptive services. Since we want to reduce to the fetch costs of critical services, we only need to consider delay costs and the fetch costs of preemptive services. PMD’s preemptive services are paid for by the budgets B W B_W B W and therefore incur at most the total increase of B W B_W B W as fetch costs. Since every critical service increases the B W B_W B W by at most its length, the total deposit is at most the length of critical service and we can apply Lemma 3.
Using d r ( τ r − a r ) d_r(\tau_r-a_r) d r ( τ r − a r ) as the delay cost of PMD for a request r r r is not sufficient for our analysis, as we discuss in § 4.3 , where we also define the correct notion.
Writing C f e t c h C_{\mathrm{fetch}} C fetch and C d e l a y C_{\mathrm{delay}} C delay for the fractional fetch and delay costs of PMD, defined below, we formally show
C f e t c h ≤ C f e t c h c r i t + ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ and C d e l a y ≤ C f e t c h + 5 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ . (7) C_{\mathrm{fetch}} \le C_{\mathrm{fetch}}^{\mathrm{crit}}+\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|
\quad\text{and}\quad
C_{\mathrm{delay}} \le C_{\mathrm{fetch}}+5\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|. \tag*{(7)} C fetch ≤ C fetch crit + ν ∈ S crit ∑ ∣ λ ( ν ) ∣ and C delay ≤ C fetch + 5 ν ∈ S crit ∑ ∣ λ ( ν ) ∣. (7)
and Lemma 3 converts the lengths into fetch cost of critical services. We begin by proving Lemma 3.
Proof of Lemma 3
A fractional algorithm traverses a finite sequence of states x ( 0 ) , x ( 1 ) , … , x ( N ) ∈ [ 0 , 1 ] n x^{(0)},x^{(1)},\ldots,x^{(N)}\in[0,1]^n x ( 0 ) , x ( 1 ) , … , x ( N ) ∈ [ 0 , 1 ] n . For PMD, x ( 0 ) x^{(0)} x ( 0 ) is the initial state, for a critical service with path λ \lambda λ there is a state x ( i ) = λ ( ∣ λ ∣ ) x^{(i)}=\lambda(|\lambda|) x ( i ) = λ ( ∣ λ ∣ ) and for every preemptive service there is a state after opening the hole, a state when the page of a round trip is cached, a state after returning, and the state after closing the hole. All these states are in the order in which they occur in PMD. We call the move from x ( ν ) x^{(\nu)} x ( ν ) to x ( ν + 1 ) x^{(\nu+1)} x ( ν + 1 ) step ν \nu ν . If it is a critical service to a page p ( ν ) p^{(\nu)} p ( ν ) , we call step ν \nu ν critical and write λ ( ν ) : = λ x ( ν ) → p ( ν ) \lambda^{(\nu)}:=\lambda_{x^{(\nu)}\to p^{(\nu)}} λ ( ν ) := λ x ( ν ) → p ( ν ) for its path. Let S c r i t S_{\mathrm{crit}} S crit be the set of critical steps.
Definition 4 (fractional fetch cost). The fractional fetch cost of a fractional algorithm traversing the states x ( 0 ) , … , x ( N ) x^{(0)},\ldots,x^{(N)} x ( 0 ) , … , x ( N ) is
C f e t c h : = ∑ ν < N ∑ i w i ( x i ( ν ) − x i ( ν + 1 ) ) + . C_{\mathrm{fetch}}:=\sum_{\nu<N}\sum_i w_i\left(x_i^{(\nu)}-x_i^{(\nu+1)}\right)_+. C fetch := ν < N ∑ i ∑ w i ( x i ( ν ) − x i ( ν + 1 ) ) + . The fractional fetch cost of the critical steps is C f e t c h c r i t : = ∑ ν ∈ S c r i t ∑ i w i ( x i ( ν ) − x i ( ν + 1 ) ) + C_{\mathrm{fetch}}^{\mathrm{crit}}:=\sum_{\nu\in S_{\mathrm{crit}}}\sum_i w_i\left(x_i^{(\nu)}-x_i^{(\nu+1)}\right)_+ C fetch crit := ∑ ν ∈ S crit ∑ i w i ( x i ( ν ) − x i ( ν + 1 ) ) + .
In particular, every critical step ν \nu ν contributes exactly fetch ( λ ( ν ) ) \operatorname{fetch}(\lambda^{(\nu)}) fetch ( λ ( ν ) ) , so the fractional fetch cost of critical steps is C f e t c h c r i t = ∑ ν ∈ S c r i t fetch ( λ ( ν ) ) C_{\mathrm{fetch}}^{\mathrm{crit}}=\sum_{\nu\in S_{\mathrm{crit}}}\operatorname{fetch}(\lambda^{(\nu)}) C fetch crit = ∑ ν ∈ S crit fetch ( λ ( ν ) ) .
We prove Lemma 3 in two steps. First, we compare the length of each critical service with the weighted eviction during it and, second, we compare the total weighted eviction during critical services with their total fetch cost. We define the weighted eviction during an interval J ⊆ [ 0 , ∣ λ ∣ ] J\subseteq[0,|\lambda|] J ⊆ [ 0 , ∣ λ ∣ ] of a critical service λ \lambda λ as
EV ( J ) : = ∫ J ∥ λ + ′ ( t ) ∥ ℓ 1 ( w ) d t , (8) \operatorname{EV}(J):=\int_J\|\lambda'_+(t)\|_{\ell_1(w)}\,dt, \tag*{(8)} EV ( J ) := ∫ J ∥ λ + ′ ( t ) ∥ ℓ 1 ( w ) d t , (8)
and write EV ( λ ) : = EV ( [ 0 , ∣ λ ∣ ] ) \operatorname{EV}(\lambda):=\operatorname{EV}([0,|\lambda|]) EV ( λ ) := EV ([ 0 , ∣ λ ∣ ]) for the total weighted eviction along λ \lambda λ .
Lemma 5. For every state x ∈ [ δ , 1 ] n x\in[\delta,1]^n x ∈ [ δ , 1 ] n with ∑ i x i = n − k \sum_i x_i=n-k ∑ i x i = n − k and every page p p p , ∣ λ x → p ∣ ≤ 3 EV ( λ x → p ) |\lambda_{x\to p}|\le3\operatorname{EV}(\lambda_{x\to p}) ∣ λ x → p ∣ ≤ 3 EV ( λ x → p ) .
Proof. Let λ : = λ x → p \lambda:=\lambda_{x\to p} λ := λ x → p and let E ( s ) E(s) E ( s ) be the set of pages fully evicted at s s s ,
E ( s ) : = { i ≠ p : λ ( s ) i = 1 } . (9) E(s):=\{i\ne p:\lambda(s)_i=1\}. \tag*{(9)} E ( s ) := { i = p : λ ( s ) i = 1 } . (9) For i ∉ E ( s ) ∪ { p } i\notin E(s)\cup\{p\} i ∈ / E ( s ) ∪ { p } , λ i ′ ( s ) = λ ( s ) i / w i \lambda'_i(s)=\lambda(s)_i/w_i λ i ′ ( s ) = λ ( s ) i / w i , and all other coordinates are constant or nonincreasing, so ∥ λ + ′ ( s ) ∥ ℓ 1 ( w ) = ∑ i ∉ E ( s ) ∪ { p } λ ( s ) i \|\lambda'_+(s)\|_{\ell_1(w)}=\sum_{i\notin E(s)\cup\{p\}}\lambda(s)_i ∥ λ + ′ ( s ) ∥ ℓ 1 ( w ) = ∑ i ∈ / E ( s ) ∪ { p } λ ( s ) i . By definition of the mirror descent path λ ( s ) i ≥ δ \lambda(s)_i\ge\delta λ ( s ) i ≥ δ for all i i i and s ≤ ∣ λ ∣ s\le|\lambda| s ≤ ∣ λ ∣ , so if there were at least n − k n-k n − k pages in E ( s ) E(s) E ( s ) then ∑ i λ ( s ) i ≥ n − k + k δ > n − k \sum_i\lambda(s)_i\ge n-k+k\delta>n-k ∑ i λ ( s ) i ≥ n − k + k δ > n − k , but the definition of λ ( s ) p \lambda(s)_p λ ( s ) p ensures ∑ i λ ( s ) i = n − k \sum_i\lambda(s)_i=n-k ∑ i λ ( s ) i = n − k . Thus, there can be at most n − k − 1 n-k-1 n − k − 1 pages in E ( s ) E(s) E ( s ) and consequently, there are at least k k k pages i ∉ E ( s ) ∪ { p } i\notin E(s)\cup\{p\} i ∈ / E ( s ) ∪ { p } . Hence, it holds for all s ≤ ∣ λ ∣ s\le|\lambda| s ≤ ∣ λ ∣ that
∥ λ + ′ ( s ) ∥ ℓ 1 ( w ) = ∑ i ∉ E ( s ) ∪ { p } λ ( s ) i ≥ ∑ i ∉ E ( s ) ∪ { p } δ ≥ k δ ≥ k 2 k + 1 ≥ 1 3 . \|\lambda'_+(s)\|_{\ell_1(w)}
=\sum_{i\notin E(s)\cup\{p\}}\lambda(s)_i
\ge\sum_{i\notin E(s)\cup\{p\}}\delta
\ge k\delta\ge\frac{k}{2k+1}\ge\frac{1}{3}. ∥ λ + ′ ( s ) ∥ ℓ 1 ( w ) = i ∈ / E ( s ) ∪ { p } ∑ λ ( s ) i ≥ i ∈ / E ( s ) ∪ { p } ∑ δ ≥ k δ ≥ 2 k + 1 k ≥ 3 1 . Integrating over [ 0 , ∣ λ ∣ ] [0,|\lambda|] [ 0 , ∣ λ ∣ ] gives EV ( λ ) ≥ ∣ λ ∣ / 3 \operatorname{EV}(\lambda)\ge|\lambda|/3 EV ( λ ) ≥ ∣ λ ∣/3 .
We argue that the total weighted eviction during critical services differs from their total fetch cost by at most an additive term independent of the input.
Lemma 6. Over the entire execution, the total weighted eviction during critical services satisfies
∑ ν ∈ S c r i t EV ( λ ( ν ) ) ≤ C f e t c h c r i t + ∑ i w i . \sum_{\nu\in S_{\mathrm{crit}}} \operatorname{EV}(\lambda^{(\nu)}) \le C_{\mathrm{fetch}}^{\mathrm{crit}} + \sum_i w_i. ν ∈ S crit ∑ EV ( λ ( ν ) ) ≤ C fetch crit + i ∑ w i . Proof. Let λ \lambda λ be the path of some critical service to p p p . By definition, λ ( s ) i \lambda(s)_i λ ( s ) i is nondecreasing for i ≠ p i \ne p i = p and only λ ( s ) p \lambda(s)_p λ ( s ) p decreases, so the integral defining EV \operatorname{EV} EV evaluates to
EV ( λ ) = ∑ i ≠ p w i ( λ ( ∣ λ ∣ ) i − λ ( 0 ) i ) and EV ( λ ) − fetch ( λ ) = ∑ i w i ( λ ( ∣ λ ∣ ) i − λ ( 0 ) i ) . \operatorname{EV}(\lambda)=\sum_{i\ne p}w_i\bigl(\lambda(|\lambda|)_i-\lambda(0)_i\bigr)
\qquad\text{and}\qquad
\operatorname{EV}(\lambda)-\operatorname{fetch}(\lambda)=\sum_iw_i\bigl(\lambda(|\lambda|)_i-\lambda(0)_i\bigr). EV ( λ ) = i = p ∑ w i ( λ ( ∣ λ ∣ ) i − λ ( 0 ) i ) and EV ( λ ) − fetch ( λ ) = i ∑ w i ( λ ( ∣ λ ∣ ) i − λ ( 0 ) i ) . Summed over all critical services, the right-hand side telescopes to at most ∑ i w i \sum_i w_i ∑ i w i , since every preemptive service ends in the state from before it (proof of Lemma 2 ). Thus, over the entire execution, the total weighted eviction is
∑ ν ∈ S c r i t EV ( λ ( ν ) ) ≤ C f e t c h c r i t + ∑ i w i . \sum_{\nu\in S_{\mathrm{crit}}}\operatorname{EV}(\lambda^{(\nu)})\le C_{\mathrm{fetch}}^{\mathrm{crit}}+\sum_iw_i. ν ∈ S crit ∑ EV ( λ ( ν ) ) ≤ C fetch crit + i ∑ w i .
Together, the two lemmas yield Lemma 3.
Lemma 3. The total length of the critical services of PMD satisfies
∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ ≤ 3 ⋅ C f e t c h c r i t + 3 ∑ i w i . \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|\le3\cdot C_{\mathrm{fetch}}^{\mathrm{crit}}+3\sum_iw_i. ν ∈ S crit ∑ ∣ λ ( ν ) ∣ ≤ 3 ⋅ C fetch crit + 3 i ∑ w i . Proof. By Lemmas 5 and 6 ,
∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ ≤ 3 ∑ ν ∈ S c r i t EV ( λ ( ν ) ) ≤ 3 ⋅ C f e t c h c r i t + 3 ∑ i w i . \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|\le3\sum_{\nu\in S_{\mathrm{crit}}}\operatorname{EV}(\lambda^{(\nu)})\le3\cdot C_{\mathrm{fetch}}^{\mathrm{crit}}+3\sum_iw_i. ν ∈ S crit ∑ ∣ λ ( ν ) ∣ ≤ 3 ν ∈ S crit ∑ EV ( λ ( ν ) ) ≤ 3 ⋅ C fetch crit + 3 i ∑ w i .
Bounding Fetch Cost
In this section we show the first inequality of (7) , i.e., we bound the fractional fetch cost of PMD in terms of the length of critical services. The critical steps contribute C f e t c h c r i t C_{\mathrm{fetch}}^{\mathrm{crit}} C fetch crit to C f e t c h C_{\mathrm{fetch}} C fetch and the remaining fetch cost is incurred by preemptive services.
Proposition 7. The fractional fetch cost of PMD satisfies
C f e t c h ≤ C f e t c h c r i t + ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ . C_{\mathrm{fetch}}\le C_{\mathrm{fetch}}^{\mathrm{crit}}+\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|. C fetch ≤ C fetch crit + ν ∈ S crit ∑ ∣ λ ( ν ) ∣. Proof. As discussed above, PMD incurs fetch cost during critical and preemptive services. Thus, it suffices to bound the latter by the length ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| ∑ ν ∈ S crit ∣ λ ( ν ) ∣ of critical services.
Opening the hole and returning from a round trip only increase coordinates of x x x , so a preemptive service at level W W W incurs fetch cost only during round trips and to restore the original state, both of which are paid for by a decrease in B W B_W B W : Round trips on pages q q q with w q ≤ W w_q\le W w q ≤ W are only performed as long as B W ≥ W B_W\ge W B W ≥ W and paid for immediately, while closing the hole costs at most W ( 1 − δ ) W(1-\delta) W ( 1 − δ ) , which was paid at the start of the preemptive service. Thus, it suffices to bound the total decrease of all budgets, or, because B W ≥ 0 B_W\ge0 B W ≥ 0 , the total increase.
A critical service for a page p p p , with path λ \lambda λ , increases the budget B W B_W B W by ∣ λ ∣ W |\lambda|_W ∣ λ ∣ W for all W ≥ w p W\ge w_p W ≥ w p . Since the intervals I W I_W I W are disjoint, the total increase is at most ∣ λ ∣ |\lambda| ∣ λ ∣ . Over the entire execution, the increase is hence bounded by ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| ∑ ν ∈ S crit ∣ λ ( ν ) ∣ , which bounds the contribution of preemptive services to C f e t c h C_{\mathrm{fetch}} C fetch , and the claim follows.
Bounding Fractional Delay Cost
Having bounded C f e t c h C_{\mathrm{fetch}} C fetch , it remains to show the second inequality in (7) , i.e.,
C d e l a y ≤ C f e t c h + 5 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ . C_{\mathrm{delay}}\le C_{\mathrm{fetch}}+5\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|. C delay ≤ C fetch + 5 ν ∈ S crit ∑ ∣ λ ( ν ) ∣.
To define the fractional delay cost C d e l a y C_{\mathrm{delay}} C delay , consider some request r r r and let τ r \tau_r τ r be the time at which r r r is served, i.e., the first time since the release for which x p r = δ x_{p_r}=\delta x p r = δ . We could naively define the delay cost to be d r ( τ r − a r ) d_r(\tau_r-a_r) d r ( τ r − a r ) , but that would ignore the fact p r p_r p r may already be cached with some probability when r r r is released. In this case, some realizations of the randomized algorithm would not incur any delay cost at all thus lowering the expected cost of the algorithm. Hence, the naive definition does not represent the expected delay cost of the randomized algorithm. Instead, we weigh the delay by the factor α r \alpha_r α r representing the antimass of p r p_r p r when r r r arrives, i.e., the probability of the request not being served upon arrival.
Definition 8 (fractional delay cost). For a request r r r , let x x x be the state of PMD right before r r r arrives at time a r a_r a r . Let α r : = x p r − δ \alpha_r := x_{p_r}-\delta α r := x p r − δ be the missing mass on p r p_r p r at that time and let τ r \tau_r τ r be the time at which r r r is served. The fractional delay cost of r r r is α r ⋅ d r ( τ r − a r ) \alpha_r\cdot d_r(\tau_r-a_r) α r ⋅ d r ( τ r − a r ) and the total fractional delay cost of PMD is defined as
C d e l a y : = ∑ r α r d r ( τ r − a r ) . C_{\mathrm{delay}} := \sum_r \alpha_r d_r(\tau_r-a_r). C delay := r ∑ α r d r ( τ r − a r ) .
We will show later that this definition captures the delay cost of the randomized algorithm corresponding to PMD up to a factor of 3 (Proposition 30 ). We want to consider the delay not as a sum over requests but as a sum over steps. To this end, we define a visit to p p p as a step ν \nu ν such that x p > δ x_p>\delta x p > δ before ν \nu ν but x p = δ x_p=\delta x p = δ after, write S v i s i t S_{\mathrm{visit}} S visit for the set of visits, and make the following observation, which is immediate by the algorithm’s definition.
Observation 9. Between two visits of a page p p p its antimass x p x_p x p never decreases. In particular, every request r r r on p p p satisfies x p − δ ≥ α r x_p-\delta\ge\alpha_r x p − δ ≥ α r until it is served.
Right before PMD visits a page p p p in a step ν \nu ν , the overshoot is o p = ( delay p ( t ) − c p − w p ) + o_p=(\operatorname{delay}_p(t)-c_p-w_p)_+ o p = ( delay p ( t ) − c p − w p ) + , so the delay of all pending requests to p p p is bounded by
∑ r ∈ R ν d r ( t − a r ) = delay p ( t ) ≤ w p + c p + o p , \sum_{r\in R_\nu}d_r(t-a_r)=\operatorname{delay}_p(t)\le w_p+c_p+o_p, r ∈ R ν ∑ d r ( t − a r ) = delay p ( t ) ≤ w p + c p + o p ,
where R ν R_\nu R ν is the set of all requests served in step ν \nu ν . In particular, we can bound the fractional delay cost of all r ∈ R ν r\in R_\nu r ∈ R ν as
∑ r ∈ R ν α r ⋅ d r ( τ r − a r ) ≤ O b s . 9 ∑ r ∈ R ν ( x p − δ ) ⋅ d r ( τ r − a r ) ≤ ( x p − δ ) ⋅ ( w p + c p + o p ) ≤ x p ≤ 1 ( x p − δ ) ⋅ w p + c p + o p , \sum_{r\in R_\nu}\alpha_r\cdot d_r(\tau_r-a_r)
\mathrel{\overset{\mathrm{Obs.}\ 9}{\le}}
\sum_{r\in R_\nu}(x_p-\delta)\cdot d_r(\tau_r-a_r)
\le(x_p-\delta)\cdot(w_p+c_p+o_p)
\mathrel{\overset{x_p\le1}{\le}}
(x_p-\delta)\cdot w_p+c_p+o_p, r ∈ R ν ∑ α r ⋅ d r ( τ r − a r ) ≤ Obs. 9 r ∈ R ν ∑ ( x p − δ ) ⋅ d r ( τ r − a r ) ≤ ( x p − δ ) ⋅ ( w p + c p + o p ) ≤ x p ≤ 1 ( x p − δ ) ⋅ w p + c p + o p ,
i.e., the delay cost of all requests served with a visit is at most the cost of fetching the page, its claimed delay and its overshoot. Since all requests are served in some step, we can sum this over all visits ν \nu ν to a page p ( ν ) p^{(\nu)} p ( ν ) to get
C d e l a y = ∑ ν ∈ S v i s i t ∑ r ∈ R ν α r ⋅ d r ( τ r − a r ) ≤ ∑ ν ∈ S v i s i t ( ( x p ( ν ) − δ ) ⋅ w p ( ν ) + c p ( ν ) + o p ( ν ) ) ≤ C f e t c h + ∑ ν ∈ S v i s i t ( c p ( ν ) + o p ( ν ) ) . \begin{aligned}
C_{\mathrm{delay}}
=
\sum_{\nu\in S_{\mathrm{visit}}}\sum_{r\in R_\nu}\alpha_r\cdot d_r(\tau_r-a_r)
\le
\sum_{\nu\in S_{\mathrm{visit}}}\left((x_{p^{(\nu)}}-\delta)\cdot w_{p^{(\nu)}}+c_{p^{(\nu)}}+o_{p^{(\nu)}}\right) \\
&\le C_{\mathrm{fetch}}+\sum_{\nu\in S_{\mathrm{visit}}}\left(c_{p^{(\nu)}}+o_{p^{(\nu)}}\right).
\end{aligned} C delay = ν ∈ S visit ∑ r ∈ R ν ∑ α r ⋅ d r ( τ r − a r ) ≤ ν ∈ S visit ∑ ( ( x p ( ν ) − δ ) ⋅ w p ( ν ) + c p ( ν ) + o p ( ν ) ) ≤ C fetch + ν ∈ S visit ∑ ( c p ( ν ) + o p ( ν ) ) .
With this, it suffices to bound the last sum in terms of ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| ∑ ν ∈ S crit ∣ λ ( ν ) ∣ . This is easy for the summand c p c_p c p . Because c p c_p c p is set to 0 after every visit, any increase in c p c_p c p is counted at most once and the claims only increase by ∣ λ ∣ / L |\lambda|/L ∣ λ ∣/ L in total for a critical service with path λ \lambda λ . Thus, the entire sum is bounded by ∑ ν ∈ S v i s i t c p ( ν ) ≤ ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ / L \sum_{\nu\in S_{\mathrm{visit}}}c_{p^{(\nu)}}\le\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|/L ∑ ν ∈ S visit c p ( ν ) ≤ ∑ ν ∈ S crit ∣ λ ( ν ) ∣/ L .
Bounding ∑ ν o p \sum_\nu o_p ∑ ν o p is more involved. We charge the overshoot paid by all visits at a time t t t to the lengths of the critical services that PMD performs at the same time t t t .
Let x x x be the state right before the steps of PMD at time t t t . Since the state is constant between moves and no page satisfies (5) right before t t t , by continuity of the overshoots, the overshoots at time t t t have at most just reached the threshold of (5). Thus, at time t t t for every page p p p with o p > 0 o_p>0 o p > 0 , we have ∑ q : w q ≤ w p o q ≤ 1 L ∣ λ x → p ∣ \sum_{q:w_q\le w_p}o_q\le\frac{1}{L}|\lambda_{x\to p}| ∑ q : w q ≤ w p o q ≤ L 1 ∣ λ x → p ∣ with equality for the page whose critical service PMD performs first at time t t t . If PMD performed only a single critical service to a page p p p at time t t t then o p o_p o p would be bounded by 1 L ∣ λ x → p ∣ \frac{1}{L}|\lambda_{x\to p}| L 1 ∣ λ x → p ∣ and we would be done. The difficulty is that PMD may perform many services at time t t t . After the first critical service, on a page p p p , the state jumps from x x x to some state x ~ \tilde{x} x ~ . The bound on the overshoot of page q q q still refers to the critical service λ x → q \lambda_{x\to q} λ x → q , whereas the service that PMD actually performs on q q q starts in x ~ \tilde{x} x ~ , and ∣ λ x ~ → q ∣ |\lambda_{\tilde{x}\to q}| ∣ λ x ~ → q ∣ might be smaller than ∣ λ x → q ∣ |\lambda_{x\to q}| ∣ λ x → q ∣ . However, the jump from x x x to x ~ \tilde{x} x ~ is caused by a critical service to p p p . It therefore suffices to relate the length change between ∣ λ x → q ∣ |\lambda_{x\to q}| ∣ λ x → q ∣ and ∣ λ x ~ → q ∣ |\lambda_{\tilde{x}\to q}| ∣ λ x ~ → q ∣ to the length of the critical service to p p p . To do so, we start by showing an analog to the triangle inequality for lengths of critical services.
Lemma 10. Let p p p be a page and let x x x and x ~ \tilde{x} x ~ be the states before and after a critical service to p p p is performed. Let q ≠ p q \ne p q = p be another page with x q > δ x_q > \delta x q > δ . Then performing a critical service to q q q from x x x is no more expensive than performing the service to p p p and then the service to q q q from x ~ \tilde{x} x ~ , i.e., ∣ λ x → q ∣ ≤ ∣ λ x → p ∣ + ∣ λ x ~ → q ∣ |\lambda_{x\to q}| \le|\lambda_{x\to p}| + |\lambda_{\tilde{x}\to q}| ∣ λ x → q ∣ ≤ ∣ λ x → p ∣ + ∣ λ x ~ → q ∣ .
Proof. Let λ : = λ x → q \lambda:= \lambda_{x\to q} λ := λ x → q and λ ~ : = λ x ~ → q \tilde{\lambda} := \lambda_{\tilde{x}\to q} λ ~ := λ x ~ → q , so λ ( s ) i = min { 1 , x i e s / w i } \lambda(s)_i = \min\{1, x_i e^{s/w_i}\} λ ( s ) i = min { 1 , x i e s / w i } and λ ~ ( s ) i = min { 1 , x ~ i e s / w i } \tilde{\lambda}(s)_i = \min\{1, \tilde{x}_i e^{s/w_i}\} λ ~ ( s ) i = min { 1 , x ~ i e s / w i } for i ≠ q i \ne q i = q .
For a page i ∉ { p , q } i \notin\{p,q\} i ∈ / { p , q } , the critical service λ ~ x ~ → q \tilde{\lambda}_{\tilde{x}\to q} λ ~ x ~ → q continues the mirror descent path that λ x → p \lambda_{x\to p} λ x → p took: if i i i ’s antimass reached 1 1 1 , it stays constant. Otherwise, x ~ i = x i e ∣ λ x → p ∣ / w i \tilde{x}_i = x_i e^{|\lambda_{x\to p}|/w_i} x ~ i = x i e ∣ λ x → p ∣/ w i , so λ ~ ( s ) i = x i e ( s + ∣ λ x → p ∣ ) / w i \tilde{\lambda}(s)_i = x_i e^{(s+|\lambda_{x\to p}|)/w_i} λ ~ ( s ) i = x i e ( s + ∣ λ x → p ∣ ) / w i . In particular, λ ~ ( s ) i = λ ( s + ∣ λ x → p ∣ ) i \tilde{\lambda}(s)_i = \lambda(s + |\lambda_{x\to p}|)_i λ ~ ( s ) i = λ ( s + ∣ λ x → p ∣ ) i for all s ≥ 0 s \ge0 s ≥ 0 .
For p p p , the two mirror descent paths have different starting points x ~ p ≤ x p \tilde{x}_p \le x_p x ~ p ≤ x p , and since p p p ’s weight does not change, the paths always satisfy λ ~ ( s ) p ≤ λ ( s ) p ≤ λ ( s + ∣ λ x → p ∣ ) p \tilde{\lambda}(s)_p \le\lambda(s)_p \le\lambda(s + |\lambda_{x\to p}|)_p λ ~ ( s ) p ≤ λ ( s ) p ≤ λ ( s + ∣ λ x → p ∣ ) p . At ∣ λ x ~ → q ∣ |\lambda_{\tilde{x}\to q}| ∣ λ x ~ → q ∣ , we have
n − k − δ = ∑ i ≠ q λ ~ ( ∣ λ x ~ → q ∣ ) i ≤ ∑ i ≠ q λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) i = n − k − λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) q . n-k-\delta=\sum_{i\ne q}\tilde{\lambda}(|\lambda_{\tilde{x}\to q}|)_i\le\sum_{i\ne q}\lambda(|\lambda_{\tilde{x}\to q}|+|\lambda_{x\to p}|)_i=n-k-\lambda(|\lambda_{\tilde{x}\to q}|+|\lambda_{x\to p}|)_q. n − k − δ = i = q ∑ λ ~ ( ∣ λ x ~ → q ∣ ) i ≤ i = q ∑ λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) i = n − k − λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) q .
so λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) q ≤ δ \lambda(|\lambda_{\tilde{x}\to q}|+|\lambda_{x\to p}|)_q \le\delta λ ( ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ ) q ≤ δ . As s ↦ λ ( s ) q s\mapsto\lambda(s)_q s ↦ λ ( s ) q is continuous and nonincreasing, and ∣ λ x → q ∣ |\lambda_{x\to q}| ∣ λ x → q ∣ is defined as the first s s s with λ ( s ) q = δ \lambda(s)_q=\delta λ ( s ) q = δ , it follows that ∣ λ x → q ∣ ≤ ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ |\lambda_{x\to q}| \le|\lambda_{\tilde{x}\to q}|+|\lambda_{x\to p}| ∣ λ x → q ∣ ≤ ∣ λ x ~ → q ∣ + ∣ λ x → p ∣ .
Using the above lemma, we can now bound the fractional delay cost of PMD in terms of the fetch cost and the length of critical services.
Proposition 11. The fractional delay cost of PMD satisfies C d e l a y ≤ C f e t c h + 5 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ C_{\mathrm{delay}} \le C_{\mathrm{fetch}} + 5\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| C delay ≤ C fetch + 5 ∑ ν ∈ S crit ∣ λ ( ν ) ∣ .
Proof. We follow the plan outlined above. Every request with α r > 0 \alpha_r>0 α r > 0 is served by a visit of its page. Since no requests arrive during the steps of PMD at a time t t t , every page is visited at most once at time t t t . Consider a visit of p p p at time t t t , and let x x x and c p c_p c p be the state and the claimed delay of p p p right before it. By Observation 9, the served requests have α r ≤ x p − δ ≤ 1 \alpha_r\le x_p-\delta\le1 α r ≤ x p − δ ≤ 1 , and their delays sum to delay p ( t ) ≤ w p + c p + o p \operatorname{delay}_p(t)\le w_p+c_p+o_p delay p ( t ) ≤ w p + c p + o p , where o p o_p o p is the overshoot right before the steps at time t t t . So the delay of all requests served by the visit is at most ( x p − δ ) ⋅ delay p ( t ) ≤ w p ( x p − δ ) + c p + o p (x_p-\delta)\cdot\operatorname{delay}_p(t)\le w_p(x_p-\delta)+c_p+o_p ( x p − δ ) ⋅ delay p ( t ) ≤ w p ( x p − δ ) + c p + o p and therefore summing over all visits we get
C d e l a y ≤ C f e t c h + ∑ ν ∈ S v i s i t ( c p ( ν ) + o p ( ν ) ) ≤ C f e t c h + ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ + ∑ ν ∈ S v i s i t o p ( ν ) . C_{\mathrm{delay}}\le C_{\mathrm{fetch}}+\sum_{\nu\in S_{\mathrm{visit}}}(c_{p(\nu)}+o_{p(\nu)})\le C_{\mathrm{fetch}}+\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|+\sum_{\nu\in S_{\mathrm{visit}}}o_{p(\nu)}. C delay ≤ C fetch + ν ∈ S visit ∑ ( c p ( ν ) + o p ( ν ) ) ≤ C fetch + ν ∈ S crit ∑ ∣ λ ( ν ) ∣ + ν ∈ S visit ∑ o p ( ν ) .
The claim now follows from
∑ ν ∈ S v i s i t o p ( ν ) ≤ 4 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ . \sum_{\nu\in S_{\mathrm{visit}}}o_{p(\nu)}\le4\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|. ν ∈ S visit ∑ o p ( ν ) ≤ 4 ν ∈ S crit ∑ ∣ λ ( ν ) ∣.
which we show by grouping the steps by the time at which they happen. As above, let x x x be the state right before the steps at some time t t t and let q q q be the heaviest page with o q > 0 o_q>0 o q > 0 that is visited at time t t t (if no such page exists the sum of overshoots is zero and there is nothing to show). As (5) was not satisfied for q q q before time t t t we have
∑ q ′ : w q ′ ≤ w q o q ′ ≤ 1 L ∣ λ x → q ∣ . \sum_{q':\,w_{q'}\le w_q}o_{q'}\le\frac{1}{L}|\lambda_{x\to q}|. q ′ : w q ′ ≤ w q ∑ o q ′ ≤ L 1 ∣ λ x → q ∣.
Note that this sum contains the overshoots of all visits at time t t t because q q q is the heaviest page, so we aim to bound it by ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ \sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}| ∑ ν ∈ S crit ( t ) ∣ λ ( ν ) ∣ , where S c r i t ( t ) ⊆ S c r i t S_{\mathrm{crit}}(t)\subseteq S_{\mathrm{crit}} S crit ( t ) ⊆ S crit is the set of critical steps at time t t t . Let x ~ \tilde{x} x ~ be the state in which PMD starts the service that visits q q q , and let ν 1 , … , ν i \nu_1,\ldots,\nu_i ν 1 , … , ν i be the critical steps at time t t t before this service. Since preemptive services end in the state in which they start, x ~ \tilde{x} x ~ is obtained from x x x by following ν 1 , … , ν i \nu_1,\ldots,\nu_i ν 1 , … , ν i . Applying Lemma 10 i i i times we have
1 L ∣ λ x → q ∣ ≤ 1 L ( ∑ j = 1 i ∣ λ ( ν j ) ∣ + ∣ λ x ~ → q ∣ ) ≤ 1 L ( ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ ) . \frac{1}{L}|\lambda_{x\to q}| \le\frac{1}{L}\left(\sum_{j=1}^{i}|\lambda^{(\nu_j)}|+|\lambda_{\tilde{x}\to q}|\right) \le\frac{1}{L}\left(\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|+|\lambda_{\tilde{x}\to q}|\right). L 1 ∣ λ x → q ∣ ≤ L 1 ( j = 1 ∑ i ∣ λ ( ν j ) ∣ + ∣ λ x ~ → q ∣ ) ≤ L 1 ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ .
If the visit to q q q is a critical service, then we have
∑ q ′ : w q ′ ≤ w q o q ′ ≤ 1 L ( ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ ) ≤ 2 L ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ ≤ 2 ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ . (10) \sum_{q':\,w_{q'}\le w_q} o_{q'} \le\frac{1}{L}\left(\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|+|\lambda_{\tilde{x}\to q}|\right) \le\frac{2}{L}\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}| \le2\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|. \tag*{(10)} q ′ : w q ′ ≤ w q ∑ o q ′ ≤ L 1 ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ ≤ L 2 ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ ≤ 2 ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣. (10)
If q q q is visited by a round trip of a level-W W W preemptive service, we show ∣ λ x ~ → q ∣ ≤ L W |\lambda_{\tilde{x}\to q}|\le LW ∣ λ x ~ → q ∣ ≤ L W . In other words, if we served q q q with a critical service instead of a preemptive service, the path would have length at most L W LW L W . This holds precisely because we ensure light pages can be evicted to make space. Formally, preemptive service only happens if ∑ i : w i ≤ W ( 1 − x ~ i ) ≥ 1 − δ \sum_{i:w_i\le W}(1-\tilde{x}_i)\ge1-\delta ∑ i : w i ≤ W ( 1 − x ~ i ) ≥ 1 − δ . Subtracting 1 − x ~ q 1-\tilde{x}_q 1 − x ~ q we get that the remaining pages hold at least weight ∑ i ≠ q : w i ≤ W ( 1 − x ~ i ) ≥ x ~ q − δ \sum_{i\ne q:w_i\le W}(1-\tilde{x}_i)\ge\tilde{x}_q-\delta ∑ i = q : w i ≤ W ( 1 − x ~ i ) ≥ x ~ q − δ . These pages are evicted along the mirror descent path and by (4) , all of them are fully evicted at λ x ~ → q ( L W ) \lambda_{\tilde{x}\to q}(LW) λ x ~ → q ( L W ) . Since q q q is fetched by the amount that the other pages are evicted, it is fully loaded and the path ends, i.e., ∣ λ x ~ → q ∣ ≤ L W |\lambda_{\tilde{x}\to q}|\le LW ∣ λ x ~ → q ∣ ≤ L W .
Plugging this in gives
∑ q ′ : w q ′ ≤ w q o q ′ ≤ 1 L ( ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ ) ≤ ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ + W ≤ ∑ ν ∈ S c r i t ( t ) ∣ λ ( ν ) ∣ + 2 W ( 1 − δ ) . (11) \sum_{q':\,w_{q'}\le w_q} o_{q'} \le\frac{1}{L}\left(\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|+|\lambda_{\tilde{x}\to q}|\right) \le\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|+W \le\sum_{\nu\in S_{\mathrm{crit}}(t)}|\lambda^{(\nu)}|+2W(1-\delta). \tag*{(11)} q ′ : w q ′ ≤ w q ∑ o q ′ ≤ L 1 ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ + ∣ λ x ~ → q ∣ ≤ ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ + W ≤ ν ∈ S crit ( t ) ∑ ∣ λ ( ν ) ∣ + 2 W ( 1 − δ ) . (11)
where we used L ≥ 1 L\ge1 L ≥ 1 and δ ≤ 1 2 \delta\le\frac{1}{2} δ ≤ 2 1 . Note that W ( 1 − δ ) W(1-\delta) W ( 1 − δ ) is the payment of this preemptive service for closing its hole. If we now sum (10) or (11) for every time t t t , depending on how the heaviest page is served, we get
∑ ν ∈ S v i s i t o p ( ν ) ≤ 2 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ + 2 H . \sum_{\nu\in S_{\mathrm{visit}}}o_{p(\nu)}\le2\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|+2H. ν ∈ S visit ∑ o p ( ν ) ≤ 2 ν ∈ S crit ∑ ∣ λ ( ν ) ∣ + 2 H .
where H H H is the total payment of all preemptive services for closing the hole. Since H H H is paid from the budgets B W B_W B W , it is bounded by their total increase, which (as we already argued in the proof of Proposition 7 ) is bounded by ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ \sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| ∑ ν ∈ S crit ∣ λ ( ν ) ∣ .
Putting everything together we find
C d e l a y ≤ C f e t c h + ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ + ∑ ν ∈ S v i s i t o p ( ν ) ≤ C f e t c h + 3 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ + 2 H ≤ C f e t c h + 5 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ . C_{\mathrm{delay}}\le C_{\mathrm{fetch}}+\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|+\sum_{\nu\in S_{\mathrm{visit}}}o_{p(\nu)}\le C_{\mathrm{fetch}}+3\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|+2H\le C_{\mathrm{fetch}}+5\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|. C delay ≤ C fetch + ν ∈ S crit ∑ ∣ λ ( ν ) ∣ + ν ∈ S visit ∑ o p ( ν ) ≤ C fetch + 3 ν ∈ S crit ∑ ∣ λ ( ν ) ∣ + 2 H ≤ C fetch + 5 ν ∈ S crit ∑ ∣ λ ( ν ) ∣.
Combined bound
Finally, we combine the bounds on the fetch and delay cost in (7) with Lemma 3 to reduce the analysis of PMD to bounding the fetch cost of critical services.
Proposition 12. If for every problem instance C f e t c h c r i t ≤ ρ ⋅ O P T + c C_{\mathrm{fetch}}^{\mathrm{crit}}\le\rho\cdot\mathrm{OPT}+c C fetch crit ≤ ρ ⋅ OPT + c for some ρ , c ≥ 0 \rho,c\ge0 ρ , c ≥ 0 , then the fractional fetch cost C f e t c h C_{\mathrm{fetch}} C fetch and the total fractional delay cost C d e l a y C_{\mathrm{delay}} C delay of PMD satisfy
C f e t c h + C d e l a y ≤ 23 ρ ⋅ O P T + c ′ , c ′ ≔ 23 c + 21 ∑ i w i . C_{\mathrm{fetch}}+C_{\mathrm{delay}}\le23\rho\cdot\mathrm{OPT}+c',\qquad c'\coloneqq23c+21\sum_i w_i. C fetch + C delay ≤ 23 ρ ⋅ OPT + c ′ , c ′ : = 23 c + 21 i ∑ w i .
Proof. We combine our results to get
C f e t c h + C d e l a y ≤ P r o p 11 2 ⋅ C f e t c h + 5 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ C_{\mathrm{fetch}}+C_{\mathrm{delay}}\mathrel{\overset{\mathrm{Prop\ 11}}{\le}}2\cdot C_{\mathrm{fetch}}+5\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}| C fetch + C delay ≤ Prop 11 2 ⋅ C fetch + 5 ν ∈ S crit ∑ ∣ λ ( ν ) ∣
≤ P r o p 7 2 ⋅ C f e t c h c r i t + 7 ∑ ν ∈ S c r i t ∣ λ ( ν ) ∣ ≤ L e m 3 23 ⋅ C f e t c h c r i t + 21 ∑ i w i , \mathrel{\overset{\mathrm{Prop\ 7}}{\le}}2\cdot C_{\mathrm{fetch}}^{\mathrm{crit}}+7\sum_{\nu\in S_{\mathrm{crit}}}|\lambda^{(\nu)}|\mathrel{\overset{\mathrm{Lem\ 3}}{\le}}23\cdot C_{\mathrm{fetch}}^{\mathrm{crit}}+21\sum_i w_i, ≤ Prop 7 2 ⋅ C fetch crit + 7 ν ∈ S crit ∑ ∣ λ ( ν ) ∣ ≤ Lem 3 23 ⋅ C fetch crit + 21 i ∑ w i ,
and the claim follows by the assumption C f e t c h c r i t ≤ ρ ⋅ O P T + c C_{\mathrm{fetch}}^{\mathrm{crit}}\le\rho\cdot\mathrm{OPT}+c C fetch crit ≤ ρ ⋅ OPT + c .
The Bregman potential
As shown in the previous section, it suffices to bound C f e t c h c r i t C_{\mathrm{fetch}}^{\mathrm{crit}} C fetch crit in terms of O p t \mathrm{Opt} Opt . To do so, we use a potential argument based on the Bregman divergence . For a state x x x let
D ( O p t ∥ x ) : = ∑ i ∉ O p t w i g ( x i ) + ∑ i ∈ O p t w i x i , g ( u ) : = u − 1 − log u . D(\mathrm{Opt}\Vert x) := \sum_{i\notin\mathrm{Opt}} w_i g(x_i) + \sum_{i\in\mathrm{Opt}} w_i x_i,\qquad g(u) := u-1-\log u. D ( Opt ∥ x ) := i ∈ / Opt ∑ w i g ( x i ) + i ∈ Opt ∑ w i x i , g ( u ) := u − 1 − log u .
This is the Bregman divergence of the weighted entropy function ∑ i w i x i log x i \sum_i w_i x_i\log x_i ∑ i w i x i log x i between O p t \mathrm{Opt} Opt ’s state and x x x and can be used as a measure for the difference between P M D \mathrm{PMD} PMD ’s and O p t \mathrm{Opt} Opt ’s cache. We use the Bregman divergence as a potential for analyzing P M D \mathrm{PMD} PMD and denote it D D D for short when the state x x x is clear from context. For a critical service with path λ \lambda λ , we let Δ D ( λ ) \Delta D(\lambda) Δ D ( λ ) denote the change of D D D during this service.
To bound the total cost of P M D \mathrm{PMD} PMD against O p t \mathrm{Opt} Opt ’s cost, note first that we can equivalently charge O p t \mathrm{Opt} Opt ’s evictions instead of its fetches.
Observation 13. The total cost of O p t \mathrm{Opt} Opt ’s evictions is at most the fetch cost of O p t \mathrm{Opt} Opt plus w ( O p t 0 ) w(\mathrm{Opt}_0) w ( Opt 0 ) , since each eviction is either of a previously fetched page or of a page of the initial cache.
To begin the potential argument, we first observe that the potential D D D increases by at most O ( L ) O(L) O ( L ) per unit of cost that O p t \mathrm{Opt} Opt incurs.
Lemma 14. The total increase of D D D caused by O p t \mathrm{Opt} Opt ’s moves is at most O ( L ) ⋅ O p t + O ( L ∑ i w i ) O(L)\cdot\mathrm{Opt}+O(L\sum_i w_i) O ( L ) ⋅ Opt + O ( L ∑ i w i ) .
Proof. When O p t \mathrm{Opt} Opt evicts i i i , D D D changes by
w i ( g ( x i ) − x i ) = w i ( − 1 − log x i ) ≤ w i log 1 δ = L ⋅ w i . w_i(g(x_i)-x_i)=w_i(-1-\log x_i)\le w_i\log\frac{1}{\delta}=L\cdot w_i. w i ( g ( x i ) − x i ) = w i ( − 1 − log x i ) ≤ w i log δ 1 = L ⋅ w i . When it fetches i i i , D D D changes by w i ( x i − g ( x i ) ) ≤ w i w_i(x_i-g(x_i))\le w_i w i ( x i − g ( x i )) ≤ w i , so the claim follows by Observation 13 .
Next, we analyze the potential change on a move of P M D \mathrm{PMD} PMD . Recall that we only consider critical services. For this, we make a case distinction based on whether the critical page is in O p t \mathrm{Opt} Opt ’s cache at the time of the service (so that it contributes only to the second sum of D D D ), or not (so that it contributes to the first sum).
Definition 15 (hit and miss services). A critical service to page p p p is a hit service if p ∈ O p t p\in\mathrm{Opt} p ∈ Opt and a miss service if p ∉ O p t p\notin\mathrm{Opt} p ∈ / Opt . We use these terms also for its step, and write S h i t S_{\mathrm{hit}} S hit and S m i s s S_{\mathrm{miss}} S miss for the sets of hit and miss steps, so that S_{\mathrm{crit}}=S_{\mathrm{miss}}\mathbin{\mathaccent\cdot\cup}S_{\mathrm{hit}} . Their fractional fetch costs C f e t c h h i t : = ∑ ν ∈ S h i t fetch ( λ ( ν ) ) C_{\mathrm{fetch}}^{\mathrm{hit}}:=\sum_{\nu\in S_{\mathrm{hit}}}\operatorname{fetch}(\lambda^{(\nu)}) C fetch hit := ∑ ν ∈ S hit fetch ( λ ( ν ) ) and C f e t c h m i s s : = ∑ ν ∈ S m i s s fetch ( λ ( ν ) ) C_{\mathrm{fetch}}^{\mathrm{miss}}:=\sum_{\nu\in S_{\mathrm{miss}}}\operatorname{fetch}(\lambda^{(\nu)}) C fetch miss := ∑ ν ∈ S miss fetch ( λ ( ν ) ) then satisfy C f e t c h c r i t = C f e t c h h i t + C f e t c h m i s s C_{\mathrm{fetch}}^{\mathrm{crit}}=C_{\mathrm{fetch}}^{\mathrm{hit}}+C_{\mathrm{fetch}}^{\mathrm{miss}} C fetch crit = C fetch hit + C fetch miss .
For miss services, it turns out that the potential can increase during the service, so that we have to bound this additional increase in our potential argument. We give a name to this excess term that needs to be bounded independently:
Definition 16 (excess). For a miss service on page p p p in step ν \nu ν , with w min ( O p t ) w_{\min}(\mathrm{Opt}) w m i n ( Opt ) the lightest weight in O p t \mathrm{Opt} Opt , the excess of this service is
Exc ( ν ) : = ∑ w p ≤ W < w min ( O p t ) ∣ λ ( ν ) ∣ W . \operatorname{Exc}(\nu):=\sum_{w_p\le W<w_{\min}(\mathrm{Opt})}|\lambda^{(\nu)}|_W. Exc ( ν ) := w p ≤ W < w m i n ( Opt ) ∑ ∣ λ ( ν ) ∣ W . The total excess is Exc : = ∑ ν ∈ S m i s s Exc ( ν ) \operatorname{Exc}:=\sum_{\nu\in S_{\mathrm{miss}}}\operatorname{Exc}(\nu) Exc := ∑ ν ∈ S miss Exc ( ν ) .
This term mirrors the excess term in (2) as 1 1 1 integrated over the path length. However, we only account for the parts of the path that are in intervals I W I_W I W with w p ≤ W < w min ( O p t ) w_p\le W<w_{\min}(\mathrm{Opt}) w p ≤ W < w m i n ( Opt ) , and bound the remainder separately.
Finally, we compute the potential change during critical services. The result says that the cost of a hit service is covered by a decrease in potential so that we only need to consider miss services.
Proposition 17. Consider a critical service with path λ \lambda λ and triggering page p p p , performed in step ν \nu ν . If the service is a hit service, Δ D ( λ ) ≤ − fetch ( λ ) \Delta D(\lambda) \leq-\operatorname{fetch}(\lambda) Δ D ( λ ) ≤ − fetch ( λ ) . If it is a miss service, Δ D ( λ ) ≤ 2 L ⋅ w p + Exc ( ν ) \Delta D(\lambda) \leq2L \cdot w_p + \operatorname{Exc}(\nu) Δ D ( λ ) ≤ 2 L ⋅ w p + Exc ( ν ) .
Proof. Recall that we assume that Opt’s cache is constant during the service and that it contains exactly k k k pages. Moreover, recall that fetch ( λ ) = w p ( x p − δ ) \operatorname{fetch}(\lambda) = w_p(x_p-\delta) fetch ( λ ) = w p ( x p − δ ) .
The missing mass of all pages i ≠ p i\ne p i = p is increased, which increases the second sum in D D D and decreases the first. Consider the rate of this change at a point s s s of the mirror descent path. First, observe that pages i ≠ p i\ne p i = p with λ ( s ) i = 1 \lambda(s)_i=1 λ ( s ) i = 1 are already fully evicted, so their missing mass λ ( s ) i \lambda(s)_i λ ( s ) i has a constant contribution to D D D . Define the set of evicted pages E ( s ) E(s) E ( s ) as in (9) . The missing mass of a page i ∉ E ( s ) ∪ { p } i\notin E(s)\cup\{p\} i ∈ / E ( s ) ∪ { p } with λ ( s ) i ≠ 1 \lambda(s)_i\ne1 λ ( s ) i = 1 increases at rate λ ( s ) i / w i \lambda(s)_i/w_i λ ( s ) i / w i (recall that we set λ ( s ) i = x i e s / w i \lambda(s)_i=x_i e^{s/w_i} λ ( s ) i = x i e s / w i ), which changes D D D at rate w i ⋅ λ ( s ) i / w i = λ ( s ) i w_i\cdot\lambda(s)_i/w_i=\lambda(s)_i w i ⋅ λ ( s ) i / w i = λ ( s ) i if i ∈ O p t i\in\mathrm{Opt} i ∈ Opt and at rate
w i ⋅ g ′ ( λ ( s ) i ) ⋅ λ ( s ) i w i = w i ⋅ ( 1 − 1 λ ( s ) i ) ⋅ λ ( s ) i w i = λ ( s ) i − 1 w_i\cdot g'(\lambda(s)_i)\cdot\frac{\lambda(s)_i}{w_i}
= w_i\cdot\left(1-\frac{1}{\lambda(s)_i}\right)\cdot\frac{\lambda(s)_i}{w_i}
=\lambda(s)_i-1 w i ⋅ g ′ ( λ ( s ) i ) ⋅ w i λ ( s ) i = w i ⋅ ( 1 − λ ( s ) i 1 ) ⋅ w i λ ( s ) i = λ ( s ) i − 1
if i ∉ O p t i\notin\mathrm{Opt} i ∈ / Opt . Together, the pages i ≠ p i\ne p i = p change D D D at rate
∑ i ∉ O p t ∪ { p } ( λ ( s ) i − 1 ) + ∑ i ∈ O p t ∖ ( E ( s ) ∪ { p } ) λ ( s ) i = ∑ i ∉ O p t ∪ { p } λ ( s ) i − ( n − k − 1 p ∉ O p t ) + ∑ i ∈ O p t ∖ { p } λ ( s ) i − ∣ E ( s ) ∩ O p t ∣ = ∑ i ≠ p λ ( s ) i − ( n − k − 1 p ∉ O p t ) − ∣ E ( s ) ∩ O p t ∣ = 1 p ∉ O p t − λ ( s ) p − ∣ E ( s ) ∩ O p t ∣ . \begin{aligned}
\sum_{i\notin\mathrm{Opt}\cup\{p\}}(\lambda(s)_i-1)
+\sum_{i\in\mathrm{Opt}\setminus(E(s)\cup\{p\})}\lambda(s)_i \\
&=\sum_{i\notin\mathrm{Opt}\cup\{p\}}\lambda(s)_i-(n-k-\mathbb{1}_{p\notin\mathrm{Opt}})
+\sum_{i\in\mathrm{Opt}\setminus\{p\}}\lambda(s)_i-|E(s)\cap\mathrm{Opt}| \\
&=\sum_{i\ne p}\lambda(s)_i-(n-k-\mathbb{1}_{p\notin\mathrm{Opt}})-|E(s)\cap\mathrm{Opt}| \\
&=\mathbb{1}_{p\notin\mathrm{Opt}}-\lambda(s)_p-|E(s)\cap\mathrm{Opt}|.
\end{aligned} i ∈ / Opt ∪ { p } ∑ ( λ ( s ) i − 1 ) + i ∈ Opt ∖ ( E ( s ) ∪ { p }) ∑ λ ( s ) i = i ∈ / Opt ∪ { p } ∑ λ ( s ) i − ( n − k − 1 p ∈ / Opt ) + i ∈ Opt ∖ { p } ∑ λ ( s ) i − ∣ E ( s ) ∩ Opt ∣ = i = p ∑ λ ( s ) i − ( n − k − 1 p ∈ / Opt ) − ∣ E ( s ) ∩ Opt ∣ = 1 p ∈ / Opt − λ ( s ) p − ∣ E ( s ) ∩ Opt ∣.
The function s ↦ D ( O p t ∥ λ ( s ) ) s\mapsto D(\mathrm{Opt}\mathbin\Vert\lambda(s)) s ↦ D ( Opt ∥ λ ( s )) is absolutely continuous, so we may integrate these rates to get the total change in D D D .
If the service is a hit service, then p ∈ O p t p\in\mathrm{Opt} p ∈ Opt contributes w p x p w_px_p w p x p to the second sum in D D D , which decreases by fetch ( λ ) \operatorname{fetch}(\lambda) fetch ( λ ) during the service. The remaining pages change D D D at rate − λ ( s ) p − ∣ E ( s ) ∩ O p t ∣ ≤ 0 -\lambda(s)_p-|E(s)\cap\mathrm{Opt}|\leq0 − λ ( s ) p − ∣ E ( s ) ∩ Opt ∣ ≤ 0 , and the claim follows.
If it is a miss service, then p ∉ O p t p\notin\mathrm{Opt} p ∈ / Opt contributes w p g ( x p ) w_pg(x_p) w p g ( x p ) to the first sum, hence changing D D D by
w p ( g ( δ ) − g ( x p ) ) ≤ w p g ( δ ) < L w p . w_p\bigl(g(\delta)-g(x_p)\bigr)\leq w_pg(\delta)<Lw_p. w p ( g ( δ ) − g ( x p ) ) ≤ w p g ( δ ) < L w p .
in total. It remains to bound the change caused by the pages i ≠ p i\ne p i = p by L w p + Exc ( ν ) Lw_p+\operatorname{Exc}(\nu) L w p + Exc ( ν ) . As we showed above, the remaining pages change D D D at rate
h ( s ) : = 1 − λ ( s ) p − ∣ E ( s ) ∩ O p t ∣ ≤ 1. h(s):=1-\lambda(s)_p-|E(s)\cap\mathrm{Opt}|\leq1. h ( s ) := 1 − λ ( s ) p − ∣ E ( s ) ∩ Opt ∣ ≤ 1.
For s ≥ L ⋅ w min ( O p t ) s\geq L\cdot w_{\min}(\mathrm{Opt}) s ≥ L ⋅ w m i n ( Opt ) , (4) shows that the lightest page in O p t \mathrm{Opt} Opt is evicted, i.e., it lies in E ( s ) ∩ O p t E(s)\cap\mathrm{Opt} E ( s ) ∩ Opt . Therefore, h ( s ) ≤ − λ ( s ) p < 0 h(s)\leq-\lambda(s)_p<0 h ( s ) ≤ − λ ( s ) p < 0 . Hence the total change caused by the pages i ≠ p i\ne p i = p is
∫ 0 ∣ λ ∣ h ( s ) d s ≤ ∣ [ 0 , ∣ λ ∣ ] ∩ [ 0 , L ⋅ w min ( O p t ) ) ∣ . \int_0^{|\lambda|}h(s)\,\mathrm{d}s
\leq\left|[0,|\lambda|]\cap[0,L\cdot w_{\min}(\mathrm{Opt}))\right|. ∫ 0 ∣ λ ∣ h ( s ) d s ≤ ∣ [ 0 , ∣ λ ∣ ] ∩ [ 0 , L ⋅ w m i n ( Opt )) ∣ .
Since [ 0 , L ⋅ w min ( O p t ) ) ⊆ [ 0 , L w p ) ∪ [ L w p , L ⋅ w min ( O p t ) ) [0,L\cdot w_{\min}(\mathrm{Opt}))\subseteq[0,Lw_p)\cup[Lw_p,L\cdot w_{\min}(\mathrm{Opt})) [ 0 , L ⋅ w m i n ( Opt )) ⊆ [ 0 , L w p ) ∪ [ L w p , L ⋅ w m i n ( Opt )) , the right-hand side is at most
L w p + ∣ [ 0 , ∣ λ ∣ ] ∩ [ L w p , L ⋅ w min ( O p t ) ) ∣ = L w p + ∑ w p ≤ W < w min ( O p t ) ∣ λ ∣ W = L w p + Exc ( ν ) . Lw_p+\left|[0,|\lambda|]\cap[Lw_p,L\cdot w_{\min}(\mathrm{Opt}))\right|
=Lw_p+\sum_{w_p\leq W<w_{\min}(\mathrm{Opt})}|\lambda|_W
=Lw_p+\operatorname{Exc}(\nu). L w p + ∣ [ 0 , ∣ λ ∣ ] ∩ [ L w p , L ⋅ w m i n ( Opt )) ∣ = L w p + w p ≤ W < w m i n ( Opt ) ∑ ∣ λ ∣ W = L w p + Exc ( ν ) .
This proves the claim.
Charging to OPT
While the potential decrease pays for the cost of hit services, the potential can increase during miss services. In particular, the amortized fetch cost of a miss service on page p p p is O ( L ) ⋅ w p + Exc ( ν ) \mathcal{O}(L) \cdot w_p + \operatorname{Exc}(\nu) O ( L ) ⋅ w p + Exc ( ν ) . In this section, we argue that the first term can be charged to OPT, and give a charging argument that will later be reused to bound the excess.
By definition of a miss service, OPT does not cache the service’s page p p p at the time of the service. Moreover, since the service was triggered in the first place, the delay of the requests on p p p has exceeded its weight w p w_p w p . If OPT has already served a request on p p p and evicted the page since, we can charge w p w_p w p to OPT’s eviction. Otherwise, OPT still has to serve the requests on p p p and pays at least their delay w p w_p w p . Either way, we can charge the quantity w p w_p w p to OPT.
To make this precise, we define a notion of chargeable visits. This extends the argument from miss services also to preemptive round trips.
Definition 18 (chargeable visits). A visit of a page p p p is chargeable if, right before it,
(i) p ∉ O P T p \notin\mathrm{OPT} p ∈ / OPT and OPT has served some request on p p p that is pending for PMD, or
(ii) the total delay cost of OPT for the requests on p p p that are pending for PMD exceeds w p w_p w p .
For visits satisfying (ii), it is easy to see that their weight can be charged to OPT’s delay cost. For visits satisfying (i), OPT must have evicted the visited page after serving it. As a consequence, we can charge the weight of the visit to OPT as follows.
Lemma 19. The sum of the weights w p w_p w p of all chargeable visits on pages p p p is at most O P T + w ( O P T 0 ) \mathrm{OPT} + w(\mathrm{OPT}_0) OPT + w ( OPT 0 ) .
Proof. Let μ \mu μ be a visit on p p p at time t t t satisfying (i). Charge the cost w p w_p w p of μ \mu μ to OPT’s last eviction of p p p before μ \mu μ .
Suppose two visits μ 1 \mu_1 μ 1 before μ 2 \mu_2 μ 2 on p p p satisfying (i) are charged to the same eviction e e e . Then OPT did not evict p p p between μ 1 \mu_1 μ 1 and μ 2 \mu_2 μ 2 . Since p ∉ O P T p \notin\mathrm{OPT} p ∈ / OPT upon μ 2 \mu_2 μ 2 , OPT does not have p p p in its cache between μ 1 \mu_1 μ 1 and μ 2 \mu_2 μ 2 . Note that every request pending for PMD at μ 2 \mu_2 μ 2 must arrive after μ 1 \mu_1 μ 1 . In particular, no request pending for PMD at μ 2 \mu_2 μ 2 has been served by OPT at μ 2 \mu_2 μ 2 , contradicting (i) for μ 2 \mu_2 μ 2 . Therefore, each charged quantity w p w_p w p corresponds to a distinct eviction of OPT and the total weight of visits satisfying (i) is bounded by the total weight of OPT’s evictions. By Observation 13 , this is at most the fetch cost of OPT plus w ( O P T 0 ) w(\mathrm{OPT}_0) w ( OPT 0 ) .
Every other chargeable visit satisfies (ii), i.e., it serves requests for which OPT pays more than w p w_p w p of delay, and distinct visits serve disjoint sets of requests, so these visits have total weight at most the delay cost of OPT.
We next argue that miss services are chargeable, so that we can bound the term O ( L ) ⋅ w p \mathcal{O}(L) \cdot w_p O ( L ) ⋅ w p of their amortized cost by OPT’s cost.
Lemma 20. ∑ ν ∈ S m i s s w p ( ν ) ≤ O P T + w ( O P T 0 ) \sum_{\nu\in S_{\mathrm{miss}}} w_{p(\nu)} \leq\mathrm{OPT} + w(\mathrm{OPT}_0) ∑ ν ∈ S miss w p ( ν ) ≤ OPT + w ( OPT 0 ) .
Proof. We show that every miss service on a page p p p at time t t t is a chargeable visit, the claim then follows from Lemma 19. By definition of the trigger for critical service, we have o p > 0 o_p > 0 o p > 0 at the time of the miss service and therefore delay p ( t ) > w p \operatorname{delay}_p(t) > w_p delay p ( t ) > w p . If OPT has served some pending request on p p p , then the service satisfies (i), since p ∉ O P T p \notin\mathrm{OPT} p ∈ / OPT . Otherwise, OPT pays at least delay p ( t ) > w p \operatorname{delay}_p(t) > w_p delay p ( t ) > w p in delay cost, so the service satisfies (ii).
We can combine the above lemmas to bound the total fetch cost through a potential argument. The fetch cost of hit services is covered by the potential decrease (Proposition 17 ). The potential increase caused by OPT’s moves is at most O ( L ) \mathcal{O}(L) O ( L ) times OPT’s cost (Lemma 14 ). The fetch cost of miss services, as well as the term O ( L ) ⋅ w p \mathcal{O}(L) \cdot w_p O ( L ) ⋅ w p from the potential increase can be charged to OPT directly (Lemma 20 ). In order to bound the total fetch cost only in terms of OPT, it then remains only to bound the total excess.
Proposition 21. C f e t c h c r i t = O ( L ) ⋅ O P T + E x c + O ( L ∑ i w i ) \mathcal{C}^{\mathrm{crit}}_{\mathrm{fetch}} = \mathcal{O}(L) \cdot\mathrm{OPT} + \mathrm{Exc} + \mathcal{O}\left(L \sum_i w_i\right) C fetch crit = O ( L ) ⋅ OPT + Exc + O ( L ∑ i w i ) .
Proof. The potential D D D changes only in critical services and at Opt’s moves, since preemptive services return to the same x x x with Opt’s cache constant. By Lemma 14 and proposition 17 and since D ≥ 0 D \ge0 D ≥ 0 throughout, the total decrease in potential is at least C f e t c h c r i t C_{\mathrm{fetch}}^{\mathrm{crit}} C fetch crit , and the total increase is at most
2 L ⋅ ∑ ν ∈ S m i s s w p ( ν ) + E x c + O ( L ) ⋅ O p t + O ( L ∑ i w i ) . 2L \cdot\sum_{\nu\in S_{\mathrm{miss}}} w_{p(\nu)} + \mathrm{Exc} + O(L) \cdot\mathrm{Opt} + O\left(L \sum_i w_i\right). 2 L ⋅ ν ∈ S miss ∑ w p ( ν ) + Exc + O ( L ) ⋅ Opt + O ( L i ∑ w i ) .
Clearly, the total decrease is at most the total increase plus the initial potential. The initial potential is D ≤ ( L + 1 ) ∑ i w i = O ( L ∑ i w i ) D \le(L+1)\sum_i w_i = O(L\sum_i w_i) D ≤ ( L + 1 ) ∑ i w i = O ( L ∑ i w i ) since g ( x i ) < L g(x_i) < L g ( x i ) < L and x i ≤ 1 x_i \le1 x i ≤ 1 . It follows that
C f e t c h h i t ≤ 2 L ⋅ ∑ ν ∈ S m i s s w p ( ν ) + O ( L ) ⋅ O p t + E x c + O ( L ∑ i w i ) . C_{\mathrm{fetch}}^{\mathrm{hit}} \le2L \cdot\sum_{\nu\in S_{\mathrm{miss}}} w_{p(\nu)} + O(L) \cdot\mathrm{Opt} + \mathrm{Exc} + O\left(L \sum_i w_i\right). C fetch hit ≤ 2 L ⋅ ν ∈ S miss ∑ w p ( ν ) + O ( L ) ⋅ Opt + Exc + O ( L i ∑ w i ) .
Applying Lemma 20 to the above inequality and to C f e t c h m i s s ≤ ∑ ν ∈ S m i s s w p ( ν ) C_{\mathrm{fetch}}^{\mathrm{miss}} \le\sum_{\nu\in S_{\mathrm{miss}}} w_{p(\nu)} C fetch miss ≤ ∑ ν ∈ S miss w p ( ν ) gives
C f e t c h c r i t = C f e t c h h i t + C f e t c h m i s s ≤ O ( L ) ⋅ O p t + E x c + O ( L ∑ i w i ) . C_{\mathrm{fetch}}^{\mathrm{crit}} = C_{\mathrm{fetch}}^{\mathrm{hit}} + C_{\mathrm{fetch}}^{\mathrm{miss}} \le O(L) \cdot\mathrm{Opt} + \mathrm{Exc} + O\left(L \sum_i w_i\right). C fetch crit = C fetch hit + C fetch miss ≤ O ( L ) ⋅ Opt + Exc + O ( L i ∑ w i ) .
Bounding the excess
In this section we bound the total excess in terms of Opt. Recall that the excess contributed by a miss service on page p p p with path λ \lambda λ is ∣ λ ∣ W |\lambda|_W ∣ λ ∣ W for each level W W W with w p ≤ W < w min ( O p t ) w_p \le W < w_{\min}(\mathrm{Opt}) w p ≤ W < w m i n ( Opt ) . This is exactly the deposit of this service into the budget B W B_W B W , or L L L times the overshoot it claims, by definition of the algorithm. We bound the excess in two ways: In case Opt has already served light pages with overshoot, we argue that preemptive services see these light pages as candidates, and therefore spend their budget completely on requests that Opt has already paid for. It then suffices to bound the budgets. Otherwise, we argue that Opt has to pay for the overshoot through delay cost, and we charge the claimed overshoot to Opt. To this end, we first make this case distinction precise by defining overdue services, which are those where Opt has already served light pages with overshoot.
Definition 22 (overdue pages and services). A page q q q is overdue at time t t t if the pending requests R R R on q q q that Opt has served satisfy ∑ r ∈ R d r ( t − a r ) > w q \sum_{r \in R} d_r(t-a_r) > w_q ∑ r ∈ R d r ( t − a r ) > w q . A miss service to p p p with w p < w min ( O p t ) w_p < w_{\min}(\mathrm{Opt}) w p < w m i n ( Opt ) is overdue if some page q q q with w q ≤ w p w_q \le w_p w q ≤ w p is overdue right before it, and timely otherwise. We use these terms also for its step, and write S o v e r S_{\mathrm{over}} S over and S t i m e l y S_{\mathrm{timely}} S timely for the sets of overdue and timely steps.
Intuitively, in a timely service, Opt has not yet served the pending overshoot on light pages. Therefore, Opt also has to pay the overshoot. By definition of the algorithm, the overshoot the service claims multiplied by L L L is at least the excess contributed by the service. This way, the excess of timely services can be charged to Opt’s delay cost. The following lemma formalizes this argument.
Lemma 23 (timely services). ∑ ν ∈ S t i m e l y E x c ( ν ) ≤ L ⋅ O p t \sum_{\nu\in S_{\mathrm{timely}}} \mathrm{Exc}(\nu) \le L \cdot\mathrm{Opt} ∑ ν ∈ S timely Exc ( ν ) ≤ L ⋅ Opt .
Proof. By definition of the algorithm, every critical service with path λ \lambda λ on a page p p p of weight less than w min ( O p t ) w_{\min}(\mathrm{Opt}) w m i n ( Opt ) claims ∣ λ ∣ / L |\lambda|/L ∣ λ ∣/ L of delay and, if performed in step ν \nu ν , contributes E x c ( ν ) ≤ ∣ λ ∣ \mathrm{Exc}(\nu) \le|\lambda| Exc ( ν ) ≤ ∣ λ ∣ to the excess. Therefore, it suffices to show that the total amount claimed by timely services is at most Opt. In particular, for every page q q q , we measure the delay claimed from it between a visit of q q q or the start of the input and the last timely service that claims from it before its next visit, and show that this is at most Opt. This accounts for all claims of timely services from q q q , and possibly more.
Fix a page q q q and divide the time into intervals ( t 0 , t 1 ] (t_0,t_1] ( t 0 , t 1 ] each ending with the next visit to q q q . Since every request is eventually served, there are no requests on q q q after its last visit, with so nothing can be claimed from q q q then and it suffices to consider the time intervals ending with a visit. Fix a time interval ( t 0 , t 1 ] (t_0,t_1] ( t 0 , t 1 ] . Let μ l a s t \mu_{\mathrm{last}} μ last be the last timely service in ( t 0 , t 1 ] (t_0,t_1] ( t 0 , t 1 ] that claims a positive amount from q q q , and let t l a s t ∈ ( t 0 , t 1 ] t_{\mathrm{last}} \in(t_0,t_1] t last ∈ ( t 0 , t 1 ] be its time. If there is no such service, then the total claimed from q q q by timely services during ( t 0 , t 1 ] (t_0,t_1] ( t 0 , t 1 ] is 0 0 0 and nothing has to be shown.
Otherwise, since a claim increases c q c_q c q by at most its overshoot o q o_q o q , the claims from q q q up to μ l a s t \mu_{\mathrm{last}} μ last total at most d e l a y q ( t l a s t ) − w q \mathrm{delay}_q(t_{\mathrm{last}})-w_q delay q ( t last ) − w q , where d e l a y q \mathrm{delay}_q delay q refers to the requests pending right before μ l a s t \mu_{\mathrm{last}} μ last . Denote those requests by R R R . Assume that Opt pays delay cost less than delay q ( t l a s t ) − w q \operatorname{delay}_q(t_{\mathrm{last}})-w_q delay q ( t last ) − w q for the requests in R R R . Then the total delay of requests in R R R that Opt has served before μ l a s t \mu_{\mathrm{last}} μ last is more than w q w_q w q , so q q q is overdue right before μ l a s t \mu_{\mathrm{last}} μ last . Since μ l a s t \mu_{\mathrm{last}} μ last claims a positive amount from q q q , and a service to a page p p p claims only from pages of weight at most w p w_p w p , w q w_q w q is at most the level of μ l a s t \mu_{\mathrm{last}} μ last . Hence μ l a s t \mu_{\mathrm{last}} μ last is overdue, a contradiction. It follows that Opt pays at least delay q ( t l a s t ) − w q \operatorname{delay}_q(t_{\mathrm{last}})-w_q delay q ( t last ) − w q in delay cost of R R R , which is at least the total amount claimed from q q q . The requests R R R are served by the visit at t 1 t_1 t 1 , so every request is counted for only one time interval, and the claim follows by summing over all time intervals. □ \square □
It remains to bound the excess of overdue services through the budgets. As outlined, the excess can be bounded by the total deposit into the budgets. To bound the total excess of overdue services, it therefore suffices to bound the total paid out of budget B W B_W B W plus the remaining budget. In particular, we show that, as long as there is still an overdue service of level at most W W W to come, the budget B W B_W B W is spent on chargeable round trips, and the remaining budget is small. We split this argument by periods of Opt, defined by the times between moves of Opt.
First, we formally define periods.
Definition 24 (periods). Let t 1 < t 2 < ⋯ t_1<t_2<\cdots t 1 < t 2 < ⋯ be the times at which Opt performs a walk of positive cost, and t 0 : = − ∞ t_0:=-\infty t 0 := − ∞ . Period j j j is the time interval [ t j , t j + 1 ) [t_j,t_{j+1}) [ t j , t j + 1 ) , with t j + 1 : = ∞ t_{j+1}:=\infty t j + 1 := ∞ for the last period. Opt’s cache is constant from after its walk at t j t_j t j until before its walk at t j + 1 t_{j+1} t j + 1 . We call this cache configuration O p t j \mathrm{Opt}_j Opt j (for j = 0 j=0 j = 0 , the initial cache).
We want to argue that most of the budget is spent on chargeable round trips, except for a small remainder. To make this precise, we introduce the early part of a period w.r.t. some level W W W and prove that, during preemptive services of the early part, the budget B W B_W B W is drained (i.e., budget is spent mostly on round trips, and not only on closing the hole), and all preemptive round trips are chargeable.
Definition 25 (early part). Let j j j be a period and W < w min ( O p t j ) W<w_{\min}(\mathrm{Opt}_j) W < w m i n ( Opt j ) a level. Let ν j , W , 1 < ⋯ < ν j , W , m \nu_{j,W,1}<\cdots<\nu_{j,W,m} ν j , W , 1 < ⋯ < ν j , W , m be the steps in S o v e r S_{\mathrm{over}} S over of period j j j of level ≤ W \le W ≤ W , and call their critical services the light services. The early part of period j j j consists of all services in period j j j up to, but not including, the last light service.
Here, the light services are the overdue services that contribute to the excess at level W W W .
We next show that preemptive services of the early part drain their budget on chargeable round trips. The key argument behind this statement is that, during the early part, the last light service is still to come, and some light page q q q is overdue. In particular, the deadline of q q q has already passed. Therefore, level-W W W preemptive services do not run out of candidates, and instead drain their budget on requests with early deadlines.
Lemma 26. Every level-W W W preemptive service in the early part of period j j j performs only chargeable round trips, and ends with B W < W B_W<W B W < W .
Proof. Consider some level-W W W preemptive service μ \mu μ in the early part (i.e., before the last light service) and let p p p be a page selected for preemptive service. It is immediate that p ∉ O p t j p\notin\mathrm{Opt}_j p ∈ / Opt j , as w p ≤ W w_p\le W w p ≤ W and W < w min ( O p t j ) W<w_{\min}(\mathrm{Opt}_j) W < w m i n ( Opt j ) . If Opt has served some pending request on p p p , the round trip satisfies (i), so it remains to argue that otherwise Opt pays more than w p w_p w p of delay for the pending requests on p p p , i.e., that (ii) holds. We show this by arguing that p p p ’s effective deadline is no later than period j j j . Since Opt has not served any pending requests on p p p and does not do so until after period j j j , this would imply that the requests on p p p accrue delay of more than w p w_p w p for Opt, and therefore (ii) holds.
To this end, let t ( m ) t^{(m)} t ( m ) be the time of the last light service, and let q q q be a page with w q ≤ W w_q\le W w q ≤ W that is overdue right before it. Such a page exists by definition of overdue services. Since q q q is overdue at time t ( m ) t^{(m)} t ( m ) , Opt has served some requests on q q q that have total delay more than w q w_q w q at time t ( m ) t^{(m)} t ( m ) , and are pending at time t ( m ) t^{(m)} t ( m ) . Therefore, deadline ( q ) ≤ t ( m ) \operatorname{deadline}(q)\le t^{(m)} deadline ( q ) ≤ t ( m ) . As w q ≤ W w_q\le W w q ≤ W , and therefore q ∉ O p t j q\notin\mathrm{Opt}_j q ∈ / Opt j , these requests must have arrived no later than t j t_j t j , and are already pending during μ \mu μ and eligible for preemptive service. Since p p p is chosen for preemptive service over q q q , it must be that p p p has an effective deadline no later than q q q ’s, and therefore no later than t ( m ) ≤ t j + 1 t^{(m)}\le t_{j+1} t ( m ) ≤ t j + 1 . To show that B W < W B_W < W B W < W at the end of preemptive service, note that the considered requests on q q q remain pending throughout μ \mu μ , as they are still pending at time t ( m ) t^{(m)} t ( m ) , and q q q is eligible for preemptive service. Therefore, the loop of round trips ends before it reaches q q q , which by its condition means that B W < W B_W < W B W < W .
We combine the above lemmas into a bound on the excess terms by bounding the total budget spent in the early part, the remaining budget after the early part, and one additional term for the final overdue light service. Write C j , W C_{j,W} C j , W for the sum of w p w_p w p over the chargeable round trips of level W W W in period j j j to some page p p p .
Lemma 27. For every period j ≥ 0 j \ge0 j ≥ 0 and weight level W < w min ( O P T j ) W < w_{\min}(\mathrm{OPT}_j) W < w m i n ( OPT j ) it holds that
∑ ℓ ≤ m ∣ λ ( ν j , W , ℓ ) ∣ W ≤ 3 2 C j , W + 4 W + L W . \sum_{\ell\le m} \left|\lambda^{(\nu_{j,W,\ell})}\right|_W \le\frac{3}{2}C_{j,W} + 4W + LW. ℓ ≤ m ∑ λ ( ν j , W , ℓ ) W ≤ 2 3 C j , W + 4 W + L W .
Proof. By definition, each summand is at most L W LW L W , and we bound the last summand this way. Each of the other summands ∣ λ ( ν j , W , ℓ ) ∣ W \left|\lambda^{(\nu_{j,W,\ell})}\right|_W λ ( ν j , W , ℓ ) W is exactly the deposit of the ℓ \ell ℓ -th light service into B W B_W B W . Therefore, it suffices to show that
∑ ℓ < m ∣ λ ( ν j , W , ℓ ) ∣ W ≤ 3 2 C j , W + 4 W . (12) \sum_{\ell< m} \left|\lambda^{(\nu_{j,W,\ell})}\right|_W \le\frac{3}{2}C_{j,W} + 4W. \tag*{(12)} ℓ < m ∑ λ ( ν j , W , ℓ ) W ≤ 2 3 C j , W + 4 W . (12)
This inequality is trivial for m ≤ 1 m \le1 m ≤ 1 , so we assume henceforth that m > 1 m > 1 m > 1 . To prove (12), observe that each ℓ \ell ℓ -th light service with ℓ < m \ell< m ℓ < m lies in the early part and deposits ∣ λ ( ν j , W , ℓ ) ∣ W \left|\lambda^{(\nu_{j,W,\ell})}\right|_W λ ( ν j , W , ℓ ) W into the budget B W B_W B W , so we can bound the sum of these terms by the total paid out of B W B_W B W during the early part (i.e., the cost of preemptive service), plus the budget remaining at the end of the early part.
First, we examine the cost paid out of B W B_W B W during level-W W W preemptive services in the early part. Every such preemptive service starts with budget at least 4 W 4W 4 W , ends with budget less than W W W (by Lemma 26 ) and pays no more than W W W to close its hole. Therefore, it spends more than 2 W 2W 2 W on round trips, i.e., more than twice its closing cost. In other words, the total payment is less than 3 2 \frac{3}{2} 2 3 times the cost of the round trips. By Lemma 26 , every round trip in the early part is chargeable, and their costs sum to no more than C j , W C_{j,W} C j , W .
To prove (12), it now remains only to show that the leftover budget B W B_W B W after the early part is at most 4 W 4W 4 W . Let μ l a s t \mu_{\mathrm{last}} μ last be the last critical service of level ≤ W \le W ≤ W in the early part, which exists since the ( m − 1 ) (m-1) ( m − 1 ) -th light service is one. After μ l a s t \mu_{\mathrm{last}} μ last , its page, which has weight ≤ W \le W ≤ W , has missing mass δ \delta δ , so ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ \sum_{i:w_i\le W}(1-x_i) \ge1-\delta ∑ i : w i ≤ W ( 1 − x i ) ≥ 1 − δ . Therefore, μ l a s t \mu_{\mathrm{last}} μ last starts a level-W W W preemptive service as long as the budget B W B_W B W is at least 4 W 4W 4 W . In this case, since μ l a s t \mu_{\mathrm{last}} μ last is in the early part, this preemptive service drains the budget to less than W W W by Lemma 26 . Otherwise, B W < 4 W B_W < 4W B W < 4 W already. Subsequent services in the early part have level higher than W W W and therefore do not increase B W B_W B W . This concludes the proof.
Lemma 28 (lightest weights). ∑ j ≥ 0 w min ( O P T j ) ≤ O P T + w ( O P T 0 ) \sum_{j \ge0} w_{\min}(\mathrm{OPT}_j) \le\mathrm{OPT} + w(\mathrm{OPT}_0) ∑ j ≥ 0 w m i n ( OPT j ) ≤ OPT + w ( OPT 0 ) .
Proof. Since we assume O P T \mathrm{OPT} OPT is lazy, the last page fetched in the walk at t j t_j t j lies in O P T j \mathrm{OPT}_j OPT j , so its weight is at least w min ( O P T j ) w_{\min}(\mathrm{OPT}_j) w m i n ( OPT j ) . For j = 0 j = 0 j = 0 , w min ( O P T 0 ) ≤ w ( O P T 0 ) w_{\min}(\mathrm{OPT}_0) \le w(\mathrm{OPT}_0) w m i n ( OPT 0 ) ≤ w ( OPT 0 ) . Summing this and the distinct walks at t j t_j t j for all j ≥ 1 j \ge1 j ≥ 1 gives the claimed bound.
Finally, we can combine the lemmas from this section to derive a bound on the total excess.
Proposition 29 (total excess). E x c = O ( L ) ⋅ O P T + O ( L ∑ i w i ) \mathrm{Exc} = O(L) \cdot\mathrm{OPT} + O(L\sum_i w_i) Exc = O ( L ) ⋅ OPT + O ( L ∑ i w i ) .
Proof. Every step ν ∈ S m i s s \nu\in S_{\mathrm{miss}} ν ∈ S miss that is in neither S o v e r S_{\mathrm{over}} S over nor S t i m e l y S_{\mathrm{timely}} S timely has w p ( ν ) ≥ w min ( O P T ) w_p^{(\nu)} \ge w_{\min}(\mathrm{OPT}) w p ( ν ) ≥ w m i n ( OPT ) and therefore E x c ( ν ) = 0 \mathrm{Exc}(\nu) = 0 Exc ( ν ) = 0 , so E x c = ∑ ν ∈ S o v e r E x c ( ν ) + ∑ ν ∈ S t i m e l y E x c ( ν ) \mathrm{Exc} = \sum_{\nu\in S_{\mathrm{over}}} \mathrm{Exc}(\nu) + \sum_{\nu\in S_{\mathrm{timely}}} \mathrm{Exc}(\nu) Exc = ∑ ν ∈ S over Exc ( ν ) + ∑ ν ∈ S timely Exc ( ν ) . By Lemma 23 , timely services
contribute at most L ⋅ O p t L \cdot\mathrm{Opt} L ⋅ Opt to the excess. Every step ν ∈ S o v e r \nu\in S_{\mathrm{over}} ν ∈ S over in period j j j contributes to E x c \mathrm{Exc} Exc only at levels W W W with w p ( ν ) ≤ W < w min ( O p t j ) w_{p(\nu)} \le W < w_{\min}(\mathrm{Opt}_j) w p ( ν ) ≤ W < w m i n ( Opt j ) , and for each such level, ν = ν j , W , ℓ \nu= \nu_{j,W,\ell} ν = ν j , W , ℓ for some ℓ \ell ℓ . Hence,
∑ ν ∈ S o v e r E x c ( ν ) ≤ ∑ j ≥ 0 ∑ W < w min ( O p t j ) ∑ ℓ ∣ λ ( ν j , W , ℓ ) ∣ W . \sum_{\nu\in S_{\mathrm{over}}} \mathrm{Exc}(\nu) \le\sum_{j \ge0} \sum_{W < w_{\min}(\mathrm{Opt}_j)} \sum_{\ell} \left|\lambda^{(\nu_{j,W,\ell})}\right| W. ν ∈ S over ∑ Exc ( ν ) ≤ j ≥ 0 ∑ W < w m i n ( Opt j ) ∑ ℓ ∑ λ ( ν j , W , ℓ ) W .
Applying Lemma 27 gives
∑ ν ∈ S o v e r E x c ( ν ) ≤ ∑ j ≥ 0 ∑ W < w min ( O p t j ) ( 3 2 C j , W + ( L + 4 ) W ) . \sum_{\nu\in S_{\mathrm{over}}} \mathrm{Exc}(\nu) \le\sum_{j \ge0} \sum_{W < w_{\min}(\mathrm{Opt}_j)} \left(\frac{3}{2} C_{j,W} + (L+4)W\right). ν ∈ S over ∑ Exc ( ν ) ≤ j ≥ 0 ∑ W < w m i n ( Opt j ) ∑ ( 2 3 C j , W + ( L + 4 ) W ) .
Lemma 19 gives the bound ∑ j , W C j , W ≤ O p t + w ( O p t 0 ) \sum_{j,W} C_{j,W} \le\mathrm{Opt} + w(\mathrm{Opt}_0) ∑ j , W C j , W ≤ Opt + w ( Opt 0 ) . For the terms ( L + 4 ) W (L+4)W ( L + 4 ) W , observe that for every j j j , since weight levels are distinct powers of two,
∑ W < w min ( O p t j ) W < w min ( O p t j ) . \sum_{W < w_{\min}(\mathrm{Opt}_j)} W < w_{\min}(\mathrm{Opt}_j). W < w m i n ( Opt j ) ∑ W < w m i n ( Opt j ) .
Applying Lemma 28 yields
∑ j ≥ 0 ∑ W < w min ( O p t j ) W ≤ O p t + w ( O p t 0 ) . \sum_{j \ge0} \sum_{W < w_{\min}(\mathrm{Opt}_j)} W \le\mathrm{Opt} + w(\mathrm{Opt}_0). j ≥ 0 ∑ W < w m i n ( Opt j ) ∑ W ≤ Opt + w ( Opt 0 ) .
Combining the above inequalities gives the claimed bound
E x c ≤ L ⋅ O p t + 3 2 ( O p t + w ( O p t 0 ) ) + ( L + 4 ) ( O p t + w ( O p t 0 ) ) = O ( L ) ⋅ O p t + O ( L ∑ i w i ) . \mathrm{Exc} \le L \cdot\mathrm{Opt} + \frac{3}{2}\bigl(\mathrm{Opt} + w(\mathrm{Opt}_0)\bigr) + (L+4)\bigl(\mathrm{Opt} + w(\mathrm{Opt}_0)\bigr) = O(L) \cdot\mathrm{Opt} + O\left(L \sum_i w_i\right). Exc ≤ L ⋅ Opt + 2 3 ( Opt + w ( Opt 0 ) ) + ( L + 4 ) ( Opt + w ( Opt 0 ) ) = O ( L ) ⋅ Opt + O ( L i ∑ w i ) .
Proof of the main theorem
Combining the results from the above sections gives that PMD has fractional fetch and delay cost
O ( log k ) ⋅ O p t + O ( log k ∑ i w i ) . O(\log k) \cdot\mathrm{Opt} + O\left(\log k \sum_i w_i\right). O ( log k ) ⋅ Opt + O ( log k i ∑ w i ) .
It remains to transform this online into a feasible randomized integral algorithm. We do so by combining the online rounding theorem from [4 ] with a rounding map similar to the one from [9 ] . The proof can be found in Appendix § 10 .
Proposition 30 (rounding; proof in Section A). Let the weights be powers of two, and let C f e t c h C_{\mathrm{fetch}} C fetch and C d e l a y C_{\mathrm{delay}} C delay be the fractional fetch and delay cost of PMD (Definitions 4 and 8 ). Then the states of PMD can be converted online into a randomized integral algorithm that serves every request with probability 1, has expected fetch cost O ( C f e t c h + ∑ i w i ) O(C_{\mathrm{fetch}} + \sum_i w_i) O ( C fetch + ∑ i w i ) , and expected delay cost at most 3 C d e l a y 3C_{\mathrm{delay}} 3 C delay .
Proof sketch. First, we apply the transformation z i : = max { 0 , 2 1 − x i 1 − δ − 1 } z_i := \max\left\{0, 2^{\frac{1-x_i}{1-\delta}} - 1\right\} z i := max { 0 , 2 1 − δ 1 − x i − 1 } to the fractional antimass states to get new states describing the cached masses. This transformation maps antimass δ \delta δ to cached mass 0, so that every page with antimass δ \delta δ is fully cached. Moreover, the total cached mass is at most k k k , and the transformation is 3-Lipschitz (Lemma 33 ). It follows that the transformed states are valid fractional cache states that respect the serving times τ r \tau_r τ r we planned.
The online rounding of Bansal, Buchbinder, and Naor then transforms the fractional cache states into random cache choices that contain every page with probability equal to its cached mass and realize the fractional fetch cost up to a constant factor (Corollary 32). In particular, a request r r r on p p p is served at the latest at τ r \tau_r τ r , when x p = δ x_p = \delta x p = δ and p p p is cached with probability 1. When r r r arrives, p p p is not cached with probability at most 1 − z p ≤ 3 ( x p − δ ) = 3 α r 1-z_p \le3(x_p-\delta) = 3\alpha_r 1 − z p ≤ 3 ( x p − δ ) = 3 α r , so the expected delay of r r r is at most 3 α r d r ( τ r − a r ) 3\alpha_r d_r(\tau_r-a_r) 3 α r d r ( τ r − a r ) . This justifies that the fractional delay cost weights the delay by α r \alpha_r α r . The full proof is in Section A. □ \square □
Applying this rounding scheme gives the desired O ( log k ) O(\log k) O ( log k ) -competitive randomized algorithm.
Proof of Theorem 1. First, we round the weights up to powers of two. This at most doubles O p t \mathrm{Opt} Opt and ∑ i w i \sum_i w_i ∑ i w i , and does not decrease the cost of any algorithm. By Proposition 21 and Proposition 29, it holds on every instance that
C f e t c h c r i t ≤ O ( L ) ⋅ O p t + O ( L ∑ i w i ) = O ( log k ) ⋅ O p t + O ( log k ∑ i w i ) . C_{\mathrm{fetch}}^{\mathrm{crit}} \le O(L) \cdot\mathrm{Opt} + O\left(L\sum_i w_i\right) = O(\log k) \cdot\mathrm{Opt} + O\left(\log k\sum_i w_i\right). C fetch crit ≤ O ( L ) ⋅ Opt + O ( L i ∑ w i ) = O ( log k ) ⋅ Opt + O ( log k i ∑ w i ) .
Proposition 12 with ρ = O ( log k ) \rho= O(\log k) ρ = O ( log k ) and c = O ( log k ∑ i w i ) c = O\left(\log k\sum_i w_i\right) c = O ( log k ∑ i w i ) then gives
C f e t c h + C d e l a y ≤ O ( log k ) ⋅ O p t + O ( log k ∑ i w i ) . C_{\mathrm{fetch}} + C_{\mathrm{delay}} \le O(\log k) \cdot\mathrm{Opt} + O\left(\log k\sum_i w_i\right). C fetch + C delay ≤ O ( log k ) ⋅ Opt + O ( log k i ∑ w i ) .
By Proposition 30 , the states of PMD can be converted online into a randomized integral algorithm that serves every request with probability 1 and has expected cost at most
O ( C f e t c h + ∑ i w i ) + 3 C d e l a y ≤ O ( log k ) ⋅ O p t + O ( log k ∑ i w i ) . O\left(C_{\mathrm{fetch}} + \sum_i w_i\right) + 3C_{\mathrm{delay}} \le O(\log k) \cdot\mathrm{Opt} + O\left(\log k\sum_i w_i\right). O ( C fetch + i ∑ w i ) + 3 C delay ≤ O ( log k ) ⋅ Opt + O ( log k i ∑ w i ) .
The additive term depends only on k k k and the weights, not on the requests, so this algorithm is O ( log k ) O(\log k) O ( log k ) -competitive. □
Disclosure of AI usage
An initial draft of this paper was written by Claude Opus 5.5 based on two proofs written by the authors. The first showed the competitive ratio O ( log k ) O(\log k) O ( log k ) for an algorithm based on mirror descent for paging with deadlines in two special cases: when there are only two weight classes, and when the loaded page is the heaviest page. The second contained a fully potential-based analysis of the result from [3 ] , specialized to paging with deadlines, giving a potential that amortizes the cost difference between paging with and without delay, and that was then used in the initial draft of this paper. Claude Opus extended our results to general weights and delays, in particular by introducing weight classes explicitly and depositing preemptive service budgets based on these weight classes. This paper was written entirely by the authors, based on the initial draft written by Claude Opus. The authors independently checked all resulting proofs and take full responsibility for the content and accuracy of the paper, including any errors that may remain.
Rounding
For classical weighted paging, Bansal, Buchbinder, and Naor [4 ] round a fractional algorithm online: they maintain a random cache so that the probability that a page is cached is exactly its fractional cached mass. Their rounding procedure changes the algorithm’s cost by only a constant factor.
In this section, we show that their rounding procedure can be applied to the fractional states of PMD after applying a fixed transformation to the fractional states. This yields the desired randomized algorithm with only a constant factor increase in cost.
Theorem 31 ([4 Theorem 4.1] ). Let the weights ω i \omega_i ω i be such that ω i + 1 / ω i ≥ 2 \omega_{i+1}/\omega_i \ge2 ω i + 1 / ω i ≥ 2 for 1 ≤ i ≤ K − 1 1 \le i \le K-1 1 ≤ i ≤ K − 1 . There is a subclass D \mathcal{D} D of distributions on cache states, along with a map T T T from ( D × P ) → D (\mathcal{D} \times\mathcal{P}) \to\mathcal{D} ( D × P ) → D with the following property: Given any two distributions on pages y , y ~ ∈ P y,\tilde{y} \in\mathcal{P} y , y ~ ∈ P , and given any Q ∈ D Q \in\mathcal{D} Q ∈ D satisfying Π ( Q ) = y \Pi(Q)=y Π ( Q ) = y , we can obtain another distribution Q ~ = T ( Q , y ~ ) \tilde{Q}=T(Q,\tilde{y}) Q ~ = T ( Q , y ~ ) such that Π ( Q ~ ) = y ~ \Pi(\tilde{Q})=\tilde{y} Π ( Q ~ ) = y ~ , Q ~ ∈ D \tilde{Q} \in\mathcal{D} Q ~ ∈ D and cost ( Q , Q ~ ) ≤ 5 cost f ( y , y ~ ) \operatorname{cost}(Q,\tilde{Q}) \le5\operatorname{cost}_{f}(y,\tilde{y}) cost ( Q , Q ~ ) ≤ 5 cost f ( y , y ~ ) *.
In Theorem 31, the notation is as follows.
ω 1 < ⋯ < ω K \omega_1 < \cdots< \omega_K ω 1 < ⋯ < ω K the distinct page weights.
cache state a set of k k k pages.
Q , Q ~ Q,\tilde{Q} Q , Q ~ probability distributions on cache states, i.e., Q Q Q gives for every cache state C C C the probability that the random cache is C C C .
P \mathcal{P} P the vectors y ∈ [ 0 , 1 ] n y \in[0,1]^n y ∈ [ 0 , 1 ] n with ∑ i y i = k \sum_i y_i=k ∑ i y i = k , which [4 ] call distributions on pages ; y i y_i y i is the cached mass of page i i i .
Π ( Q ) \Pi(Q) Π ( Q ) the marginals of Q Q Q : Π ( Q ) i \Pi(Q)_i Π ( Q ) i is the probability that page i i i is in a random cache with distribution Q Q Q .
D \mathcal{D} D a subclass of the distributions on cache states, constructed in [4 ] , whose definition we do not need.
cost ( Q , Q ~ ) \operatorname{cost}(Q,\tilde{Q}) cost ( Q , Q ~ ) the minimum expected cost of a transition from Q Q Q to Q ~ \tilde{Q} Q ~ , i.e., of a rule that says, for every current cache state, with which probability to move to each cache state, such that a cache with distribution Q Q Q ends up with distribution Q ~ \tilde{Q} Q ~ . Fetching and evicting page i i i each cost ω i 2 \frac{\omega_i}{2} 2 ω i (the convention of [4 ] ).
cost f ( y , y ~ ) \operatorname{cost}_{f}(y,\tilde{y}) cost f ( y , y ~ ) ∑ i ω i 2 ∣ y i − y ~ i ∣ \sum_i \frac{\omega_i}{2}|y_i-\tilde{y}_i| ∑ i 2 ω i ∣ y i − y ~ i ∣ , the cost of moving fractional mass from y y y to y ~ \tilde{y} y ~ in the same convention.
T T T the update rule: it picks the next distribution T ( Q , y ~ ) T(Q,\tilde{y}) T ( Q , y ~ ) from the current one and the new marginals.
In the notation of this paper, Theorem 31 gives the following.
Corollary 32 (online rounding). Let the weights be powers of two, and let y ( 0 ) , … , y ( N ) ∈ [ 0 , 1 ] n y^{(0)},\ldots,y^{(N)} \in[0,1]^n y ( 0 ) , … , y ( N ) ∈ [ 0 , 1 ] n with ∑ i y i ( ν ) = k \sum_i y_i^{(\nu)}=k ∑ i y i ( ν ) = k be given online, where y ( 0 ) y^{(0)} y ( 0 ) is the indicator vector of OPT 0 \operatorname{OPT}_0 OPT 0 . Then one can choose random sets C ( 0 ) , … , C ( N ) C^{(0)},\ldots,C^{(N)} C ( 0 ) , … , C ( N ) of k k k pages online, i.e., each C ( ν ) C^{(\nu)} C ( ν ) depends only on y ( 0 ) , … , y ( ν ) y^{(0)},\ldots,y^{(\nu)} y ( 0 ) , … , y ( ν ) and random choices made up to then. They satisfy C ( 0 ) = OPT 0 C^{(0)}=\operatorname{OPT}_0 C ( 0 ) = OPT 0 , Pr [ i ∈ C ( ν ) ] = y i ( ν ) \Pr[i \in C^{(\nu)}]=y_i^{(\nu)} Pr [ i ∈ C ( ν ) ] = y i ( ν ) for all ν \nu ν and all pages i i i , and
E [ ∑ i ∈ C ( ν + 1 ) ∖ C ( ν ) ω i ] ≤ 5 ∑ i ω i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ for all ν < N . \mathbb{E}\left[\sum_{i\in C^{(\nu+1)}\setminus C^{(\nu)}}\omega_i\right]\le5\sum_i\omega_i\left|y_i^{(\nu+1)}-y_i^{(\nu)}\right|\qquad\text{for all }\nu<N. E i ∈ C ( ν + 1 ) ∖ C ( ν ) ∑ ω i ≤ 5 i ∑ ω i y i ( ν + 1 ) − y i ( ν ) for all ν < N .
Proof. The assumptions of Theorem 31 hold: as the distinct weights are powers of two, ω i + 1 / ω i ≥ 2 \omega_{i+1}/\omega_i \ge2 ω i + 1 / ω i ≥ 2 , and every y ( ν ) y^{(\nu)} y ( ν ) lies in P P P . By the proof of [4 Theorem 4.1] , D D D contains a distribution Q ( 0 ) Q^{(0)} Q ( 0 ) with Π ( Q ( 0 ) ) = y ( 0 ) \Pi(Q^{(0)}) = y^{(0)} Π ( Q ( 0 ) ) = y ( 0 ) . As y ( 0 ) y^{(0)} y ( 0 ) is the indicator vector of O p t 0 \mathrm{Opt}_0 Opt 0 , Q ( 0 ) Q^{(0)} Q ( 0 ) gives probability 1 1 1 to the cache state O p t 0 \mathrm{Opt}_0 Opt 0 , so we can let C ( 0 ) : = O p t 0 C^{(0)} := \mathrm{Opt}_0 C ( 0 ) := Opt 0 . Given C ( ν ) C^{(\nu)} C ( ν ) with distribution Q ( ν ) ∈ D Q^{(\nu)} \in D Q ( ν ) ∈ D , let
Q ( ν + 1 ) : = T ( Q ( ν ) , y ( ν + 1 ) ) , Q^{(\nu+1)} := T\left(Q^{(\nu)}, y^{(\nu+1)}\right), Q ( ν + 1 ) := T ( Q ( ν ) , y ( ν + 1 ) ) ,
and obtain C ( ν + 1 ) C^{(\nu+1)} C ( ν + 1 ) by applying a cheapest transition from Q ( ν ) Q^{(\nu)} Q ( ν ) to Q ( ν + 1 ) Q^{(\nu+1)} Q ( ν + 1 ) to the current cache C ( ν ) C^{(\nu)} C ( ν ) . As C ( ν ) C^{(\nu)} C ( ν ) has distribution Q ( ν ) Q^{(\nu)} Q ( ν ) , this gives, at expected cost cost ( Q ( ν ) , Q ( ν + 1 ) ) \operatorname{cost}(Q^{(\nu)}, Q^{(\nu+1)}) cost ( Q ( ν ) , Q ( ν + 1 ) ) , a cache C ( ν + 1 ) C^{(\nu+1)} C ( ν + 1 ) with distribution Q ( ν + 1 ) Q^{(\nu+1)} Q ( ν + 1 ) . By Theorem 31, Q ( ν + 1 ) ∈ D Q^{(\nu+1)} \in D Q ( ν + 1 ) ∈ D , so that this can be repeated, and Pr [ i ∈ C ( ν + 1 ) ] = Π ( Q ( ν + 1 ) ) i = y i ( ν + 1 ) \Pr[i \in C^{(\nu+1)}] = \Pi(Q^{(\nu+1)})_i = y_i^{(\nu+1)} Pr [ i ∈ C ( ν + 1 ) ] = Π ( Q ( ν + 1 ) ) i = y i ( ν + 1 ) . As Q ( ν + 1 ) Q^{(\nu+1)} Q ( ν + 1 ) depends only on y ( 0 ) , … , y ( ν + 1 ) y^{(0)}, \ldots, y^{(\nu+1)} y ( 0 ) , … , y ( ν + 1 ) , the sets are chosen online.
Finally, cost ( Q ( ν ) , Q ( ν + 1 ) ) \operatorname{cost}(Q^{(\nu)}, Q^{(\nu+1)}) cost ( Q ( ν ) , Q ( ν + 1 ) ) charges w i 2 \frac{w_i}{2} 2 w i for every fetched page i ∈ C ( ν + 1 ) ∖ C ( ν ) i \in C^{(\nu+1)} \setminus C^{(\nu)} i ∈ C ( ν + 1 ) ∖ C ( ν ) , so by Theorem 31,
E [ ∑ i ∈ C ( ν + 1 ) ∖ C ( ν ) w i ] ≤ 2 cost ( Q ( ν ) , Q ( ν + 1 ) ) ≤ 10 cost f ( y ( ν ) , y ( ν + 1 ) ) = 5 ∑ i w i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ . \mathbb{E}\left[\sum_{i \in C^{(\nu+1)} \setminus C^{(\nu)}} w_i\right] \le2\operatorname{cost}(Q^{(\nu)}, Q^{(\nu+1)}) \le10\operatorname{cost}_f\left(y^{(\nu)}, y^{(\nu+1)}\right) = 5\sum_i w_i\left|y_i^{(\nu+1)} - y_i^{(\nu)}\right|. E i ∈ C ( ν + 1 ) ∖ C ( ν ) ∑ w i ≤ 2 cost ( Q ( ν ) , Q ( ν + 1 ) ) ≤ 10 cost f ( y ( ν ) , y ( ν + 1 ) ) = 5 i ∑ w i y i ( ν + 1 ) − y i ( ν ) .
The cached masses 1 − x i 1-x_i 1 − x i of our fractional algorithm do not fit Corollary 32 directly: a page with x i = δ x_i=\delta x i = δ is not fully cached, and the total cached mass may be less than k k k . For the first issue, we stretch the cached mass by 1 1 − δ \frac{1}{1-\delta} 1 − δ 1 , which makes such pages fully cached but may overshoot k k k by 1 2 \frac{1}{2} 2 1 , and remove the overshoot by doubling and subtracting 1.
Lemma 33. Let x ∈ [ δ , 1 ] n x \in[\delta,1]^n x ∈ [ δ , 1 ] n with ∑ i x i ≥ n − k \sum_i x_i \ge n-k ∑ i x i ≥ n − k . Define u i : = ( 1 − x i ) / ( 1 − δ ) u_i := (1-x_i)/(1-\delta) u i := ( 1 − x i ) / ( 1 − δ ) and z i : = max { 0 , 2 u i − 1 } z_i := \max\{0,2u_i-1\} z i := max { 0 , 2 u i − 1 } . Then z ∈ [ 0 , 1 ] n z \in[0,1]^n z ∈ [ 0 , 1 ] n , z i = 1 z_i=1 z i = 1 if x i = δ x_i=\delta x i = δ , ∑ i z i ≤ k \sum_i z_i \le k ∑ i z i ≤ k , and each z i z_i z i is a nonincreasing, 3-Lipschitz function of x i x_i x i .
Proof. As x i ∈ [ δ , 1 ] x_i \in[\delta,1] x i ∈ [ δ , 1 ] , we have u i ∈ [ 0 , 1 ] u_i \in[0,1] u i ∈ [ 0 , 1 ] and hence z i ∈ [ 0 , 1 ] z_i \in[0,1] z i ∈ [ 0 , 1 ] . If x i = δ x_i=\delta x i = δ , then
z i = max { 0 , 2 ⋅ ( 1 − δ ) / ( 1 − δ ) − 1 } = 1. z_i=\max\{0,2\cdot(1-\delta)/(1-\delta)-1\}=1. z i = max { 0 , 2 ⋅ ( 1 − δ ) / ( 1 − δ ) − 1 } = 1.
As a function of x i x_i x i , z i z_i z i is piecewise linear with slopes 0 0 0 and − 2 1 − δ = − 2 − 1 k ≥ − 3 -\frac{2}{1-\delta}=-2-\frac{1}{k}\ge-3 − 1 − δ 2 = − 2 − k 1 ≥ − 3 , hence nonincreasing and 3-Lipschitz. We have ∑ i u i ≤ k 1 − δ = k ⋅ 2 k + 1 2 k = k + 1 2 \sum_i u_i\le\frac{k}{1-\delta}=k\cdot\frac{2k+1}{2k}=k+\frac{1}{2} ∑ i u i ≤ 1 − δ k = k ⋅ 2 k 2 k + 1 = k + 2 1 . If at most k k k pages have u i > 1 2 u_i>\frac{1}{2} u i > 2 1 , then only those pages have z i > 0 z_i>0 z i > 0 and hence ∑ i z i ≤ k \sum_i z_i\le k ∑ i z i ≤ k . Otherwise, ∑ i z i ≤ 2 ( k + 1 2 ) − ( k + 1 ) = k \sum_i z_i\le2(k+\frac{1}{2})-(k+1)=k ∑ i z i ≤ 2 ( k + 2 1 ) − ( k + 1 ) = k .
For the second issue, we transform the fractional sequence to be lazy: we keep a state y ≥ z y\ge z y ≥ z of total mass exactly k k k , and decrease y i y_i y i only when its mass is needed on other pages.
Proposition 30 (rounding; proof in Section A). Let the weights be powers of two, and let C f e t c h C_{\mathrm{fetch}} C fetch and C d e l a y C_{\mathrm{delay}} C delay be the fractional fetch and delay cost of PMD (Definitions 4 and 8). Then the states of PMD can be converted online into a randomized integral algorithm that serves every request with probability 1, has expected fetch cost O ( C f e t c h + ∑ i w i ) O(C_{\mathrm{fetch}}+\sum_i w_i) O ( C fetch + ∑ i w i ) , and expected delay cost at most 3 C d e l a y 3C_{\mathrm{delay}} 3 C delay .
Proof of Proposition 30. By Lemma 2, every state x ( ν ) x^{(\nu)} x ( ν ) of PMD satisfies x ( ν ) ∈ [ δ , 1 ] n x^{(\nu)}\in[\delta,1]^n x ( ν ) ∈ [ δ , 1 ] n and has total antimass ∑ i x i ( ν ) ≥ n − k \sum_i x_i^{(\nu)}\ge n-k ∑ i x i ( ν ) ≥ n − k , so we can apply Lemma 33 to it. Let z ( ν ) : = z ( x ( ν ) ) z^{(\nu)}:=z(x^{(\nu)}) z ( ν ) := z ( x ( ν ) ) be as in Lemma 33. Before we can apply Corollary 32, we first need to transform the states into a lazy strategy so that the total cached mass is exactly k k k .
To this end, let y ( 0 ) : = z ( 0 ) y^{(0)}:=z^{(0)} y ( 0 ) := z ( 0 ) , and obtain y ( ν + 1 ) y^{(\nu+1)} y ( ν + 1 ) from z ( ν + 1 ) z^{(\nu+1)} z ( ν + 1 ) by increasing coordinates that are smaller than in y ( ν ) y^{(\nu)} y ( ν ) until ∑ i y i ( ν + 1 ) = k \sum_i y_i^{(\nu+1)}=k ∑ i y i ( ν + 1 ) = k (i.e., mass is only removed from coordinates when the total mass would otherwise be < k <k < k ). This transformation is online, since y ( ν + 1 ) y^{(\nu+1)} y ( ν + 1 ) depends only on y ( ν ) y^{(\nu)} y ( ν ) and x ( ν + 1 ) x^{(\nu+1)} x ( ν + 1 ) . The vectors y ( ν ) y^{(\nu)} y ( ν ) have total mass k k k and lie in [ 0 , 1 ] n [0,1]^n [ 0 , 1 ] n . We let the initial state of PMD be x ( 0 ) x^{(0)} x ( 0 ) such that x i = δ x_i=\delta x i = δ for i ∈ O p t 0 i\in\mathrm{Opt}_0 i ∈ Opt 0 , x i = 1 − k δ = ( k + 1 ) δ x_i=1-k\delta=(k+1)\delta x i = 1 − k δ = ( k + 1 ) δ for some page i ∉ O p t 0 i\notin\mathrm{Opt}_0 i ∈ / Opt 0 , and x i = 1 x_i=1 x i = 1 for all other pages. Applying Lemma 33 gives that y ( 0 ) = z ( 0 ) y^{(0)}=z^{(0)} y ( 0 ) = z ( 0 ) is the indicator vector of O p t 0 \mathrm{Opt}_0 Opt 0 . Therefore, Corollary 32 can be applied and gives an online randomized integral algorithm that starts with the cache O p t 0 \mathrm{Opt}_0 Opt 0 and whose cache C ( ν ) C^{(\nu)} C ( ν ) at the state x ( ν ) x^{(\nu)} x ( ν ) contains each page i i i with probability y i ( ν ) y_i^{(\nu)} y i ( ν ) . We now bound the expected fetch cost of this algorithm by 30 C f e t c h + 5 ∑ i w i 30C_{\mathrm{fetch}}+5\sum_i w_i 30 C fetch + 5 ∑ i w i . By Corollary 32, it is at most 5 ∑ ν < N ∑ i w i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ 5\sum_{\nu<N}\sum_i w_i\lvert y_i^{(\nu+1)}-y_i^{(\nu)}\rvert 5 ∑ ν < N ∑ i w i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ . As every y i y_i y i starts at most 1 and stays nonnegative, its total decrease is at most its total increase plus 1, so
5 ∑ ν < N ∑ i w i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ ≤ 10 ∑ ν < N ∑ i w i ( y i ( ν + 1 ) − y i ( ν ) ) + + 5 ∑ i w i . 5\sum_{\nu<N}\sum_i w_i\lvert y_i^{(\nu+1)}-y_i^{(\nu)}\rvert\le10\sum_{\nu<N}\sum_i w_i\left(y_i^{(\nu+1)}-y_i^{(\nu)}\right)_+ + 5\sum_i w_i. 5 ν < N ∑ i ∑ w i ∣ y i ( ν + 1 ) − y i ( ν ) ∣ ≤ 10 ν < N ∑ i ∑ w i ( y i ( ν + 1 ) − y i ( ν ) ) + + 5 i ∑ w i .
By the definition of C f e t c h C_{\mathrm{fetch}} C fetch (Definition 4 ), it remains to show that y i y_i y i increases at most 3 times as much as x i x_i x i decreases. As y i y_i y i is raised only up to z i ( ν + 1 ) z_i^{(\nu+1)} z i ( ν + 1 ) and y i ( ν ) ≥ z i ( ν ) y_i^{(\nu)}\ge z_i^{(\nu)} y i ( ν ) ≥ z i ( ν ) , it increases at most as much as z i z_i z i . As z i z_i z i is a nonincreasing, 3-Lipschitz function of x i x_i x i (Lemma 33 ), z i z_i z i in turn increases at most 3 times as much as x i x_i x i decreases. Hence, for all ν < N \nu<N ν < N and all pages i i i ,
( y i ( ν + 1 ) − y i ( ν ) ) + ≤ ( z i ( ν + 1 ) − z i ( ν ) ) + ≤ 3 ( x i ( ν ) − x i ( ν + 1 ) ) + . \left(y_i^{(\nu+1)}-y_i^{(\nu)}\right)_+ \le\left(z_i^{(\nu+1)}-z_i^{(\nu)}\right)_+ \le3\left(x_i^{(\nu)}-x_i^{(\nu+1)}\right)_+. ( y i ( ν + 1 ) − y i ( ν ) ) + ≤ ( z i ( ν + 1 ) − z i ( ν ) ) + ≤ 3 ( x i ( ν ) − x i ( ν + 1 ) ) + .
Finally, we bound the expected delay cost of every request r r r by 3 α r d r ( τ r − a r ) 3\alpha_r d_r(\tau_r-a_r) 3 α r d r ( τ r − a r ) . Let r r r be a request on p p p , x x x be the fractional state right before time a r a_r a r , so that α r = x p − δ \alpha_r=x_p-\delta α r = x p − δ (Definition 8 ), and let C C C be the random cache right before a r a_r a r . If p ∈ C p\in C p ∈ C , then r r r is served at time a r a_r a r with no delay cost. Otherwise, r r r is served no later than at τ r \tau_r τ r , where x p = δ x_p=\delta x p = δ , so z p = 1 z_p=1 z p = 1 and p p p is cached with probability y p ≥ z p = 1 y_p\ge z_p=1 y p ≥ z p = 1 . The delay cost of r r r then is at most d r ( τ r − a r ) d_r(\tau_r-a_r) d r ( τ r − a r ) . Therefore, it suffices to show Pr [ p ∉ C ] ≤ 3 α r \Pr[p\notin C]\le3\alpha_r Pr [ p ∈ / C ] ≤ 3 α r . By Lemma 33 , z p z_p z p is a 3-Lipschitz function of x p x_p x p with value 1 at x p = δ x_p=\delta x p = δ , hence
Pr [ p ∉ C ] = 1 − y p ≤ y p ≥ z p 1 − z p ( x ) ≤ 3 ( x p − δ ) = 3 α r . \Pr[p\notin C]=1-y_p \underset{y_p\ge z_p}{\le} 1-z_p(x)\le3(x_p-\delta)=3\alpha_r. Pr [ p ∈ / C ] = 1 − y p y p ≥ z p ≤ 1 − z p ( x ) ≤ 3 ( x p − δ ) = 3 α r .
Summed over all requests, the expected delay cost is at most 3 C d e l a y 3C_{\mathrm{delay}} 3 C delay .
Why δ = 1 / ( 2 k + 1 ) \delta= 1/(2k+1) δ = 1/ ( 2 k + 1 )
The lower bound Ω ( log k ) \Omega(\log k) Ω ( log k ) from classical paging proves that no choice δ ≠ 1 2 k + 1 \delta\ne\frac{1}{2k+1} δ = 2 k + 1 1 can give a better competitive guarantee than that achieved with δ = 1 2 k + 1 \delta=\frac{1}{2k+1} δ = 2 k + 1 1 . However, to motivate this choice also based on the analysis itself, this section gives a more direct argument that our analysis of PMD cannot be improved by choosing a different δ \delta δ .
The threshold δ \delta δ enters the analysis of PMD in two places. The fractional analysis loses a factor of order L = log 1 δ L=\log\frac{1}{\delta} L = log δ 1 , so it favors a large δ \delta δ . This factor is inherent to the potential argument: when Opt evicts a page i i i with antimass δ \delta δ , the potential D D D increases by w i ( L − 1 ) w_i(L-1) w i ( L − 1 ) (proof of Lemma 14 ). The rounding, in contrast, has to treat antimass δ \delta δ as fully cached while caching at most k k k pages, which forces δ < 1 k + 1 \delta<\frac{1}{k+1} δ < k + 1 1 : otherwise, the state with antimass δ \delta δ on k + 1 k+1 k + 1 pages and 1 on all other pages has total antimass ( k + 1 ) δ + n − k − 1 ≥ n − k (k+1)\delta+n-k-1\ge n-k ( k + 1 ) δ + n − k − 1 ≥ n − k , but the rounding would have to cache all k + 1 k+1 k + 1 of these pages. Hence, L > log ( k + 1 ) L>\log(k+1) L > log ( k + 1 ) for every admissible δ \delta δ , so no choice of δ \delta δ lets this analysis lose less than order log k \log k log k .
Why simpler rules for when to serve fail
The following examples motivate why we use (5) to determine when to perform critical service. For convenience, we recall that p p p becomes critical when
( delay p ( t ) − c p − w p ) + > 0 and ∑ q : w q ≤ w p ( delay q ( t ) − c q − w q ) + ≥ ∣ λ x → p ∣ / L . \left(\operatorname{delay}_p(t)-c_p-w_p\right)_+>0
\qquad\text{and}\qquad
\sum_{q:\,w_q\le w_p}\left(\operatorname{delay}_q(t)-c_q-w_q\right)_+\ge\lvert\lambda_{x\to p}\rvert/L. ( delay p ( t ) − c p − w p ) + > 0 and q : w q ≤ w p ∑ ( delay q ( t ) − c q − w q ) + ≥ ∣ λ x → p ∣ / L .
Example 34 (Dependence on ∣ λ x → p ∣ \lvert\lambda_{x\to p}\rvert ∣ λ x → p ∣ ). This example shows that the rule for performing critical service must not depend only on the weight of the page and its delay.
Let k = 1 k=1 k = 1 , and let there be a heavy and a light page h h h and ℓ \ell ℓ with weights W W W and 1, respectively. The pages are requested in alternating order until some time T T T . The heavy page h h h is requested at
every even time 2 t < T 2t < T 2 t < T and its delay d ( τ ) = M τ d(\tau) = M\tau d ( τ ) = M τ grows linearly with a very fast rate M ≫ W M \gg W M ≫ W . Page ℓ \ell ℓ is requested at every odd time 2 t + 1 < T 2t + 1 < T 2 t + 1 < T and the delay only grows to some γ \gamma γ chosen below, remains there until time T T T and then grows at the fast rate M M M , i.e., d r ( τ ) = γ min { τ , 1 } d_r(\tau) = \gamma\min\{\tau,1\} d r ( τ ) = γ min { τ , 1 } for a r + τ ≤ T a_r + \tau\le T a r + τ ≤ T , and d r ( τ ) = γ + M ( a r + τ − T ) d_r(\tau) = \gamma+ M(a_r + \tau- T) d r ( τ ) = γ + M ( a r + τ − T ) afterwards.
O p t \mathrm{Opt} Opt caches h h h immediately at cost W W W , keeps it until time T T T (incurring no cost from the requests to h h h ) and then serves all requests on ℓ \ell ℓ , paying at most γ \gamma γ per request on ℓ \ell ℓ plus 1 to fetch it. In total, O p t = γ ⋅ T 2 + O ( W ) \mathrm{Opt} = \gamma\cdot\frac{T}{2} + O(W) Opt = γ ⋅ 2 T + O ( W ) .
Consider any rule that serves ℓ \ell ℓ once its pending delay exceeds a threshold κ \kappa κ that depends only on w ℓ w_\ell w ℓ . Choosing γ > κ \gamma> \kappa γ > κ forces such a rule to fetch ℓ \ell ℓ within one time unit after every request on ℓ \ell ℓ , and the next request on h h h forces it to fetch h h h back at cost W W W or to pay delay of at least M > W M > W M > W . Either way, the cost is Ω ( W ) \Omega(W) Ω ( W ) per round, so the competitive ratio is Ω ( W / γ ) \Omega(W/\gamma) Ω ( W / γ ) . Thus, any rule depending only on the delay and weight of ℓ \ell ℓ is not sufficient.
Example 35 (Dependence on lighter pages). This example shows that the rule for performing critical service must not depend only on the page to be turned critical.
Suppose all light pages are fractionally evicted and the cache is filled with heavy pages of weight W W W , while O p t \mathrm{Opt} Opt caches a light page of weight 1. Now several light pages ℓ 1 , ℓ 2 , … , ℓ m \ell_1, \ell_2, \ldots, \ell_m ℓ 1 , ℓ 2 , … , ℓ m receive requests with the same delay function d ( τ ) = τ d(\tau) = \tau d ( τ ) = τ at the same time, and O p t \mathrm{Opt} Opt serves them immediately through its light slot, which costs m m m in total.
A rule that serves each light page ℓ i \ell_i ℓ i once its own pending delay exceeds ∣ λ x → ℓ i ∣ / L |\lambda_{x\to\ell_i}|/L ∣ λ x → ℓ i ∣/ L lets all ℓ i \ell_i ℓ i accumulate delay in parallel until their delay is W W W each, resulting in a cost of ( W + 1 ) m (W+1)m ( W + 1 ) m .
PMD solves this by letting all lighter pages contribute to when a page becomes critical.
The mirror descent path in closed form
In Section 3, we define the path λ = λ x → p \lambda= \lambda_{x\to p} λ = λ x → p of a critical service by a closed formula instead of by the differential inclusion (1), and our analysis uses only this closed form. This section shows that λ \lambda λ is indeed the mirror descent path of [9 Section 2.2] , traversed at a different speed. The idea is that (1), written componentwise, lets the antimass y i y_i y i of every page i ≠ p i \ne p i = p with y i < 1 y_i < 1 y i < 1 grow at the relative rate ( log y i ) ′ = μ ( t ) / w i (\log y_i)' = \mu(t)/w_i ( log y i ) ′ = μ ( t ) / w i , where the factor μ ( t ) \mu(t) μ ( t ) is the same for all these pages. Measuring progress by s = ∫ μ ( t ) d t s = \int\mu(t)\,\mathrm{d}t s = ∫ μ ( t ) d t instead of by t t t removes this factor and gives y i = x i e s / w i y_i = x_i e^{s/w_i} y i = x i e s / w i , the closed form of λ \lambda λ . We first write (1) componentwise, then determine μ \mu μ , and finally verify that λ \lambda λ , traversed at a suitable speed, satisfies (1).
Throughout, let x ∈ S ∩ [ 0 , 1 ] n x \in S \cap[0,1]^n x ∈ S ∩ [ 0 , 1 ] n be the start state, with x p > δ x_p > \delta x p > δ , and let λ = λ x → p \lambda= \lambda_{x\to p} λ = λ x → p .
The differential inclusion for each page Recall that the mirror descent path is a path y ( t ) y(t) y ( t ) in S = { y ∈ [ 0 , 1 ] n : ∑ i y i = n − k } S = \{y \in[0,1]^n : \sum_i y_i = n-k\} S = { y ∈ [ 0 , 1 ] n : ∑ i y i = n − k } with y ( 0 ) = x y(0) = x y ( 0 ) = x that satisfies
y ′ ( t ) ∈ ∇ 2 Φ ( y ( t ) ) − 1 ⋅ ( − 1 p − N S ( y ( t ) ) ) , (13) y'(t) \in\nabla^2\Phi(y(t))^{-1}\cdot\left(-\mathbf{1}_p-N_S(y(t))\right), \tag*{(13)} y ′ ( t ) ∈ ∇ 2 Φ ( y ( t ) ) − 1 ⋅ ( − 1 p − N S ( y ( t )) ) , (13)
where N S ( y ) N_S(y) N S ( y ) is the normal cone of S S S at y y y . The mirror map Φ ( y ) = ∑ i w i y i log y i \Phi(y) = \sum_i w_i y_i \log y_i Φ ( y ) = ∑ i w i y i log y i has the diagonal Hessian ∇ 2 Φ ( y ) \nabla^2\Phi(y) ∇ 2 Φ ( y ) with entries w i / y i w_i/y_i w i / y i . For y ∈ S y \in S y ∈ S with y > 0 y > 0 y > 0 , the only constraints of S S S that can be tight are ∑ i y i = n − k \sum_i y_i = n-k ∑ i y i = n − k and y i ≤ 1 y_i \le1 y i ≤ 1 , so the normal cone is
N S ( y ) = { ∑ i : y i = 1 η i 1 i − μ 1 : μ ∈ R , η i ≥ 0 } . N_S(y) = \left\{\sum_{i:y_i=1}\eta_i\mathbf{1}_i-\mu\mathbf{1}:\ \mu\in\mathbb{R},\ \eta_i\ge0\right\}. N S ( y ) = { i : y i = 1 ∑ η i 1 i − μ 1 : μ ∈ R , η i ≥ 0 } .
Here, 1 \mathbf{1} 1 is the vector of all ones and 1 i \mathbf{1}_i 1 i is the vector with a 1 in position i i i and 0 elsewhere. Hence, a path y ( t ) ∈ S y(t) \in S y ( t ) ∈ S with y ( t ) > 0 y(t)>0 y ( t ) > 0 satisfies (1) at time t t t if and only if there are μ ( t ) ∈ R \mu(t)\in\mathbb{R} μ ( t ) ∈ R and η i ( t ) ≥ 0 \eta_i(t)\ge0 η i ( t ) ≥ 0 , with η i ( t ) = 0 \eta_i(t)=0 η i ( t ) = 0 unless y i ( t ) = 1 y_i(t)=1 y i ( t ) = 1 , such that
y i ′ ( t ) = y i ( t ) w i ( μ ( t ) − 1 p ( i ) − η i ( t ) ) for all pages i . (14) y_i'(t)=\frac{y_i(t)}{w_i}\left(\mu(t)-\mathbf{1}_p(i)-\eta_i(t)\right)
\quad\text{for all pages }i. \tag*{(14)} y i ′ ( t ) = w i y i ( t ) ( μ ( t ) − 1 p ( i ) − η i ( t ) ) for all pages i . (14)
Where the closed form comes from Summing (13) over all pages and using ∑ i y i ′ ( t ) = 0 \sum_i y_i'(t)=0 ∑ i y i ′ ( t ) = 0 , which keeps y y y in S S S , gives
μ ( t ) ∑ i y i ( t ) w i = y p ( t ) w p + ∑ i : y i ( t ) = 1 η i ( t ) w i . \mu(t)\sum_i \frac{y_i(t)}{w_i}=\frac{y_p(t)}{w_p}+\sum_{i:y_i(t)=1}\frac{\eta_i(t)}{w_i}. μ ( t ) i ∑ w i y i ( t ) = w p y p ( t ) + i : y i ( t ) = 1 ∑ w i η i ( t ) .
so μ ( t ) > 0 \mu(t)>0 μ ( t ) > 0 . Every page i ≠ p i\ne p i = p with y i ( t ) < 1 y_i(t)<1 y i ( t ) < 1 has η i ( t ) = 0 \eta_i(t)=0 η i ( t ) = 0 and, by (13), grows at the relative rate ( log y i ) ′ ( t ) = μ ( t ) / w i (\log y_i)'(t)=\mu(t)/w_i ( log y i ) ′ ( t ) = μ ( t ) / w i . A page i ≠ p i\ne p i = p with y i ( t ) = 1 y_i(t)=1 y i ( t ) = 1 therefore stays at antimass 1: it cannot exceed 1, and as soon as it dropped below 1, it would grow again. So y i ′ ( t ) = 0 y_i'(t)=0 y i ′ ( t ) = 0 , i.e., η i ( t ) = μ ( t ) \eta_i(t)=\mu(t) η i ( t ) = μ ( t ) . Substituting this into the sum determines the factor as μ ( t ) = μ ^ ( y ( t ) ) \mu(t)=\hat{\mu}(y(t)) μ ( t ) = μ ^ ( y ( t )) [9 (2.8)] , where for a state z > 0 z>0 z > 0 we let
A ( z ) : = { i ≠ p : z i < 1 } ∪ { p } and μ ^ ( z ) : = z p / w p ∑ i ∈ A ( z ) z i / w i . A(z):=\{i\ne p:z_i<1\}\cup\{p\}\qquad\text{and}\qquad\hat{\mu}(z):=\frac{z_p/w_p}{\sum_{i\in A(z)}z_i/w_i}. A ( z ) := { i = p : z i < 1 } ∪ { p } and μ ^ ( z ) := ∑ i ∈ A ( z ) z i / w i z p / w p .
With s ( t ) : = ∫ 0 t μ ( τ ) d τ s(t):=\int_0^t\mu(\tau)\,d\tau s ( t ) := ∫ 0 t μ ( τ ) d τ , integrating ( log y i ) ′ = μ / w i (\log y_i)'=\mu/w_i ( log y i ) ′ = μ / w i gives y i ( t ) = x i e s ( t ) / w i y_i(t)=x_i e^{s(t)/w_i} y i ( t ) = x i e s ( t ) / w i until y i y_i y i reaches 1, i.e., y i ( t ) = λ ( s ( t ) ) i y_i(t)=\lambda(s(t))_i y i ( t ) = λ ( s ( t ) ) i .
λ \lambda λ satisfies the differential inclusion For s ∈ [ 0 , ∣ λ ∣ ] s\in[0,|\lambda|] s ∈ [ 0 , ∣ λ ∣ ] , we have λ ( s ) i ≥ δ > 0 \lambda(s)_i\ge\delta>0 λ ( s ) i ≥ δ > 0 , since λ ( s ) i ≥ x i ≥ δ \lambda(s)_i\ge x_i\ge\delta λ ( s ) i ≥ x i ≥ δ for i ≠ p i\ne p i = p and λ ( s ) p ≥ δ \lambda(s)_p\ge\delta λ ( s ) p ≥ δ by the choice of ∣ λ ∣ |\lambda| ∣ λ ∣ . Hence, σ ↦ μ ^ ( λ ( σ ) ) \sigma\mapsto\hat{\mu}(\lambda(\sigma)) σ ↦ μ ^ ( λ ( σ )) is positive on [ 0 , ∣ λ ∣ ] [0,|\lambda|] [ 0 , ∣ λ ∣ ] , and it is piecewise continuous, with jumps only where a page reaches antimass 1. Let s ( t ) s(t) s ( t ) be the inverse of the increasing function s ↦ ∫ 0 s d σ μ ^ ( λ ( σ ) ) s\mapsto\int_0^s\frac{d\sigma}{\hat{\mu}(\lambda(\sigma))} s ↦ ∫ 0 s μ ^ ( λ ( σ )) d σ , so that s ′ ( t ) = μ ^ ( λ ( s ( t ) ) ) s'(t)=\hat{\mu}(\lambda(s(t))) s ′ ( t ) = μ ^ ( λ ( s ( t ))) , and let y ( t ) : = λ ( s ( t ) ) y(t):=\lambda(s(t)) y ( t ) := λ ( s ( t )) . We show (13) with μ ( t ) : = μ ^ ( y ( t ) ) > 0 \mu(t):=\hat{\mu}(y(t))>0 μ ( t ) := μ ^ ( y ( t )) > 0 , and η i ( t ) : = μ ( t ) \eta_i(t):=\mu(t) η i ( t ) := μ ( t ) for the pages i ≠ p i\ne p i = p with y i ( t ) = 1 y_i(t)=1 y i ( t ) = 1 , and η i ( t ) : = 0 \eta_i(t):=0 η i ( t ) := 0 for all other pages. Let A = A ( y ( t ) ) A=A(y(t)) A = A ( y ( t )) be the set of pages whose mass is still changing, and let t t t be a time at which no page reaches antimass 1.
For i ∈ A ∖ { p } i\in A\setminus\{p\} i ∈ A ∖ { p } , we have y i = x i e s / w i y_i=x_i e^{s/w_i} y i = x i e s / w i , so y i ′ ( t ) = s ′ ( t ) y i ( t ) / w i = μ ( t ) y i ( t ) / w i y_i'(t)=s'(t)y_i(t)/w_i=\mu(t)y_i(t)/w_i y i ′ ( t ) = s ′ ( t ) y i ( t ) / w i = μ ( t ) y i ( t ) / w i .
For i ∉ A i\notin A i ∈ / A , i.e. y i ( t ) = 1 y_i(t)=1 y i ( t ) = 1 , the page stays at antimass 1, so y i ′ ( t ) = 0 = y i ( t ) w i ( μ ( t ) − η i ( t ) ) y_i'(t)=0=\frac{y_i(t)}{w_i}(\mu(t)-\eta_i(t)) y i ′ ( t ) = 0 = w i y i ( t ) ( μ ( t ) − η i ( t )) .
For p p p , we have y p = n − k − ∑ i ≠ p y i y_p=n-k-\sum_{i\ne p}y_i y p = n − k − ∑ i = p y i , so by the two cases above and the definition of μ ^ \hat{\mu} μ ^ ,
y p ′ ( t ) = − μ ( t ) ∑ i ∈ A ∖ { p } y i ( t ) w i = − μ ^ ( y ( t ) ) ∑ i ∈ A y i ( t ) w i + μ ( t ) y p ( t ) w p = − y p ( t ) w p μ ( t ) + μ ( t ) y p ( t ) w p = y p ( t ) w p ( μ ( t ) − 1 ) . y_p'(t)=-\mu(t)\sum_{i\in A\setminus\{p\}}\frac{y_i(t)}{w_i}=-\hat{\mu}(y(t))\sum_{i\in A}\frac{y_i(t)}{w_i}+\mu(t)\frac{y_p(t)}{w_p}=-\frac{y_p(t)}{w_p}\mu(t)+\mu(t)\frac{y_p(t)}{w_p}=\frac{y_p(t)}{w_p}(\mu(t)-1). y p ′ ( t ) = − μ ( t ) i ∈ A ∖ { p } ∑ w i y i ( t ) = − μ ^ ( y ( t )) i ∈ A ∑ w i y i ( t ) + μ ( t ) w p y p ( t ) = − w p y p ( t ) μ ( t ) + μ ( t ) w p y p ( t ) = w p y p ( t ) ( μ ( t ) − 1 ) .
So y y y satisfies (13), and hence (1), at almost all times. The mirror descent path y y y passes through the same states as λ \lambda λ , in the same order, and reaches y p = δ y_p=\delta y p = δ exactly when s ( t ) = ∣ λ ∣ s(t)=|\lambda| s ( t ) = ∣ λ ∣ .