Example #1
0
static inline int zref_in_nodemask(struct zoneref *zref, nodemask_t *nodes)
{
#ifdef CONFIG_NUMA
	return node_isset(zonelist_node_idx(zref), *nodes);
#else
	return 1;
#endif /* CONFIG_NUMA */
}
Example #2
0
static void sched_show_numa(struct task_struct *p, struct seq_file *m)
{
#ifdef CONFIG_NUMA_BALANCING
	struct mempolicy *pol;
	int node, i;

	if (p->mm)
		P(mm->numa_scan_seq);

	task_lock(p);
	pol = p->mempolicy;
	if (pol && !(pol->flags & MPOL_F_MORON))
		pol = NULL;
	mpol_get(pol);
	task_unlock(p);

	SEQ_printf(m, "numa_migrations, %ld\n", xchg(&p->numa_pages_migrated, 0));

	for_each_online_node(node) {
		for (i = 0; i < 2; i++) {
			unsigned long nr_faults = -1;
			int cpu_current, home_node;

			if (p->numa_faults)
				nr_faults = p->numa_faults[2*node + i];

			cpu_current = !i ? (task_node(p) == node) :
				(pol && node_isset(node, pol->v.nodes));

			home_node = (p->numa_preferred_nid == node);

			SEQ_printf(m, "numa_faults, %d, %d, %d, %d, %ld\n",
				i, node, cpu_current, home_node, nr_faults);
		}
	}

	mpol_put(pol);
#endif
}