Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 436a0a5 in mainline for kernel/generic/src/proc/scheduler.c


Ignore:
Timestamp:
2018-11-09T22:04:01Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
95d45482
Parents:
88e43bc (diff), abf6c01 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

(merge) Reduce the number of blocking allocations in the kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/scheduler.c

    r88e43bc r436a0a5  
    134134void scheduler_fpu_lazy_request(void)
    135135{
    136 restart:
    137136        fpu_enable();
    138137        irq_spinlock_lock(&CPU->lock, false);
     
    153152                fpu_context_restore(THREAD->saved_fpu_context);
    154153        } else {
    155                 /* Allocate FPU context */
    156                 if (!THREAD->saved_fpu_context) {
    157                         /* Might sleep */
    158                         irq_spinlock_unlock(&THREAD->lock, false);
    159                         irq_spinlock_unlock(&CPU->lock, false);
    160                         THREAD->saved_fpu_context =
    161                             (fpu_context_t *) slab_alloc(fpu_context_cache, 0);
    162 
    163                         /* We may have switched CPUs during slab_alloc */
    164                         goto restart;
    165                 }
    166154                fpu_init();
    167155                THREAD->fpu_context_exists = true;
Note: See TracChangeset for help on using the changeset viewer.