lkml.org 
[lkml]   [2004]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectuse linear_page_index() in mm/mempolicy.c
mm/mempolicy.c is computing linear_page_index() by hand. This teaches
alloc_page_vma() to use the pagemap.h helper function for it. This is
particularly helpful for when how linear_page_index() is computed changes.


Index: spinlock-2.6.8-rc4/mm/mempolicy.c
===================================================================
--- spinlock-2.6.8-rc4.orig/mm/mempolicy.c 2004-08-10 23:00:25.101832328 -0700
+++ spinlock-2.6.8-rc4/mm/mempolicy.c 2004-08-12 19:20:41.784408232 -0700
@@ -668,11 +668,9 @@
if (unlikely(pol->policy == MPOL_INTERLEAVE)) {
unsigned nid;
if (vma) {
- unsigned long off;
+ unsigned long off = linear_page_index(vma, addr);
BUG_ON(addr >= vma->vm_end);
BUG_ON(addr < vma->vm_start);
- off = vma->vm_pgoff;
- off += (addr - vma->vm_start) >> PAGE_SHIFT;
nid = offset_il_node(pol, vma, off);
} else {
/* fall back to process interleaving */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.032 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site