__proc_give_cores correctly adjusts amt_granted
authorBarret Rhoden <brho@cs.berkeley.edu>
Wed, 14 Apr 2010 03:05:11 +0000 (20:05 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Thu, 3 Nov 2011 00:35:42 +0000 (17:35 -0700)
kern/src/process.c
kern/src/resource.c

index 2675607..640b832 100644 (file)
@@ -888,6 +888,7 @@ bool __proc_give_cores(struct proc *SAFE p, uint32_t *pcorelist, size_t num)
                        panic("Weird state(%s) in %s()", procstate2str(p->state),
                              __FUNCTION__);
        }
+       p->resources[RES_CORES].amt_granted += num;
        return self_ipi_pending;
 }
 
index fa0c474..c11c66e 100644 (file)
@@ -92,7 +92,6 @@ ssize_t core_request(struct proc *p)
        spin_unlock(&idle_lock);
        // Now, actually give them out
        if (num_granted) {
-               p->resources[RES_CORES].amt_granted += num_granted;
                switch (p->state) {
                        case (PROC_RUNNING_S):
                                // issue with if we're async or not (need to preempt it)