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

Changeset 0428f77 in mainline


Ignore:
Timestamp:
2012-02-18T23:15:55Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
314f3a3c, ec8c622
Parents:
26f407e9
Message:

mutex_lock(as) is weaker than page_table_lock(as, true).
page_mapping_find(as, …, false) requires page_table_lock(),
especially on platforms with the page hash table.

File:
1 edited

Legend:

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

    r26f407e9 r0428f77  
    168168int page_find_mapping(uintptr_t virt, void **phys)
    169169{
    170         mutex_lock(&AS->lock);
     170        page_table_lock(AS, true);
    171171       
    172172        pte_t *pte = page_mapping_find(AS, virt, false);
    173173        if ((!PTE_VALID(pte)) || (!PTE_PRESENT(pte))) {
    174                 mutex_unlock(&AS->lock);
     174                page_table_unlock(AS, true);
    175175                return ENOENT;
    176176        }
     
    179179            (virt - ALIGN_DOWN(virt, PAGE_SIZE));
    180180       
    181         mutex_unlock(&AS->lock);
     181        page_table_unlock(AS, true);
    182182       
    183183        return EOK;
Note: See TracChangeset for help on using the changeset viewer.