Ignore:
Timestamp:
2011-11-25T23:35:22Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1c01e6c
Parents:
50177dcd
Message:

Finish transition to lock-free page_mapping_find() in TLB miss handlers.

  • Simply drop the calls to page_table_lock/unlock() in ia64 and sparc64 TLB miss handlers.

As for why this is possible:

  • page_mapping_find() cannot race with page_table_remove() because page_mapping_find() is called only when interrupts are disabled, which prevents TLB shootdown from starting, which in turn prevents page_table_remove() from running
  • page_mapping_insert() will not negatively interfere with page_mapping_find() because page_mapping_insert() adds a fully initialized pte_t to the end of the hash bucket
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/mm/sun4v/tlb.c

    r50177dcd r9aed144  
    218218        pte_t *t;
    219219
    220         page_table_lock(AS, true);
    221220        t = page_mapping_find(AS, va, true);
    222221
     
    231230                itsb_pte_copy(t);
    232231#endif
    233                 page_table_unlock(AS, true);
    234232        } else {
    235233                /*
     
    237235                 * handler.
    238236                 */
    239                 page_table_unlock(AS, true);
    240237                if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) {
    241238                        do_fast_instruction_access_mmu_miss_fault(istate,
     
    274271        }
    275272
    276         page_table_lock(AS, true);
    277273        t = page_mapping_find(AS, va, true);
    278274        if (t) {
     
    286282                dtsb_pte_copy(t, true);
    287283#endif
    288                 page_table_unlock(AS, true);
    289284        } else {
    290285                /*
     
    292287                 * handler.
    293288                 */             
    294                 page_table_unlock(AS, true);
    295289                if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) {
    296290                        do_fast_data_access_mmu_miss_fault(istate, page_and_ctx,
     
    316310        uint16_t ctx = DMISS_CONTEXT(page_and_ctx);
    317311
    318         page_table_lock(AS, true);
    319312        t = page_mapping_find(AS, va, true);
    320313        if (t && PTE_WRITABLE(t)) {
     
    331324                dtsb_pte_copy(t, false);
    332325#endif
    333                 page_table_unlock(AS, true);
    334326        } else {
    335327                /*
     
    337329                 * handler.
    338330                 */             
    339                 page_table_unlock(AS, true);
    340331                if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) {
    341332                        do_fast_data_access_protection_fault(istate, page_and_ctx,
Note: See TracChangeset for help on using the changeset viewer.