Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713341

[PATCH 5/7] cgroup: Concentrate DL related validation code in one place

From Mathieu Poirier <mathieu.poirier@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 5/7] cgroup: Concentrate DL related validation code in one place
Date 2017-08-16 23:30 +0200
Message-ID <ufe31-3PN-35@gated-at.bofh.it> (permalink)
References <ufe2Z-3PN-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Having two different places to validate DL operations makes no sense.  As
such move everything in the same function.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
---
 kernel/cgroup/cpuset.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 18df143b4013..8d2ba5591dfb 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -477,6 +477,15 @@ static int validate_dl_change(struct cpuset *cur, struct cpuset *trial)
 	struct cpuset *cs;
 
 	/*
+	 * We can't shrink if we won't have enough room for SCHED_DEADLINE
+	 * tasks.
+	 */
+	if (is_cpu_exclusive(cur) &&
+	    !cpuset_cpumask_can_shrink(cur->cpus_allowed,
+				       trial->cpus_allowed))
+		goto out;
+
+	/*
 	 * The cpuset.sched_load_balance flag is flipped off on
 	 * the current cpuset.
 	 */
@@ -606,16 +615,6 @@ static int validate_change(struct cpuset *cur, struct cpuset *trial)
 			goto out;
 	}
 
-	/*
-	 * We can't shrink if we won't have enough room for SCHED_DEADLINE
-	 * tasks.
-	 */
-	ret = -EBUSY;
-	if (is_cpu_exclusive(cur) &&
-	    !cpuset_cpumask_can_shrink(cur->cpus_allowed,
-				       trial->cpus_allowed))
-		goto out;
-
 	ret = 0;
 out:
 	rcu_read_unlock();
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting  Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-08-16 23:30 +0200
  [PATCH 5/7] cgroup: Concentrate DL related validation code in one place Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-08-16 23:30 +0200
  Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Luca Abeni <luca.abeni@santannapisa.it> - 2017-08-22 14:30 +0200
    Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-08-23 21:50 +0200
      Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Luca Abeni <luca.abeni@santannapisa.it> - 2017-08-24 10:00 +0200
        Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Juri Lelli <juri.lelli@arm.com> - 2017-08-24 10:40 +0200
        Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-08-24 22:40 +0200
          Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting luca abeni <luca.abeni@santannapisa.it> - 2017-08-25 08:10 +0200
            Re: [PATCH 0/7] sched/deadline: fix cpusets bandwidth accounting Luca Abeni <luca.abeni@santannapisa.it> - 2017-08-25 12:00 +0200

csiph-web