lkml.org 
[lkml]   [2018]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 3/3] sched/core: Error out if cpumask has a mix of isolcpus and housekeeping CPUs
Date
Return EINVAL, if the user has passed a mix of isolcpus and housekeeping
CPUs in cpumask to sched_setaffinity(). This will ensure that users are
notified so that they can take corrective actions to ensure consistent
behaviour. This might cause a change in sched_setaffinity behaviour when
isolcpus is set.

Suggested-by: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
kernel/sched/core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 37e62b8..3842471 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4798,9 +4798,12 @@ long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
* housekeeping_cpumask
*/
if (!cpumask_subset(new_mask, hk_mask) &&
- cpumask_intersects(new_mask, hk_mask))
+ cpumask_intersects(new_mask, hk_mask)) {
pr_warn("pid %d: Mix of isolcpus and non-isolcpus provided\n",
p->pid);
+ retval = -EINVAL;
+ goto out_free_new_mask;
+ }

/*
* Since bandwidth control happens on root_domain basis,
--
1.8.3.1
\
 
 \ /
  Last update: 2018-10-25 20:43    [W:0.051 / U:0.044 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site