Changeset c964521 in mainline


Ignore:
Timestamp:
2010-05-13T09:44:07Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba4a63b8
Parents:
2e4e706
Message:

Lock the page tables before initiating the TLB shootdown, avoiding thus possible
blocking while holding a spinlock.

File:
1 edited

Legend:

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

    r2e4e706 rc964521  
    422422                 * No need to check for overlaps.
    423423                 */
     424
     425                page_table_lock(as, false);
    424426
    425427                /*
     
    486488                                        pte_t *pte;
    487489                       
    488                                         page_table_lock(as, false);
    489490                                        pte = page_mapping_find(as, b +
    490491                                            i * PAGE_SIZE);
     
    499500                                        page_mapping_remove(as, b +
    500501                                            i * PAGE_SIZE);
    501                                         page_table_unlock(as, false);
    502502                                }
    503503                        }
     
    510510                tlb_invalidate_pages(as->asid, area->base + pages * PAGE_SIZE,
    511511                    area->pages - pages);
     512
    512513                /*
    513514                 * Invalidate software translation caches (e.g. TSB on sparc64).
     
    516517                    pages * PAGE_SIZE, area->pages - pages);
    517518                tlb_shootdown_finalize();
     519
     520                page_table_unlock(as, false);
    518521               
    519522        } else {
     
    565568
    566569        base = area->base;
     570
     571        page_table_lock(as, false);
    567572
    568573        /*
     
    586591                       
    587592                        for (j = 0; j < (size_t) node->value[i]; j++) {
    588                                 page_table_lock(as, false);
    589593                                pte = page_mapping_find(as, b + j * PAGE_SIZE);
    590594                                ASSERT(pte && PTE_VALID(pte) &&
     
    596600                                }
    597601                                page_mapping_remove(as, b + j * PAGE_SIZE);                             
    598                                 page_table_unlock(as, false);
    599602                        }
    600603                }
     
    606609
    607610        tlb_invalidate_pages(as->asid, area->base, area->pages);
     611
    608612        /*
    609613         * Invalidate potential software translation caches (e.g. TSB on
     
    612616        as_invalidate_translation_cache(as, area->base, area->pages);
    613617        tlb_shootdown_finalize();
     618
     619        page_table_unlock(as, false);
    614620       
    615621        btree_destroy(&area->used_space);
     
    858864        old_frame = malloc(used_pages * sizeof(uintptr_t), 0);
    859865
     866        page_table_lock(as, false);
     867
    860868        /*
    861869         * Start TLB shootdown sequence.
     
    881889                       
    882890                        for (j = 0; j < (size_t) node->value[i]; j++) {
    883                                 page_table_lock(as, false);
    884891                                pte = page_mapping_find(as, b + j * PAGE_SIZE);
    885892                                ASSERT(pte && PTE_VALID(pte) &&
     
    889896                                /* Remove old mapping */
    890897                                page_mapping_remove(as, b + j * PAGE_SIZE);
    891                                 page_table_unlock(as, false);
    892898                        }
    893899                }
     
    906912        as_invalidate_translation_cache(as, area->base, area->pages);
    907913        tlb_shootdown_finalize();
     914
     915        page_table_unlock(as, false);
    908916
    909917        /*
Note: See TracChangeset for help on using the changeset viewer.