From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756087AbcAOIVV (ORCPT ); Fri, 15 Jan 2016 03:21:21 -0500 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36378 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754476AbcAOIVU (ORCPT ); Fri, 15 Jan 2016 03:21:20 -0500 Subject: Re: [RFC 8/8] Do not reclaim the whole CPU bandwidth To: Peter Zijlstra References: <1452785094-3086-1-git-send-email-luca.abeni@unitn.it> <1452785094-3086-9-git-send-email-luca.abeni@unitn.it> <20160114195904.GH6357@twins.programming.kicks-ass.net> Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli From: Luca Abeni Message-ID: <5698ABFD.1040704@unitn.it> Date: Fri, 15 Jan 2016 09:21:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20160114195904.GH6357@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/14/2016 08:59 PM, Peter Zijlstra wrote: > On Thu, Jan 14, 2016 at 04:24:53PM +0100, Luca Abeni wrote: >> Original GRUB tends to reclaim 100% of the CPU time... And this allows a >> "CPU hog" (i.e., a busy loop) to starve non-deadline tasks. >> To address this issue, allow the scheduler to reclaim only a specified >> fraction of CPU time. >> NOTE: the fraction of CPU time that cannot be reclaimed is currently >> hardcoded as (1 << 20) / 10 -> 90%, but it must be made configurable! > > So the alternative is an explicit SCHED_OTHER server which is > configurable. Yes, I have thought about something similar (actually, this is the strategy I implemented in my first CBS/GRUB scheduler. With the "old" 2.4 scheduler, this was easier :). But I think the solution I implemented in this patch is much simpler (it just requires a very simple modification to grub_reclaim()) and is more elegant from the theoretical point of view. > That would maybe fit in nicely with the DL based FIFO/RR servers from > this other pending project. Yes, this reminds me about the half-finished patch for RT throttling using SCHED_DEADLINE... But that patch needs much more work IMHO. Thanks, Luca > >> --- a/kernel/sched/sched.h >> +++ b/kernel/sched/sched.h >> @@ -524,6 +524,10 @@ struct dl_rq { >> * and decreased when a task blocks >> */ >> s64 running_bw; >> + /* This is the amount of utilization that GRUB can not >> + * reclaim (per runqueue) >> + */ >> + s64 unusable_bw; > > > Wrong comment style and whitespace challenged. >