LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-24-2015, 09:05 AM   #1
huangjie
LQ Newbie
 
Registered: Oct 2015
Posts: 5

Rep: Reputation: Disabled
large latency of zap_page_range


In mm/memory.c, zap_page_range is defined as follow:
Code:
 /*
  * remove user pages in a given range.
  */
 void zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size)
 {
         mmu_gather_t *tlb;
         pgd_t * dir;
         unsigned long start = address, end = address + size;
         int freed = 0;

         dir = pgd_offset(mm, address);

         /*
          * This is a long-lived spinlock. That's fine.
          * There's no contention, because the page table
          * lock only protects against kswapd anyway, and
          * even if kswapd happened to be looking at this
          * process we _want_ it to get stuck.
          */
         if (address >= end)
                 BUG();
         spin_lock(&mm->page_table_lock);
         flush_cache_range(mm, address, end);
         tlb = tlb_gather_mmu(mm);

         do {
                 freed += zap_pmd_range(tlb, dir, address, end - address);
                 address = (address + PGDIR_SIZE) & PGDIR_MASK;
                 dir++;
         } while (address && (address < end));

         /* this will flush any remaining tlb entries */
         tlb_finish_mmu(tlb, start, end);

         /*
          * Update rss for the mm_struct (not necessarily current->mm)
          * Notice that rss is an unsigned long.
          */
         if (mm->rss > freed)
                 mm->rss -= freed;
         else
                 mm->rss = 0;
         spin_unlock(&mm->page_table_lock);
}
My purpose is to create a big latency in here (between the spin locks), I mean to let this function as long as long as possible (from my user code). Can anyone give me some idea? What is associated the duration of this function?

Last edited by huangjie; 11-24-2015 at 09:55 AM.
 
  


Reply

Tags
kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] sort large data in large file - commands smithy2010 Linux - Newbie 7 02-03-2013 09:01 AM
ext3 performance -- very large number of files, large filesystems, etc. td3201 Linux - Server 5 11-25-2008 09:28 AM
Knoppix on CD, Upon starting I get large menu with large text & blank submenus samdaria Linux - Newbie 1 06-06-2008 09:59 PM
LXer: This week at LWN: Large pages, large blocks, and large problems LXer Syndicated Linux News 0 09-27-2007 11:40 AM
Large drive- too much space lost by large block size? tome Linux - General 5 12-14-2001 01:32 PM


All times are GMT -5. The time now is 09:14 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration