Lines Matching defs:cw
30 * - cw: current required weight
33 * First, we start with cw = mw and select dests with weight >= cw.
34 * Then cw is reduced with di and all dests are checked again.
35 * Last pass should be with cw = di. We have mw/di passes in total:
37 * pass 1: cw = max weight
38 * pass 2: cw = max weight - di
39 * pass 3: cw = max weight - 2 * di
41 * last pass: cw = di
48 * so that last cw is 1 to catch such dests with weight below di:
49 * pass 1: cw = max weight - (di - 1)
50 * pass 2: cw = max weight - di - (di - 1)
51 * pass 3: cw = max weight - 2 * di - (di - 1)
53 * last pass: cw = 1
62 int cw; /* current weight */
120 mark->cw = mark->mw;
147 if (mark->cw > mark->mw || !mark->cw)
148 mark->cw = mark->mw;
150 mark->cw = (mark->cw / mark->di) * mark->di + 1;
181 atomic_read(&dest->weight) >= mark->cw)
186 mark->cw -= mark->di;
187 if (mark->cw <= 0) {
188 mark->cw = mark->mw;
190 * 1. last_pass: we started checks when cw > di but
200 last_pass = mark->cw <= mark->di;