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/sun4u/tlb.c

    r50177dcd r9aed144  
    206206        pte_t *t;
    207207
    208         page_table_lock(AS, true);
    209208        t = page_mapping_find(AS, page_16k, true);
    210209        if (t && PTE_EXECUTABLE(t)) {
     
    218217                itsb_pte_copy(t, index);
    219218#endif
    220                 page_table_unlock(AS, true);
    221219        } else {
    222220                /*
     
    224222                 * handler.
    225223                 */
    226                 page_table_unlock(AS, true);
    227224                if (as_page_fault(page_16k, PF_ACCESS_EXEC, istate) ==
    228225                    AS_PF_FAULT) {
     
    274271        }
    275272
    276         page_table_lock(AS, true);
    277273        t = page_mapping_find(AS, page_16k, true);
    278274        if (t) {
     
    286282                dtsb_pte_copy(t, index, 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(page_16k, PF_ACCESS_READ, istate) ==
    296290                    AS_PF_FAULT) {
     
    318312        index = tag.vpn % MMU_PAGES_PER_PAGE;   /* 16K-page emulation */
    319313
    320         page_table_lock(AS, true);
    321314        t = page_mapping_find(AS, page_16k, true);
    322315        if (t && PTE_WRITABLE(t)) {
     
    334327                dtsb_pte_copy(t, index, false);
    335328#endif
    336                 page_table_unlock(AS, true);
    337329        } else {
    338330                /*
     
    340332                 * handler.
    341333                 */             
    342                 page_table_unlock(AS, true);
    343334                if (as_page_fault(page_16k, PF_ACCESS_WRITE, istate) ==
    344335                    AS_PF_FAULT) {
Note: See TracChangeset for help on using the changeset viewer.