lkml.org 
[lkml]   [2012]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 14/26] sched, numa: Numa balancer
From
Date
On Sun, 2012-07-08 at 14:35 -0400, Rik van Riel wrote:
>
> This looks like something that should be fixed before the
> code is submitted for merging upstream.

static bool __task_can_migrate(struct task_struct *t, u64 *runtime, int node)
{
#ifdef CONFIG_CPUSETS
if (!node_isset(node, t->mems_allowed))
return false;
#endif

if (!cpumask_intersects(cpumask_of_node(node), tsk_cpus_allowed(t)))
return false;

*runtime += t->se.sum_exec_runtime; // @#$#@ 32bit

return true;
}

static bool process_can_migrate(struct numa_entity *ne, int node)
{
struct task_struct *p, *t;
bool allowed = false;
u64 runtime = 0;

rcu_read_lock();
t = p = ne_owner(ne);
if (p) do {
allowed = __task_can_migrate(t, &runtime, node);
if (!allowed)
break;
} while ((t = next_thread(t)) != p);
rcu_read_unlock();

/*
* Don't bother migrating memory if there's less than 1 second
* of runtime on the tasks.
*/
return allowed && runtime > NSEC_PER_SEC;
}

is what it looks like..


\
 
 \ /
  Last update: 2012-07-09 15:41    [W:0.309 / U:5.416 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site