Changeset c5613b72 in mainline for generic


Ignore:
Timestamp:
2006-02-04T01:59:42Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10e16a7
Parents:
81e52f2a
Message:

Added slab stress test.
Fixed race condition in slab allocator.
Moved initialization of slab to the point where we know correct config.cpu_count
Correctly passes tests on amd64, ia32 in both bochs & qemu.

Location:
generic/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/src/main/main.c

    r81e52f2a rc5613b72  
    164164        page_init();
    165165        tlb_init();
    166         slab_cache_init();
    167166        arch_post_mm_init();
    168167
     
    174173        arch_pre_smp_init();
    175174        smp_init();
     175        /* Slab must be initialized AFTER we know the number of processors */
     176        slab_cache_init();
     177
    176178        printf("config.memory_size=%dM\n", config.memory_size/(1024*1024));
    177179        printf("config.cpu_count=%d\n", config.cpu_count);
  • generic/src/mm/slab.c

    r81e52f2a rc5613b72  
    387387 * no empty magazine is available and cannot be allocated
    388388 *
     389 * Assume mag_cache[CPU->id].lock is held
     390 *
    389391 * We have 2 magazines bound to processor.
    390392 * First try the current.
     
    421423
    422424        /* Flush last to magazine list */
    423         if (lastmag)
     425        if (lastmag) {
     426                spinlock_lock(&cache->lock);
    424427                list_prepend(&lastmag->link, &cache->magazines);
     428                spinlock_unlock(&cache->lock);
     429        }
    425430        /* Move current as last, save new as current */
    426431        cache->mag_cache[CPU->id].last = cmag; 
     
    514519        spinlock_initialize(&cache->lock, "cachelock");
    515520        if (! (cache->flags & SLAB_CACHE_NOMAGAZINE)) {
    516                 for (i=0; i< config.cpu_count; i++) {
     521                for (i=0; i < config.cpu_count; i++) {
    517522                        memsetb((__address)&cache->mag_cache[i],
    518523                                sizeof(cache->mag_cache[i]), 0);
     
    650655        ipl_t ipl;
    651656        void *result = NULL;
    652 
     657       
    653658        /* Disable interrupts to avoid deadlocks with interrupt handlers */
    654659        ipl = interrupts_disable();
Note: See TracChangeset for help on using the changeset viewer.