Changeset 57da95c in mainline for kernel/generic/src/mm/as.c


Ignore:
Timestamp:
2006-09-18T11:47:28Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
29b2bbf
Parents:
f1d1f5d3
Message:
  • Create a dedicated slab cache for as_t objects and switch from malloc/free to slab_alloc/slab_free for

them.

  • Slightly fix and improve both the kernel and userspace atomic_add() on sparc64.
  • More TSB work on the sparc64 front.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/as.c

    rf1d1f5d3 r57da95c  
    8585as_operations_t *as_operations = NULL;
    8686
     87/**
     88 * Slab for as_t objects.
     89 */
     90static slab_cache_t *as_slab;
     91
    8792/** This lock protects inactive_as_with_asid_head list. It must be acquired before as_t mutex. */
    8893SPINLOCK_INITIALIZE(inactive_as_with_asid_lock);
     
    106111{
    107112        as_arch_init();
     113       
     114        as_slab = slab_cache_create("as_slab", sizeof(as_t), 0, NULL, NULL, SLAB_CACHE_MAGDEFERRED);
     115       
    108116        AS_KERNEL = as_create(FLAG_AS_KERNEL);
    109117        if (!AS_KERNEL)
     
    120128        as_t *as;
    121129
    122         as = (as_t *) malloc(sizeof(as_t), 0);
     130        as = (as_t *) slab_alloc(as_slab, 0);
    123131        link_initialize(&as->inactive_as_with_asid_link);
    124132        mutex_initialize(&as->lock);
     
    183191        interrupts_restore(ipl);
    184192       
    185         free(as);
     193        slab_free(as_slab, as);
    186194}
    187195
     
    799807                }
    800808                mutex_unlock(&old->lock);
     809
     810                /*
     811                 * Perform architecture-specific tasks when the address space
     812                 * is being removed from the CPU.
     813                 */
     814                as_deinstall_arch(old);
    801815        }
    802816
Note: See TracChangeset for help on using the changeset viewer.