From patchwork Wed Aug 16 21:20:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 110281 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1323480qge; Wed, 16 Aug 2017 14:21:07 -0700 (PDT) X-Received: by 10.101.76.76 with SMTP id l12mr2790617pgr.161.1502918466880; Wed, 16 Aug 2017 14:21:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502918466; cv=none; d=google.com; s=arc-20160816; b=fEFHlNUtjbhsuKTJ88G1XvUKrcI9uAfDEePrq1gJdoX1/PSc5PYA5d7HHG6tzOhis9 /A5K2J16W3HQO+B2/fq+5CwWvFnW2fML7ZH+9Z3BPkZA8R6WViHJxEr4XGJdh7Aty7h8 j+dAxkUlKvOoEDS/bx/Y7PO6ngyaNa64OP84otPuHAYT++9XTdsV1fC19T/HZApl6SGK nMgSvRLCVjdTZiBPPDz1ayiYeSfe63irHdxA78AbkwU1KAs2oxOHHRYPUWYXgRWSAGv9 DmxU7RLdDbKScRlSVmOPky0GN+fnKQM9HyCo+qQFzqexP9PBA4MnjJzs+s42BzySVXLH 6AEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=ePka7MoBqX4VPf4SeuVO6yFK+ih1iNTydl0uFRIkVgc=; b=sgI4Sa8K3RFAgjsgNNO+VyxhOVZv3AdQnEVw5j/CuDFrrVL0UfIlreax90wmjZILN4 HPagnrFo/YLHku/RPkiulE9O8OLxiY/JPc62YwAieKnCqHQlExGVxmvy0LnjM1OtcOuy C6Z6GP4NVydFiSD+llT+uVfnAokfnwyiwDWM8z3qx1LgHAfqTigTUizTdGQp20bog+kF dAB6B8Ne6ugm3t2A7PhBFvm3vfxb9+29hFWiFf+CTt37cy+UP2Urtwr9tqaqLq14bybY N6Xuflt6eseN4V/ZJ0KtRSXLZcbKGMqZZVKq8poZWxa20QkLGnEIFFSOFZR6vEOmoZpD rd/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyhYqAjJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p81si1043425pfd.11.2017.08.16.14.21.06; Wed, 16 Aug 2017 14:21:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NyhYqAjJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752588AbdHPVVC (ORCPT + 26 others); 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 Received: by mail-io0-f175.google.com with SMTP id o9so17467527iod.1 for ; Wed, 16 Aug 2017 14:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ePka7MoBqX4VPf4SeuVO6yFK+ih1iNTydl0uFRIkVgc=; b=NyhYqAjJv/eRbdyw1xvabGeHCe7yEyqv5jy5PerhGd00FQkN/qeOZ9KpsJeq7yHPK2 vw0MEkx3BR+bHCMNzN2YK55juEeJV2KYutMe/G/KPtMJvLAet1KilBOdjIn7AHWDx0X6 hMKh+lEXIa0e82Qu4BBWUk4J6vIAvYzEW+uWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ePka7MoBqX4VPf4SeuVO6yFK+ih1iNTydl0uFRIkVgc=; b=orb/NA30hWbz28QfqaZJk0y+ziDdChIxGWuzgeioEFvzgTRsXjVUUoIFjfNnE+WscO tQudMRO09pVwHsr3W85UVTEdoJOa+eFd3tlwwMF+QTq5YKPWlsPZ3XZ4nGbVmuzN4mdY 2Zq3NjW3mlmk3wnKNRqh9FSNJNLEvcKtmHFOiznv5486O2O3AhoX76DX5h2UNhsql8kc MtUy6QwtjGXRUbVuReqKV5XjSyDumgXfkuIyXzdrjVdx6TrMl+Q6izbdwsXtGfQjG26D FKuwoOZ/+S/Ce77sD2NGalJkdlW9LN8meNR6IcRwbqLy8Voq632u64B4Rk/VGG+h6xR3 acqA== X-Gm-Message-State: AHYfb5ggytr9I912+O6Ov4DO6+5HszZZ4yNcTSoUtyua5HHY+CPoSv/O SKo4Ie4OqBD3/iksjoOU8A== X-Received: by 10.107.59.19 with SMTP id i19mr2615164ioa.96.1502918457949; Wed, 16 Aug 2017 14:20:57 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 80sm918281itk.11.2017.08.16.14.20.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Aug 2017 14:20:56 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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();