All of lore.kernel.org
 help / color / mirror / Atom feed
* use linear_page_index() in mm/mempolicy.c
@ 2004-08-13  2:35 William Lee Irwin III
  0 siblings, 0 replies; only message in thread
From: William Lee Irwin III @ 2004-08-13  2:35 UTC (permalink / raw)
  To: linux-kernel

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 */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-13  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13  2:35 use linear_page_index() in mm/mempolicy.c William Lee Irwin III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.