Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752587AbdHPVVC (ORCPT ); Wed, 16 Aug 2017 17:21:02 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:33813 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbdHPVU6 (ORCPT ); Wed, 16 Aug 2017 17:20:58 -0400 From: Mathieu Poirier To: mingo@redhat.com, peterz@infradead.org Cc: tj@kernel.org, vbabka@suse.cz, lizefan@huawei.com, akpm@linux-foundation.org, weiyongjun1@huawei.com, juri.lelli@arm.com, rostedt@goodmis.org, claudio@evidence.eu.com, luca.abeni@santannapisa.it, bristot@redhat.com, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: [PATCH 5/7] cgroup: Concentrate DL related validation code in one place Date: Wed, 16 Aug 2017 15:20:41 -0600 Message-Id: <1502918443-30169-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502918443-30169-1-git-send-email-mathieu.poirier@linaro.org> References: <1502918443-30169-1-git-send-email-mathieu.poirier@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1273 Lines: 47 Having two different places to validate DL operations makes no sense. As such move everything in the same function. Signed-off-by: Mathieu Poirier --- 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