LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-29-2015, 10:27 AM   #1
huangjie
LQ Newbie
 
Registered: Oct 2015
Posts: 5

Rep: Reputation: Disabled
How to make filemap_sync() execute as long as possible?


In the system call msync, it invokes filemap_sync inside. 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.

Code:
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;
}
If I want to make filemap_sync execute as long as possible, I'm wondering how can I do this in my user space code? Anything I can do to extend the length of its execution?
 
  


Reply

Tags
kernel



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fclose() operation takes very long time to execute on ext4 file system rudreshsm Linux - Kernel 4 09-13-2012 08:31 AM
[SOLVED] unable to execute /bin/chmod: Argument list too long veeruk101 Linux - Newbie 2 10-14-2011 06:16 AM
script taking long time to execute smritisingh03 Linux - Newbie 6 01-25-2011 11:08 AM
Easier way to execute long commands? martinventer Linux - Newbie 4 07-29-2010 07:20 PM
Finding out how long a program takes to execute nodger Linux - Software 2 11-03-2004 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration