Thread (177 messages) 177 messages, 16 authors, 2012-07-14

Re: [PATCH 09/40] autonuma: introduce kthread_bind_node()

From: Konrad Rzeszutek Wilk <hidden>
Date: 2012-07-05 12:04:30
Also in: lkml

/**
 * kthread_bind_node - bind a just-created kthread to the CPUs of a node.
 * @p: thread created by kthread_create().
 * @nid: node (might not be online, must be possible) for @k to run on.
 *
 * Description: This function is equivalent to set_cpus_allowed(),
 * except that @nid doesn't need to be online, and the thread must be
 * stopped (i.e., just returned from kthread_create()).
 */
void kthread_bind_node(struct task_struct *p, int nid)
{
	/* Must have done schedule() in kthread() before we set_task_cpu */
	if (!wait_task_inactive(p, TASK_UNINTERRUPTIBLE)) {
		WARN_ON(1);
		return;
	}

	/* It's safe because the task is inactive. */
	do_set_cpus_allowed(p, cpumask_of_node(nid));
	p->flags |= PF_THREAD_BOUND;
}
EXPORT_SYMBOL(kthread_bind_node);

The above should explain why it's not _GPL right now. As far as
AutoNUMA is concerned I can drop the EXPORT_SYMBOL completely and not
allow modules to call this. In fact I could have coded this inside
autonuma too.
Ok. How about dropping it and then if its needed for modules then
export it out.
I can change it to _GPL, drop the EXPORT_SYMBOL or move it inside the
autonuma code, let me know what you prefer. If I hear nothing I won't
make changes.

Thanks,
Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help