Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-24-2015, 10:05 AM   #1
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:
  * 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)
         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;
         } 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;
                 mm->rss = 0;
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 10:55 AM.



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

All times are GMT -5. The time now is 05:32 PM.

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