Skip to content

Commit 3327de4

Browse files
Frederic Weisbeckerkawasaki
authored andcommitted
kthread: Document kthread_affine_preferred()
The documentation of this new API has been overlooked during its introduction. Fill the gap. Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
1 parent 3b96bcf commit 3327de4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

kernel/kthread.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,18 @@ int kthreadd(void *unused)
856856
return 0;
857857
}
858858

859+
/**
860+
* kthread_affine_preferred - Define a kthread's preferred affinity
861+
* @p: thread created by kthread_create().
862+
* @mask: preferred mask of CPUs (might not be online, must be possible) for @p
863+
* to run on.
864+
*
865+
* Similar to kthread_bind_mask() except that the affinity is not a requirement
866+
* but rather a preference that can be constrained by CPU isolation or CPU hotplug.
867+
* Must be called before the first wakeup of the kthread.
868+
*
869+
* Returns 0 if the affinity has been applied.
870+
*/
859871
int kthread_affine_preferred(struct task_struct *p, const struct cpumask *mask)
860872
{
861873
struct kthread *kthread = to_kthread(p);

0 commit comments

Comments
 (0)