Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3230887imm; Mon, 13 Aug 2018 08:08:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy4bcc6hw2Ix6uiDcod7l0Kq10Qji2f8CRT5kymToI1uCZDGLe2Tlv0FVxN7vyXHgUbm1Io X-Received: by 2002:a63:1f4d:: with SMTP id q13-v6mr17485222pgm.241.1534172885336; Mon, 13 Aug 2018 08:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534172885; cv=none; d=google.com; s=arc-20160816; b=MD72yKMCQnivL+fA/BMYbgyJtqoqOiJ35r9f4prVE0gLlIHvGxGxzmiINlex5uJyGj 4W/wUFDnK7xWSt/M3NKMCBI7MaNb0N+XUvBudh8wvcyukkiRJumlTSiLnoOfaU2giTCk NKpODHzqriErqfRVfpZoL5ljJBn5z/CIBVhIaDKexfQgYm8CknepJWsvLwgMQKsLzmqQ Qno6hqjtX38woheBkcVjCXkUDs3VpHU5Zgy9zFIJ5VNkQdzN5GWiadn6n5kj4YbeJAVZ bWaaefFzhNYxZ0Y7GBbl6JzB6TB6w0jTPQypBfEyhrs9YGrjpkYOPhfP1yeExizE0f45 DYOA== 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=YB+I/wd3lL9QxDmq5qE5hIStieYfMoGNGRMivf0tnJM=; b=e8CtyaLVhk0G4TrRVart5JwQSH74Y86azsMbWycOg4i9ETacjmVqkRe5iWrAoify0W OWKdgvcKuOaLl4S+rKkJLEkfAPRgAPMlVqyfOJ+wGvy7L5oSP8tSbyQy7zadK1mqN2OV +LIGy4vGvBLYjHBy8coEWgFDtZ8VzJ7L+27cKwi4dwcr8VOfomdEbWjVYlG22uArgQvq g6l/I9GgMzQBp0+QtznpXuBh1st840SsXokuoWSl8iEO2MfPK+B6+NsoQu5dpmr5eVWz MJ7ds8XwNrEbB6zGE09v3rnvZJ0XMsfrKfw2sSp5jjVE1LNXeuzC+m1EsAbDGJ6Ixcnu e7ew== 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 b35-v6si17813039pgl.562.2018.08.13.08.07.48; Mon, 13 Aug 2018 08:08:05 -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 S1730051AbeHMRn4 (ORCPT + 99 others); Mon, 13 Aug 2018 13:43:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729931AbeHMRnz (ORCPT ); Mon, 13 Aug 2018 13:43:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 19F8380D; Mon, 13 Aug 2018 08:01:18 -0700 (PDT) Received: from e110439-lin (e110439-lin.Emea.Arm.com [10.4.12.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F7F43F5D0; Mon, 13 Aug 2018 08:01:15 -0700 (PDT) Date: Mon, 13 Aug 2018 16:01:12 +0100 From: Patrick Bellasi To: Vincent Guittot Cc: Juri Lelli , linux-kernel , linux-pm , Ingo Molnar , Peter Zijlstra , Tejun Heo , "Rafael J. Wysocki" , Viresh Kumar , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Todd Kjos , Joel Fernandes , Steve Muckle , Suren Baghdasaryan Subject: Re: [PATCH v3 06/14] sched/cpufreq: uclamp: add utilization clamping for RT tasks Message-ID: <20180813150112.GE2605@e110439-lin> References: <20180806163946.28380-1-patrick.bellasi@arm.com> <20180806163946.28380-7-patrick.bellasi@arm.com> <20180807132630.GB3062@localhost.localdomain> <20180809153423.nsoepprhut3dv4u2@darkstar> <20180813101221.GA2605@e110439-lin> <20180813124911.GD2605@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13-Aug 16:06, Vincent Guittot wrote: > On Mon, 13 Aug 2018 at 14:49, Patrick Bellasi wrote: > > On 13-Aug 14:07, Vincent Guittot wrote: > > > On Mon, 13 Aug 2018 at 12:12, Patrick Bellasi wrote: [...] > > Yes I agree that the current behavior is not completely clean... still > > the question is: do you reckon the problem I depicted above, i.e. RT > > workloads eclipsing the min_util required by lower priority classes? > > As said above, I don't think that there is a problem that is specific > to cross class scheduling that can't also happen in the same class. > > Regarding your example: > task TA util=40% with uclamp_min 50% > task TB util=10% with uclamp_min 0% > > If TA and TB are cfs, util=50% and it doesn't seem to be a problem > whereas TB will steal some bandwidth to TA and delay it (and i even > don't speak about the impact of the nice priority of TB) > If TA is cfs and TB is rt, Why util=50% is now a problem for TA ? You right, in the current implementation, where we _do not_ distinguish among scheduling classes it's not possible to get a reasonable implementation of a per sched class clamping. > > To a certain extend I see this problem similar to the rt/dl/irq pressure > > in defining cpu_capacity, isn't it? However, I still think that higher priority classes eclipsing the clamping of lower priority classes can still be a problem. In your example above, the main difference between TA and TB being on the same class or different classes is that in the second case TB is granted to always preempt TA. We can end up with a non boosted RT task consuming all the boosted bandwidth required by a CFS task. This does not happen, apart maybe for the corner case of really different nice values, if the tasks are both CFS, since the fair scheduler will grant some progress for both of them. Thus, given the current implementation, I think it makes sense to drop the UCLAMP_SCHED_CLASS policy and stick with a more clean and consistent design. I'll then see if it makes sense to add a dedicated patch on top of the series to add a proper per-class clamp tracking. Cheers Patrick -- #include Patrick Bellasi