- 论坛徽章:
- 0
|
本帖最后由 willcream 于 2015-10-29 22:03 编辑
在msync系统调用里,会调用到filemap_sync。
filemap_sync scans the Page Table entries corresponding to the linear address intervals included in the memory region. For each page found, it invokes flush_tlb_page( ) to flush the corresponding translation lookaside buffers, and marks the page as dirty.- int filemap_sync(struct vm_area_struct * vma, unsigned long address,
- size_t size, unsigned int flags)
- {
- pgd_t * dir;
- unsigned long end = address + size;
- int error = 0;
- spin_lock(&vma->vm_mm->page_table_lock);
- dir = pgd_offset(vma->vm_mm, address);
- flush_cache_range(vma->vm_mm, end - size, end);
- if (address >= end)
- BUG();
- do {
- error |= filemap_sync_pmd_range(dir, address, end - address, vma, flags);
- address = (address + PGDIR_SIZE) & PGDIR_MASK;
- dir++;
- } while (address && (address < end));
- flush_tlb_range(vma->vm_mm, end - size, end);
- spin_unlock(&vma->vm_mm->page_table_lock);
- return error;
- }
复制代码 我现在想在用户空间代码中实现让这个filemap_sync函数执行得越久越好,请问有什么方法吗? |
|