git://git.onelab.eu
/
linux-2.6.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
389308f
)
don't decrement below zero
author
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 19 Apr 2005 12:48:30 +0000
(12:48 +0000)
committer
Marc Fiuczynski
<mef@cs.princeton.edu>
Tue, 19 Apr 2005 12:48:30 +0000
(12:48 +0000)
kernel/ckrm/ckrm_numtasks.c
patch
|
blob
|
history
diff --git
a/kernel/ckrm/ckrm_numtasks.c
b/kernel/ckrm/ckrm_numtasks.c
index
7b02a6c
..
c058305
100644
(file)
--- a/
kernel/ckrm/ckrm_numtasks.c
+++ b/
kernel/ckrm/ckrm_numtasks.c
@@
-165,7
+165,12
@@
static void numtasks_put_ref_local(struct ckrm_core_class *core)
res = ckrm_get_res_class(core, resid, struct ckrm_numtasks);
if (res == NULL)
return;
res = ckrm_get_res_class(core, resid, struct ckrm_numtasks);
if (res == NULL)
return;
+
+ if (atomic_read(&res->cnt_cur_alloc)==0)
+ return;
+
atomic_dec(&res->cnt_cur_alloc);
atomic_dec(&res->cnt_cur_alloc);
+
if (atomic_read(&res->cnt_borrowed) > 0) {
atomic_dec(&res->cnt_borrowed);
numtasks_put_ref_local(res->parent);
if (atomic_read(&res->cnt_borrowed) > 0) {
atomic_dec(&res->cnt_borrowed);
numtasks_put_ref_local(res->parent);