aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kthread.c3
-rw-r--r--kernel/sched/fair.c15
2 files changed, 10 insertions, 8 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c
index 087d18d771b5..ebebbcf3c5de 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -20,6 +20,7 @@
20#include <linux/freezer.h> 20#include <linux/freezer.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/uaccess.h> 22#include <linux/uaccess.h>
23#include <linux/numa.h>
23#include <trace/events/sched.h> 24#include <trace/events/sched.h>
24 25
25static DEFINE_SPINLOCK(kthread_create_lock); 26static DEFINE_SPINLOCK(kthread_create_lock);
@@ -675,7 +676,7 @@ __kthread_create_worker(int cpu, unsigned int flags,
675{ 676{
676 struct kthread_worker *worker; 677 struct kthread_worker *worker;
677 struct task_struct *task; 678 struct task_struct *task;
678 int node = -1; 679 int node = NUMA_NO_NODE;
679 680
680 worker = kzalloc(sizeof(*worker), GFP_KERNEL); 681 worker = kzalloc(sizeof(*worker), GFP_KERNEL);
681 if (!worker) 682 if (!worker)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 310d0637fe4b..0e6a0ef129c5 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1160,7 +1160,7 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
1160 1160
1161 /* New address space, reset the preferred nid */ 1161 /* New address space, reset the preferred nid */
1162 if (!(clone_flags & CLONE_VM)) { 1162 if (!(clone_flags & CLONE_VM)) {
1163 p->numa_preferred_nid = -1; 1163 p->numa_preferred_nid = NUMA_NO_NODE;
1164 return; 1164 return;
1165 } 1165 }
1166 1166
@@ -1180,13 +1180,13 @@ void init_numa_balancing(unsigned long clone_flags, struct task_struct *p)
1180 1180
1181static void account_numa_enqueue(struct rq *rq, struct task_struct *p) 1181static void account_numa_enqueue(struct rq *rq, struct task_struct *p)
1182{ 1182{
1183 rq->nr_numa_running += (p->numa_preferred_nid != -1); 1183 rq->nr_numa_running += (p->numa_preferred_nid != NUMA_NO_NODE);
1184 rq->nr_preferred_running += (p->numa_preferred_nid == task_node(p)); 1184 rq->nr_preferred_running += (p->numa_preferred_nid == task_node(p));
1185} 1185}
1186 1186
1187static void account_numa_dequeue(struct rq *rq, struct task_struct *p) 1187static void account_numa_dequeue(struct rq *rq, struct task_struct *p)
1188{ 1188{
1189 rq->nr_numa_running -= (p->numa_preferred_nid != -1); 1189 rq->nr_numa_running -= (p->numa_preferred_nid != NUMA_NO_NODE);
1190 rq->nr_preferred_running -= (p->numa_preferred_nid == task_node(p)); 1190 rq->nr_preferred_running -= (p->numa_preferred_nid == task_node(p));
1191} 1191}
1192 1192
@@ -1400,7 +1400,7 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page,
1400 * two full passes of the "multi-stage node selection" test that is 1400 * two full passes of the "multi-stage node selection" test that is
1401 * executed below. 1401 * executed below.
1402 */ 1402 */
1403 if ((p->numa_preferred_nid == -1 || p->numa_scan_seq <= 4) && 1403 if ((p->numa_preferred_nid == NUMA_NO_NODE || p->numa_scan_seq <= 4) &&
1404 (cpupid_pid_unset(last_cpupid) || cpupid_match_pid(p, last_cpupid))) 1404 (cpupid_pid_unset(last_cpupid) || cpupid_match_pid(p, last_cpupid)))
1405 return true; 1405 return true;
1406 1406
@@ -1848,7 +1848,7 @@ static void numa_migrate_preferred(struct task_struct *p)
1848 unsigned long interval = HZ; 1848 unsigned long interval = HZ;
1849 1849
1850 /* This task has no NUMA fault statistics yet */ 1850 /* This task has no NUMA fault statistics yet */
1851 if (unlikely(p->numa_preferred_nid == -1 || !p->numa_faults)) 1851 if (unlikely(p->numa_preferred_nid == NUMA_NO_NODE || !p->numa_faults))
1852 return; 1852 return;
1853 1853
1854 /* Periodically retry migrating the task to the preferred node */ 1854 /* Periodically retry migrating the task to the preferred node */
@@ -2095,7 +2095,7 @@ static int preferred_group_nid(struct task_struct *p, int nid)
2095 2095
2096static void task_numa_placement(struct task_struct *p) 2096static void task_numa_placement(struct task_struct *p)
2097{ 2097{
2098 int seq, nid, max_nid = -1; 2098 int seq, nid, max_nid = NUMA_NO_NODE;
2099 unsigned long max_faults = 0; 2099 unsigned long max_faults = 0;
2100 unsigned long fault_types[2] = { 0, 0 }; 2100 unsigned long fault_types[2] = { 0, 0 };
2101 unsigned long total_faults; 2101 unsigned long total_faults;
@@ -2638,7 +2638,8 @@ static void update_scan_period(struct task_struct *p, int new_cpu)
2638 * the preferred node. 2638 * the preferred node.
2639 */ 2639 */
2640 if (dst_nid == p->numa_preferred_nid || 2640 if (dst_nid == p->numa_preferred_nid ||
2641 (p->numa_preferred_nid != -1 && src_nid != p->numa_preferred_nid)) 2641 (p->numa_preferred_nid != NUMA_NO_NODE &&
2642 src_nid != p->numa_preferred_nid))
2642 return; 2643 return;
2643 } 2644 }
2644 2645