From: "Figo.zhang" <figo1802@gmail.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Linux-MM <linux-mm@kvack.org>
Subject: sched: Set preferred NUMA node based on number of private faults
Date: Tue, 24 Sep 2013 15:01:20 +0800 [thread overview]
Message-ID: <CAF7GXvqKg2rgeSZv5rTEvtz15hcg13Mhb+x5e5h=FUY8zQH09A@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1625 bytes --]
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 4baf12e..8e2a364 100644
--- a/mm/mempolicy.c<https://git.kernel.org/cgit/linux/kernel/git/mel/linux-balancenuma.git/tree/mm/mempolicy.c?h=sched-numa-balancing-stick-v8r17&id=d182f60b02e670ca2add388813b499ce275a9222>
+++ b/mm/mempolicy.c<https://git.kernel.org/cgit/linux/kernel/git/mel/linux-balancenuma.git/tree/mm/mempolicy.c?h=sched-numa-balancing-stick-v8r17&id=e5c6a5c945780aae8ea4e034cb230d0407c06d04>
@@ -2292,9 +2292,11 @@ int mpol_misplaced(struct page *page, struct
vm_area_struct *vma, unsigned long
/* Migrate the page towards the node whose CPU is referencing it */
if (pol->flags & MPOL_F_MORON) {
- int last_nid;
+ int last_nidpid;
+ int this_nidpid;
polnid = numa_node_id();
+ this_nidpid = nid_pid_to_nidpid(polnid, current->pid);
/*
* Multi-stage node selection is used in conjunction
@@ -2317,8 +2319,8 @@ int mpol_misplaced(struct page *page, struct
vm_area_struct *vma, unsigned long
* it less likely we act on an unlikely task<->page
* relation.
*/
- last_nid = page_nid_xchg_last(page, polnid);
- if (last_nid != polnid)
+ last_nidpid = page_nidpid_xchg_last(page, this_nidpid);
+ if (!nidpid_pid_unset(last_nidpid) && nidpid_to_nid(last_nidpid) !=
polnid)
=>if the page is the first access, so nidpid_pid_unset(last_nidpid) return
true, so we should not check and migrate the first access page if curnid !=
polnid.
- last_nid = page_nid_xchg_last(page, polnid);
- if (last_nid != polnid)
+ last_nidpid = page_nidpid_xchg_last(page, this_nidpid);
+ if (nidpid_pid_unset(last_nidpid))
+ goto out;
+ else if (nidpid_to_nid(last_nidpid) != polnid)
[-- Attachment #2: Type: text/html, Size: 5337 bytes --]
reply other threads:[~2013-09-24 7:01 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='CAF7GXvqKg2rgeSZv5rTEvtz15hcg13Mhb+x5e5h=FUY8zQH09A@mail.gmail.com' \
--to=figo1802@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
/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