Changeset 436a0a5 in mainline for kernel/test/mm/slab1.c


Ignore:
Timestamp:
2018-11-09T22:04:01Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
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/test/mm/slab1.c

    r88e43bc r436a0a5  
    5050
    5151        for (i = 0; i < count; i++) {
    52                 data[i] = slab_alloc(cache, 0);
    53                 memsetb(data[i], size, 0);
     52                data[i] = slab_alloc(cache, FRAME_ATOMIC);
     53                if (data[i])
     54                        memsetb(data[i], size, 0);
    5455        }
    5556
     
    6667
    6768        for (i = 0; i < count; i++) {
    68                 data[i] = slab_alloc(cache, 0);
    69                 memsetb(data[i], size, 0);
     69                data[i] = slab_alloc(cache, FRAME_ATOMIC);
     70                if (data[i])
     71                        memsetb(data[i], size, 0);
    7072        }
    7173
     
    8284
    8385        for (i = count / 2; i < count; i++) {
    84                 data[i] = slab_alloc(cache, 0);
    85                 memsetb(data[i], size, 0);
     86                data[i] = slab_alloc(cache, FRAME_ATOMIC);
     87                if (data[i])
     88                        memsetb(data[i], size, 0);
    8689        }
    8790
     
    131134        for (j = 0; j < 10; j++) {
    132135                for (i = 0; i < THR_MEM_COUNT; i++)
    133                         thr_data[offs][i] = slab_alloc(thr_cache, 0);
     136                        thr_data[offs][i] = slab_alloc(thr_cache, FRAME_ATOMIC);
    134137                for (i = 0; i < THR_MEM_COUNT / 2; i++)
    135138                        slab_free(thr_cache, thr_data[offs][i]);
    136139                for (i = 0; i < THR_MEM_COUNT / 2; i++)
    137                         thr_data[offs][i] = slab_alloc(thr_cache, 0);
     140                        thr_data[offs][i] = slab_alloc(thr_cache, FRAME_ATOMIC);
    138141                for (i = 0; i < THR_MEM_COUNT; i++)
    139142                        slab_free(thr_cache, thr_data[offs][i]);
Note: See TracChangeset for help on using the changeset viewer.