Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 402eda5 in mainline for kernel/generic/src/mm/tlb.c


Ignore:
Timestamp:
2010-06-22T12:19:45Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
9539be6
Parents:
a49a1a1
Message:

Fix a newly introduced deadlock in the TLB shootdown algorithm.

File:
1 edited

Legend:

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

    ra49a1a1 r402eda5  
    7373 * to all other processors.
    7474 *
    75  * @param type Type describing scope of shootdown.
    76  * @param asid Address space, if required by type.
    77  * @param page Virtual page address, if required by type.
    78  * @param count Number of pages, if required by type.
     75 * @param type          Type describing scope of shootdown.
     76 * @param asid          Address space, if required by type.
     77 * @param page          Virtual page address, if required by type.
     78 * @param count         Number of pages, if required by type.
    7979 *
     80 * @return The interrupt priority level as it existed prior to this call.
    8081 */
    81 void tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
     82ipl_t tlb_shootdown_start(tlb_invalidate_type_t type, asid_t asid,
    8283    uintptr_t page, size_t count)
    8384{
     85        ipl_t ipl;
     86
     87        ipl = interrupts_disable();
    8488        CPU->tlb_active = false;
    85         irq_spinlock_lock(&tlblock, true);
     89        irq_spinlock_lock(&tlblock, false);
    8690       
    8791        size_t i;
     
    123127                if (cpus[i].tlb_active)
    124128                        goto busy_wait;
     129
     130        return ipl;
    125131}
    126132
    127133/** Finish TLB shootdown sequence.
    128134 *
     135 * @param ipl           Previous interrupt priority level.
    129136 */
    130 void tlb_shootdown_finalize(void)
     137void tlb_shootdown_finalize(ipl_t ipl)
    131138{
    132         irq_spinlock_unlock(&tlblock, true);
     139        irq_spinlock_unlock(&tlblock, false);
    133140        CPU->tlb_active = true;
     141        interrupts_restore(ipl);
    134142}
    135143
Note: See TracChangeset for help on using the changeset viewer.