From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: use linear_page_index() in mm/mempolicy.c
Date: Thu, 12 Aug 2004 19:35:12 -0700 [thread overview]
Message-ID: <20040813023512.GV11200@holomorphy.com> (raw)
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 */
reply other threads:[~2004-08-13 2:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040813023512.GV11200@holomorphy.com \
--to=wli@holomorphy.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®