Changeset 8ad7dd1 in mainline
- Timestamp:
- 2016-05-26T09:55:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7f0580d
- Parents:
- 84b8936d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
r84b8936d r8ad7dd1 290 290 ++thread->priority : thread->priority; 291 291 292 /* Check that thread->cpu is set whenever it needs to be. */ 293 ASSERT(thread->cpu != NULL || 294 (!thread->wired && !thread->nomigrate && !thread->fpu_context_engaged)); 295 296 /* 297 * Prefer to run on the same cpu as the last time. Used by wired 298 * threads as well as threads with disabled migration. 299 */ 300 cpu_t *cpu = thread->cpu; 301 if (cpu == NULL) 292 cpu_t *cpu; 293 if (thread->wired || thread->nomigrate || thread->fpu_context_engaged) { 294 /* Cannot ready to another CPU */ 295 ASSERT(thread->cpu != NULL); 296 cpu = thread->cpu; 297 } else if (thread->stolen) { 298 /* Ready to the stealing CPU */ 302 299 cpu = CPU; 300 } else if (thread->cpu) { 301 /* Prefer the CPU on which the thread ran last */ 302 ASSERT(thread->cpu != NULL); 303 cpu = thread->cpu; 304 } else { 305 cpu = CPU; 306 } 303 307 304 308 thread->state = Ready; … … 316 320 317 321 atomic_inc(&nrdy); 318 // FIXME: Why is the avg value not used319 // avg = atomic_get(&nrdy) / config.cpu_active;320 322 atomic_inc(&cpu->nrdy); 321 323 }
Note:
See TracChangeset
for help on using the changeset viewer.