From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Sarunya Pumma <sarunya@vt.edu>
Cc: rppt@linux.vnet.ibm.com, linux-mm@kvack.org,
akpm@linux-foundation.org, kirill.shutemov@linux.intel.com,
jack@suse.cz, ross.zwisler@linux.intel.com, mhocko@suse.com,
aneesh.kumar@linux.vnet.ibm.com, lstoakes@gmail.com,
dave.jiang@intel.com
Subject: Re: [PATCH] Patch for remapping pages around the fault page
Date: Tue, 23 May 2017 16:07:43 +0300 [thread overview]
Message-ID: <20170523130743.3oh3rlxwqg2odimg@node.shutemov.name> (raw)
In-Reply-To: <1495379520-23752-1-git-send-email-sarunya@vt.edu>
On Sun, May 21, 2017 at 11:12:00AM -0400, Sarunya Pumma wrote:
> After the fault handler performs the __do_fault function to read a fault
> page when a page fault occurs, it does not map other pages that have been
> read together with the fault page. This can cause a number of minor page
> faults to be large. Therefore, this patch is developed to remap pages
> around the fault page by aiming to map the pages that have been read
> synchronously or asynchronously with the fault page.
>
> The major function of this patch is the redo_fault_around function. This
> function computes the start and end offsets of the pages to be mapped,
> determines whether to do the page remapping, remaps pages using the
> map_pages function, and returns. In the redo_fault_around function, the
> start and end offsets are computed the same way as the do_fault_around
> function. To determine whether to do the remapping, we determine if the
> pages around the fault page are already mapped. If they are, the remapping
> will not be performed.
>
> As checking every page can be inefficient if a number of pages to be mapped
> is large, we have added a threshold called "vm_nr_rempping" to consider
> whether to check the status of every page around the fault page or just
> some pages. Note that the vm_nr_rempping parameter can be adjusted via the
> Sysctl interface. In the case that a number of pages to be mapped is
> smaller than the vm_nr_rempping threshold, we check all pages around the
> fault page (within the start and end offsets). Otherwise, we check only the
> adjacent pages (left and right).
>
> The page remapping is beneficial when performing the "almost sequential"
> page accesses, where pages are accessed in order but some pages are
> skipped.
>
> The following is one example scenario that we can reduce one page fault
> every 16 page:
>
> Assume that we want to access pages sequentially and skip every page that
> marked as PG_readahead. Assume that the read-ahead size is 32 pages and the
> number of pages to be mapped each time (fault_around_pages) is 16.
>
> When accessing a page at offset 0, a major page fault occurs, so pages from
> page 0 to page 31 is read from the disk to the page cache. With this, page
> 24 is marked as a read-ahead page (PG_readahead). Then only page 0 is
> mapped to the virtual memory space.
>
> When accessing a page at offset 1, a minor page fault occurs, pages from
> page 0 to page 15 will be mapped.
>
> We keep accessing pages until page 31. Note that we skip page 24.
>
> When accessing a page at offset 32, a major page fault occurs. The same
> process will be repeated. The other 32 pages will be read from the disk.
> Only page 32 is mapped. Then a minor page fault at the next page (page
> 33) will occur.
>
> From this example, two page faults occur every 16 page. With this patch, we
> can eliminate the minor page fault in every 16 page.
>
> Thank you very much for your time for reviewing the patch.
>
> Signed-off-by: Sarunya Pumma <sarunya@vt.edu>
Still no performance numbers?
I doubt it's useful. You woundn't get "a number of minor page faults".
The first minor page fault would take faultaround path and map these
pages.
--
Kirill A. Shutemov
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-05-23 13:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-21 15:12 Sarunya Pumma
2017-05-22 15:50 ` kbuild test robot
2017-05-22 17:07 ` kbuild test robot
2017-06-01 22:01 ` [PATCH v2] " Sarunya Pumma
2017-06-02 5:04 ` Ross Zwisler
2017-05-23 13:07 ` Kirill A. Shutemov [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-05-16 16:16 [PATCH] " Sarunya Pumma
2017-05-18 5:53 ` Mike Rapoport
2017-05-18 10:09 ` Kirill A. Shutemov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170523130743.3oh3rlxwqg2odimg@node.shutemov.name \
--to=kirill@shutemov.name \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=dave.jiang@intel.com \
--cc=jack@suse.cz \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-mm@kvack.org \
--cc=lstoakes@gmail.com \
--cc=mhocko@suse.com \
--cc=ross.zwisler@linux.intel.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=sarunya@vt.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox