2005-05-05 19:16:52

by Gerrit Huizenga

[permalink] [raw]
Subject: [patch 12/21] CKRM: Check to see if my guarantee is set to DONTCARE

--
Content-Disposition: inline; filename=07a-numtasks_config


Signed-Off-By: Chandra Seetharaman <[email protected]>
Signed-Off-By: Vivek Kashyap <[email protected]>
Signed-Off-By: Gerrit Huizenga <[email protected]>

recalc and propagate was not checking for class's my_guarantee and
my_limit againt DONT_CARE. This was leading to different wierd
problems. This patch fixes it.

ckrm_numtasks.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.12-rc3-ckrm5/kernel/ckrm/ckrm_numtasks.c
===================================================================
--- linux-2.6.12-rc3-ckrm5.orig/kernel/ckrm/ckrm_numtasks.c 2005-05-05 09:35:11.000000000 -0700
+++ linux-2.6.12-rc3-ckrm5/kernel/ckrm/ckrm_numtasks.c 2005-05-05 09:36:29.000000000 -0700
@@ -296,7 +296,8 @@ recalc_and_propagate(struct ckrm_numtask
struct ckrm_shares *self = &res->shares;

/* calculate cnt_guarantee and cnt_limit */
- if (parres->cnt_guarantee == CKRM_SHARE_DONTCARE) {
+ if ((parres->cnt_guarantee == CKRM_SHARE_DONTCARE) ||
+ (self->my_guarantee == CKRM_SHARE_DONTCARE)) {
res->cnt_guarantee = CKRM_SHARE_DONTCARE;
} else if (par->total_guarantee) {
u64 temp = (u64) self->my_guarantee * parres->cnt_guarantee;
@@ -306,7 +307,8 @@ recalc_and_propagate(struct ckrm_numtask
res->cnt_guarantee = 0;
}

- if (parres->cnt_limit == CKRM_SHARE_DONTCARE) {
+ if ((parres->cnt_limit == CKRM_SHARE_DONTCARE) ||
+ (self->my_limit == CKRM_SHARE_DONTCARE)) {
res->cnt_limit = CKRM_SHARE_DONTCARE;
} else if (par->max_limit) {
u64 temp = (u64) self->my_limit * parres->cnt_limit;
@@ -317,7 +319,8 @@ recalc_and_propagate(struct ckrm_numtask
}

/* Calculate unused units */
- if (res->cnt_guarantee == CKRM_SHARE_DONTCARE) {
+ if ((res->cnt_guarantee == CKRM_SHARE_DONTCARE) ||
+ (self->my_guarantee == CKRM_SHARE_DONTCARE)) {
res->cnt_unused = CKRM_SHARE_DONTCARE;
} else if (self->total_guarantee) {
u64 temp = (u64) self->unused_guarantee * res->cnt_guarantee;

--