Received: by 10.213.65.68 with SMTP id h4csp4310029imn; Tue, 10 Apr 2018 12:44:38 -0700 (PDT) X-Google-Smtp-Source: AIpwx49caB/5mDVBEoADVKxWmz0RKHK6FytQmNfnar++HvS0fkJjwMLdUBV6YGW2hA1MUG3yTnYa X-Received: by 10.98.93.141 with SMTP id n13mr1476039pfj.10.1523389478665; Tue, 10 Apr 2018 12:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523389478; cv=none; d=google.com; s=arc-20160816; b=CwJNQ+OLU+b87bZsGJBaX3KaCD1QA9hH+Y0pMp2xCDQgCg49FNwvQIom95nJyKs+pD LlsSpW0zuiGJ1IVx13DmgNfXjRiU17cGpuPhVln5/gwp2QyqwQIpEk7x+2ntOjofCWGo yrGy+if9LIv2lIqDV8ST2tTSnbKEDqCfJzebUayjdmTzLLeYaI+EP8IW+Mf1SLKWVjLu 8+7rLcDmFWTCcY2jcWzGrHWmq20R5jZPwC1HYGufA/jedrTmIBuUUDb/y+LTckE3Wkz3 nJsWyAqgaCQTqZ3JGZHEBno8SzkertBLbe3gki9q0VfHCS1OU31J1rkPoo054MR27dkh zHig== 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:dkim-signature:arc-authentication-results; bh=LZRRO156di61cPU+bV9IUE7NDJBIN/3QytKKZQkfhsM=; b=ccZGlDr9Tu/YsYOZJK5gPHAxD+NpIW3YUErTAI9WYZGim6U2cO0zHgXn1vYpMjw+Be DdHL3YRaqzwgUA1YEgU9bWJb7LGSOVL/+mBzZOfCCGQa0krO4pVIh4Pgo9WBmAdaC/6G DJQDaFW086rPmbdSQ0WxP6Ho6p6uy9dpyobAtmCCUzYIxrGDJvL93kCmh+N8+IJWw24o w782EgHZDe2CwWApGK6Hb1GmQPOXdfK/rK3qzIu1spASsqKn5M9XWi2ErEZcEzgJNdJ/ fsNTiEbo7GRhKz9MvKuH3W5qfetZ5wxCvNxxQrQbNhTrSLWle81h56O0xAa8Ul0/sZQS Y+eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=uvOPnKoP; 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 a190si2258594pge.436.2018.04.10.12.44.01; Tue, 10 Apr 2018 12:44:38 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=uvOPnKoP; 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 S1753213AbeDJTh2 (ORCPT + 99 others); Tue, 10 Apr 2018 15:37:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:38426 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668AbeDJTh1 (ORCPT ); Tue, 10 Apr 2018 15:37:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LZRRO156di61cPU+bV9IUE7NDJBIN/3QytKKZQkfhsM=; b=uvOPnKoPg31el55mwmLkamEjx to/NDCl/oaC3g8HnVtYDFCmQ8tH7e7hqkksP0/p1v/KVT40O5lqlmSWzDstG8WcpvVA+EMYJKCr3k 8YEOp6MZfvNmv6A8NQ8MYaOAYu7zJ2M490LaKIF3KF5vjUTsj6Xg0G4OtFZhxSUG3C1LfHGUJluEl r6HI86KVCn7xJtAhmOe0FNb3DLT7zsllBwIzZBhTkCW1f8iJp/dmDBk8BgyyAJg3KNtJIpmdkd4TV C42dgNISYGZidVFYtlJpj6RoBkSaeKH0+ybTR8W+318FFt13TUHfvjUhRSr6blIicgIWJmz2dFSGW Py1c+owBg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f5z4o-0007vH-AA; Tue, 10 Apr 2018 19:37:11 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A2BD520298CF9; Tue, 10 Apr 2018 21:37:08 +0200 (CEST) Date: Tue, 10 Apr 2018 21:37:08 +0200 From: Peter Zijlstra To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , "Rafael J . Wysocki" , Viresh Kumar , Joel Fernandes , Steve Muckle , Juri Lelli , Dietmar Eggemann Subject: Re: [PATCH v2] cpufreq/schedutil: Cleanup, document and fix iowait boost Message-ID: <20180410193708.GE4043@hirez.programming.kicks-ass.net> References: <20180410155931.31973-1-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180410155931.31973-1-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 04:59:31PM +0100, Patrick Bellasi wrote: > The iowait boosting code has been recently updated to add a progressive > boosting behavior which allows to be less aggressive in boosting tasks > doing only sporadic IO operations, thus being more energy efficient for > example on mobile platforms. > > The current code is now however a bit convoluted. Some functionalities > (e.g. iowait boost reset) are replicated in different paths and their > documentation is slightly misaligned. While your patch does seem to improve things, it still has duplicated bits in. Eg. the TICK_NSEC clearing exists in both functions. > - sugov_set_iowait_boost: is now in charge only to set/increase the IO > wait boost, every time a task wakes up from an IO wait. > > - sugov_iowait_boost: is now in charge to reset/reduce the IO wait > boost, every time a sugov update is triggered, as well as > to (eventually) enforce the currently required IO boost value. I'm not sold on those function names; feels like we can do better, although I'm struggling to come up with anything sensible just now. > > if (delta_ns > TICK_NSEC) { > + sg_cpu->iowait_boost = iowait > + ? sg_cpu->sg_policy->policy->min : 0; > + sg_cpu->iowait_boost_pending = iowait; > + return; > } > + if (delta_ns > TICK_NSEC) { > + sg_cpu->iowait_boost = 0; > + sg_cpu->iowait_boost_pending = false; > + return; > + } Looks like something we can maybe put in a helper or something.