Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754628AbcKYNV2 (ORCPT ); Fri, 25 Nov 2016 08:21:28 -0500 Received: from mout.gmx.net ([212.227.15.18]:52302 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015AbcKYNU7 (ORCPT ); Fri, 25 Nov 2016 08:20:59 -0500 Message-ID: <1480078973.4075.58.camel@gmx.de> Subject: Re: RFC: documentation of the autogroup feature [v2] From: Mike Galbraith To: "Michael Kerrisk (man-pages)" Cc: Peter Zijlstra , Ingo Molnar , linux-man , lkml , Thomas Gleixner Date: Fri, 25 Nov 2016 14:02:53 +0100 In-Reply-To: References: <41d802dc-873a-ff02-17ff-93ce50f3e925@gmail.com> <1479901185.4306.38.camel@gmx.de> <327586fa-4672-d070-0ded-850654586273@gmail.com> <1479915229.4306.106.camel@gmx.de> <7513b0a5-c5d0-3a92-5849-995af22601e4@gmail.com> <1479921075.4306.153.camel@gmx.de> Content-Type: text/plain; charset="iso-2022-jp" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:StTlnMGUxW9LfBZ5g3dOxiUT9wNh2m1CeHh3b4VjwVnpLlbLoP9 7kFJ3G/cA1gw1R9+aiqU6RuW51hQby5eqn0nEDa3Lg+KdB42bu6D/lOXKuHYMhw5OinTs9K YiFKWPkyBecIAwbJ70oAN25G0jS6GB6ZYtt6DvCFhfPuBwN+KaxUtSnLp9hF0sTsT6SYI6K DwXv13FDBv+/1gMMHuumQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZUUAvWQbi1g=:BUqU7LhsnXLUEELzwJsFYu IPe466RnD9Pz5R8Iu9m+MNrNO9bApXt7ip1m7In6DJ9yIFdp+zFLZPudsfiZ11+F3Q3s9zpjo D+eiAUZOLQ8s6pkCMkEs6kR2BUGrlgDtIfWX1D4UTEYmYZzCe7YSs/duUBplX+oZRvrw858G+ h5Y+hNTzfLJGB/nGvmRddtUfL2zM7IfxvYcnTijS7CzrcMjFaJOkwAVOjuPSXgz8ljZEKs3b+ sw2KNHUkPQ9uH41BUPl0/bFA/rDiYXYMIyy5QAtRDcjU2yH7Jl08mOy4+bJNYk+TpvgkpP09I g6L9gs8nzdo9Do1L7aNeG3JgrNvn7QvxOc49MAw1gPVCZgmnMjTo3XgKL07MTQ9j6+ONdFlKe JMdMrJcFwINvDgmLUQd9rnZvHbC4/Fet27JaGsHLqZRzdeF2eSccr0gfO1g1FrHNUz4KqYmGL IREtG4RpqwokMyslrQ7JZBrD8ohiH9FL8p04m5nUyDdY3M105itl5y5G6E1U9YbCKR5lHI1dw FZ7VRW/7CpYp+Fi7JSUOm1PpFEwlatNpYIB69SI2iZlg9pGL7LC3pOOVacLsyHkYhysqcwIMB dcc5OEPq3BXKwe/vD5KRp3KawTep1u0omfhkhlmC7vXJCcOfcAE5VutU6CvfOJQEpBPRKDZHG 2swpr+ofOqGMwdBHdSBJZSNzervXM4iavEOs1ulvmeuqh8wT1cfRjJWp01qcRs3vQWCSjtEZX eP3aC9FY+0I+2N9ho9pIBlscdduXH/j4olktZ7KnRfnOk0V73jZeiFpeWjLSqaQ7gGq4KSDbv q73m+6H Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3008 Lines: 45 On Thu, 2016-11-24 at 22:41 +0100, Michael Kerrisk (man-pages) wrote: > Suppose that there are two autogroups competing for the same > CPU. The first group contains ten CPU-bound processes from a > kernel build started with make -j10. The other contains a sin‐ > gle CPU-bound process: a video player. The effect of auto‐ > grouping is that the two groups will each receive half of the > CPU cycles. That is, the video player will receive 50% of the > CPU cycles, rather just 9% of the cycles, which would likely > lead to degraded video playback. Or to put things another way: > an autogroup that contains a large number of CPU-bound pro‐ > cesses does not end up overwhelming the CPU at the expense of > the other jobs on the system. I'd say something more wishy-washy here, like cycles are distributed fairly across groups and leave it at that, as your detailed example is incorrect due to SMP fairness (which I don't like much because [very unlikely] worst case scenario renders a box sized group incapable of utilizing more that a single CPU total). For example, if a group of NR_CPUS size competes with a singleton, load balancing will try to give the singleton a full CPU of its very own. If groups intersect for whatever reason on say my quad lappy, distribution is 80/20 in favor of the singleton. > ┌─────────────────────────────────────────────────────┐ > │FIXME │ > ├─────────────────────────────────────────────────────┤ > │How do the nice value of a process and the nice │ > │value of an autogroup interact? Which has priority? │ > │ │ > │It *appears* that the autogroup nice value is used │ > │for CPU distribution between task groups, and that │ > │the process nice value has no effect there. (I.e., │ > │suppose two autogroups each contain a CPU-bound │ > │process, with one process having nice==0 and the │ > │other having nice==19. It appears that they each │ > │get 50% of the CPU.) It appears that the process │ > │nice value has effect only with respect to schedul‐ │ > │ing relative to other processes in the *same* auto‐ │ > │group. Is this correct? │ > └─────────────────────────────────────────────────────┘ Yup, entity nice level affects distribution among peer entities. -Mike