Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp923672ybi; Fri, 2 Aug 2019 06:33:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQp7oWEYlMP4ZWp02/fQ1STFNXip5xbNrESnzl9Ve9MWBII794sec2NaDQ1Sue2oBofdNO X-Received: by 2002:a62:642:: with SMTP id 63mr60185536pfg.257.1564752793588; Fri, 02 Aug 2019 06:33:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564752793; cv=none; d=google.com; s=arc-20160816; b=wWSwFoXnGVdifB95J8YBK7rHtTAyfsN+ZGHfOp14wQZJYVSy2hB08Iwcx12i29IGO8 KUgJJ4QVh85HOyLlRuQWb4DoUmo0jfIoxYBEJATefHiNU8/JWW9x4s3oXulRi3bFqjCI YMlGHnjwphvU3KpJZ95KIAxdK+/ctuhyy8hwHem3bzMFJAa9DwBomjXUL/xMfFMrcejJ KaCcQUw0J676GuP0/WIPO4PBKdQJDVC+jGNX5iM1dQe9TPVEjxkCaBXaRxb/ARvnMcKB darFwxLGuMFAMfI02opYeXJfY18grgRrHJYXWZa19KBcp9ezKcGWC9WJBqY6raFkfDfH NWtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=XnKhcNM0eGyPCI5FCTJRjFrn9U0lNXFmAMDpDKuXiPQ=; b=p+G3kaJ0j0lrdAMz/SpmadQTOvz8cP8jmDo0cgAm+8isrghpZpBh5J5eNw7PpyCM9s 4IrTA2zQ4o+9JnfmvYpdfMXmRHr1L139ul/EfzfFbk6Y4M/GNzWqbRXm31/xfPDGFxLP 0kwrlTFIvjJ5T70wJIoM4jweul3zTDs00Bm6i306wprgMZ0tq3iZJnApbf95kHlRXF5G M/YwuzzHOLtcQZixI1DLOMxNDm+YTwmyVwMjq8N0WcAZJLKhYIxLB/6y3hpeGswoSomM PazlIew9v8jHyX9Ec/GlI4QCyJ6hmKIADxE0IuB47UPW6+Q1IRU+ES6ARtmkrqHzZdKf tf7Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si40360198pfq.115.2019.08.02.06.32.58; Fri, 02 Aug 2019 06:33:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405741AbfHBJun (ORCPT + 99 others); Fri, 2 Aug 2019 05:50:43 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:39175 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404933AbfHBJuf (ORCPT ); Fri, 2 Aug 2019 05:50:35 -0400 Received: from [5.158.153.52] (helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1htUCg-0001sw-HD; Fri, 02 Aug 2019 11:50:26 +0200 Date: Fri, 2 Aug 2019 11:50:20 +0200 (CEST) From: Thomas Gleixner To: Peter Zijlstra cc: Qais Yousef , mingo@kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: Re: [PATCH 0/5] Fix FIFO-99 abuse In-Reply-To: <20190802093244.GF2332@hirez.programming.kicks-ass.net> Message-ID: References: <20190801111348.530242235@infradead.org> <20190801131707.5rpyydznnhz474la@e107158-lin.cambridge.arm.com> <20190802093244.GF2332@hirez.programming.kicks-ass.net> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Aug 2019, Peter Zijlstra wrote: > On Thu, Aug 01, 2019 at 02:17:07PM +0100, Qais Yousef wrote: > > On 08/01/19 13:13, Peter Zijlstra wrote: > > > I noticed a bunch of kthreads defaulted to FIFO-99, fix them. > > > > > > The generic default is FIFO-50, the admin will have to configure the system > > > anyway. > > > > > > For some the purpose is to be above OTHER and then FIFO-1 really is sufficient. > > > > I was looking in this area too and was thinking of a way to consolidate the > > creation of RT/DL tasks in the kernel and the way we set the priority. > > > > Does it make sense to create a new header for RT priorities for kthreads > > created in the kernel so that we can easily track and rationale about the > > relative priorities of in-kernel RT tasks? > > > > When working in the FW world such a header helped a lot in understanding what > > runs at each priority level and how to reason about what priority level makes > > sense for a new item. It could be a nice single point of reference; even for > > admins. > > Well, SCHED_FIFO is a broken scheduler model; that is, it is > fundamentally incapable of resource management, which is the one thing > an OS really should be doing. > > This is of course the reason it is limited to privileged users only. > > Worse still; it is fundamentally impossible to compose static priority > workloads. You cannot take two correctly working static prio workloads > and smash them together and still expect them to work. > > For this reason 'all' FIFO tasks the kernel creates are basically at: > > MAX_RT_PRIO / 2 > > The administrator _MUST_ configure the system, the kernel simply doesn't > know enough information to make a sensible choice. > > Now, Geert suggested so make make a define for that, but how about we do > something like: > > /* > * ${the above explanation} > */ > int kernel_setscheduler_fifo(struct task_struct *p) > { > struct sched_param sp = { .sched_priority = MAX_RT_PRIO / 2 }; > return sched_setscheduler_nocheck(p, SCHED_FIFO, &sp); > } > > And then take away sched_setscheduler*(). Yes, please. tglx