Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2933388imm; Thu, 24 May 2018 19:20:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq/W5s7HwR4vo2jFrLJ9ykOuL6FlgSOBbkp3pKKb9fAxBAKVjlxyafEOV5O8BdHJrINjcwW X-Received: by 2002:a17:902:6b0c:: with SMTP id o12-v6mr533679plk.159.1527214851234; Thu, 24 May 2018 19:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214851; cv=none; d=google.com; s=arc-20160816; b=I4K76IPeFW8XrCZtzCPWm3eD4NDUSHXHwqRvHplVahYDHvBtgTnE996pVWgAW5hk6h 3HvksvSvPcs9nqoS3Q5NeM/CUidy/3uKaVLndF+L7T2Lz0gXizfZh5kH7R67mqDLgGMM KXdHG5ZPRzpiFkYOF7WDh9hmOrF8K2MLaAEHEL+j5lVy0Agi/4Dluyv2cSP7bMxuzRLu QmaSinjWRYiRa7RfYdB3ufAP1+1l7y3LTWiVbQ6kf3+yA2LsBOIpymSuc9GXSal/wnrf 7dVaXBXc+WrZp0h6gKmpxn+vbwnRlAQwe6I7DEMbsq6qlg1rDvtMg5rI7MbDRBaX5Sy2 tgGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=mTS5DTHWm3Ox3YE3ihPYoxRrj9q83FTQbPJoKoZTDyM=; b=KMe0Xz8RuY5OGT/Q9EfuPKt8AV45EIQS82BgO53UXwey+wWI8bd6qSIm8NlQaO1UUV +FsThVAtM2FQO3AhgIEcmnFD7ST4d0QlUwzUav0ioiFYMb1XxKLJj5bMQdZ5nzp1i7WN kmg4m/WFwcC20dTxXqVq/1iqKD7y2MXimcV79wHpX5rwRZz41l7NN9Xt9zhpzswMp8um CXC6WiBeOlcxjCUQ93U68n6atsZTO7gCrLPnX+m6czZ3FdNSjKk0OuNMP46w6Ep1UBip ZQDRmq51gGcIuQb23yiRvpPq+jWUXTEUZ/8XbNbyZpjZE6dyDINia/Fy8wz4aj3SOGJy 1i9A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8-v6si17007615pgn.428.2018.05.24.19.20.36; Thu, 24 May 2018 19:20:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966293AbeEXPRE (ORCPT + 99 others); Thu, 24 May 2018 11:17:04 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52073 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966258AbeEXPRB (ORCPT ); Thu, 24 May 2018 11:17:01 -0400 Received: by mail-wm0-f67.google.com with SMTP id j4-v6so6207509wme.1 for ; Thu, 24 May 2018 08:17:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mTS5DTHWm3Ox3YE3ihPYoxRrj9q83FTQbPJoKoZTDyM=; b=MPwqfe/uKk0rCqd4mUjJGvPsbTeDZiGtoL7xAHfOWdxUWTo+CmMyWI77GbVf1V9FG0 GWb70Y/bfHYwQ/jG4sU+2hBTw1KGRovZKy+Bnnsd661ZRgNCSmtYaRvZiXHB8074a/nA P3A4RHHSjSZEy86UFykZwQNiT+E1fujf58c6wVgP5tjxiF2KXSQW3xB0xvmAfomrwfaA accle/vE8ueO9bCKEmzeWtG6CteIygxIvyWaXpBaEby/SpdQD0UE9C/BcB6gAZ9NKTEJ ibzG0SmLj1Yr7uYpZPKBXRGbN3qGLzNFzKlucEyOeyjXmgID7Vd8bKJ7YHfHVuJ+b6Kw ydFg== X-Gm-Message-State: ALKqPwctKVKEc6PRzdA8vFVW4yDBqtJjYFBaxx7DYzo/d5HGXaBiSKlh +1Vm9Hn43piV13xOmJms/lRywQ== X-Received: by 2002:a1c:904b:: with SMTP id s72-v6mr7512185wmd.85.1527175019727; Thu, 24 May 2018 08:16:59 -0700 (PDT) Received: from localhost.localdomain ([151.15.207.242]) by smtp.gmail.com with ESMTPSA id m134-v6sm5851099wmg.13.2018.05.24.08.16.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 May 2018 08:16:58 -0700 (PDT) Date: Thu, 24 May 2018 17:16:56 +0200 From: Juri Lelli To: Waiman Long Cc: Tejun Heo , Li Zefan , Johannes Weiner , Peter Zijlstra , Ingo Molnar , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, kernel-team@fb.com, pjt@google.com, luto@amacapital.net, Mike Galbraith , torvalds@linux-foundation.org, Roman Gushchin Subject: Re: [PATCH v8 3/6] cpuset: Add cpuset.sched.load_balance flag to v2 Message-ID: <20180524151656.GD3948@localhost.localdomain> References: <1526590545-3350-1-git-send-email-longman@redhat.com> <1526590545-3350-4-git-send-email-longman@redhat.com> <20180524143614.GC3948@localhost.localdomain> <4bd31510-4f73-e263-8dc1-5edb0fe63b59@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4bd31510-4f73-e263-8dc1-5edb0fe63b59@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/05/18 11:09, Waiman Long wrote: > On 05/24/2018 10:36 AM, Juri Lelli wrote: > > On 17/05/18 16:55, Waiman Long wrote: > > > > [...] > > > >> + A parent cgroup cannot distribute all its CPUs to child > >> + scheduling domain cgroups unless its load balancing flag is > >> + turned off. > >> + > >> + cpuset.sched.load_balance > >> + A read-write single value file which exists on non-root > >> + cpuset-enabled cgroups. It is a binary value flag that accepts > >> + either "0" (off) or a non-zero value (on). This flag is set > >> + by the parent and is not delegatable. > >> + > >> + When it is on, tasks within this cpuset will be load-balanced > >> + by the kernel scheduler. Tasks will be moved from CPUs with > >> + high load to other CPUs within the same cpuset with less load > >> + periodically. > >> + > >> + When it is off, there will be no load balancing among CPUs on > >> + this cgroup. Tasks will stay in the CPUs they are running on > >> + and will not be moved to other CPUs. > >> + > >> + The initial value of this flag is "1". This flag is then > >> + inherited by child cgroups with cpuset enabled. Its state > >> + can only be changed on a scheduling domain cgroup with no > >> + cpuset-enabled children. > > [...] > > > >> + /* > >> + * On default hierachy, a load balance flag change is only allowed > >> + * in a scheduling domain with no child cpuset. > >> + */ > >> + if (cgroup_subsys_on_dfl(cpuset_cgrp_subsys) && balance_flag_changed && > >> + (!is_sched_domain(cs) || css_has_online_children(&cs->css))) { > >> + err = -EINVAL; > >> + goto out; > >> + } > > The rule is actually > > > > - no child cpuset > > - and it must be a scheduling domain > > > > Right? > > Yes, because it doesn't make sense to have a cpu in one cpuset that has > loading balance off while, at the same time, in another cpuset with load > balancing turned on. This restriction is there to make sure that the > above condition will not happen. I may be wrong if there is a realistic > use case where the above condition is desired. Yep, makes sense to me. Maybe add the second condition to the comment and documentation.