Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp435034ybl; Fri, 24 Jan 2020 03:10:24 -0800 (PST) X-Google-Smtp-Source: APXvYqzvJHwhZtO2mRKqEmiJl/Z4Q4S5MAv6SGkeQ3tSmHiuK7HH4bqCmm9N+0OXEZbvmBh/545F X-Received: by 2002:a9d:68cc:: with SMTP id i12mr2169023oto.207.1579864224269; Fri, 24 Jan 2020 03:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579864224; cv=none; d=google.com; s=arc-20160816; b=l/QPBFhv6pw1Uk7DB5SUp1luJF5qAySYshQA8xQZiqJiP3bAizjLpd4tYAYd+GGmcq mRLx7KwmryP5SV7ztXUxlaolrs9qykvcvL2WsOgZfZsLkt15opKtZaP3jtMHcUDjtHwD ScCD/B3G3VrodwOA0JwXffoS6I2zbVZEJSjcC8QEyaC1arbSANcLRFxGH5K6do+DWEcA v4Y0ZUZcIUP/9cnYrB1GNkVCLL++fjWjHAn/+dPtR9p3kpth3nIR/O8m29Lhf/kMmykp FmvuZgHnxC3UkPMT6Z+qY9vXhXo01RvaqRjOuICcOMQA7kSzkw7UKxoNJLxcTp7hVToZ vgCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+8UOKrzl3oDiYFIJBz1jiTDAEdNlyQd9VFOWTm4Ur2E=; b=f+gD/yfkarcP7U4E5zAvOIejb6IGbJQZqLUNDKsuVZD0Kaa7H4mCqZIZDaWf5Pz0ll WjoUgpWej7UISjvWl/evE/Cz05qgSkUZ4PqvieDoKIuQJptTg/mO/CRjibOUr9R0eSEf UthO1rzag5B3Wo6UcxQjfTDI09ldIZhQ0YArhOPHQKepcnWiBECov9fNibdkZ/CjelfH 7uQdlAlt4/ZLl+EaJ4GR5FbNMomgrmu2G42UWFTNxI+A+VTRZQnpU1HJTVFVOeLcxVgE 7TZ0i46zgHD+99hTLHPiYgYMerl5exkgKdREL5/PI7VvKJAIZo1V36TjVa9FkbhJlxaw +otg== 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 n8si2746518otr.102.2020.01.24.03.10.11; Fri, 24 Jan 2020 03:10:24 -0800 (PST) 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 S2387801AbgAXLBu (ORCPT + 99 others); Fri, 24 Jan 2020 06:01:50 -0500 Received: from foss.arm.com ([217.140.110.172]:49168 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387786AbgAXLBs (ORCPT ); Fri, 24 Jan 2020 06:01:48 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 303D3328; Fri, 24 Jan 2020 03:01:48 -0800 (PST) Received: from [10.1.194.46] (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5D9983F68E; Fri, 24 Jan 2020 03:01:46 -0800 (PST) Subject: Re: [PATCH] [RFC] sched: restrict iowait boost for boosted task only To: Quentin Perret , Qais Yousef Cc: Wei Wang , wei.vince.wang@gmail.com, dietmar.eggemann@arm.com, chris.redpath@arm.com, Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org References: <20200124002811.228334-1-wvw@google.com> <20200124025238.jsf36n6w4rrn2ehc@e107158-lin> <20200124095125.GA121494@google.com> From: Valentin Schneider Message-ID: <849cc9f0-f4ae-f2b6-8449-f55697928cf5@arm.com> Date: Fri, 24 Jan 2020 11:01:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200124095125.GA121494@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/01/2020 09:51, Quentin Perret wrote: >>> +static inline bool iowait_boosted(struct task_struct *p) >>> +{ >>> + return p->in_iowait && uclamp_eff_value(p, UCLAMP_MIN) > 0; >> >> I think this is overloading the usage of util clamp. You're basically using >> cpu.uclamp.min to temporarily switch iowait boost on/off. >> >> Isn't it better to add a new cgroup attribute to toggle this feature? >> >> The problem does seem generic enough and could benefit other battery-powered >> devices outside of the Android world. I don't think the dependency on uclamp && >> energy model are necessary to solve this. > > I think using uclamp is not a bad idea here, but perhaps we could do > things differently. As of today the iowait boost escapes the clamping > mechanism, so one option would be to change that. That would let us set > a low max clamp in the 'background' cgroup, which in turns would limit > the frequency request for those tasks even if they're IO-intensive. > So I'm pretty sure we *do* want tasks with the default clamps to get iowait boost'd. What we don't want are background tasks driving up the frequency, and that should be via uclamp.max (as Quentin is suggesting) rather than uclamp.min (as is suggested in the patch). Now, whether that is overloading the usage of uclamp... I'm not sure. One of the argument for uclamp was actually frequency selection, so if we just make iowait boost respect that, IOW not boost further than uclamp.max (which is a bit better than a simple on/off switch), that wouldn't be too crazy I think. > That'll have to be done at the RQ level, but figuring out what's the > current max clamp on the rq should be doable from sugov I think. > > Wei: would that work for your use case ? > > Also, the iowait boost really should be per-task and not per-cpu, so it > can be taken into account during wake-up balance on big.LITTLE. That > might also help on SMP if a task doing a lot of IO migrates, as the > boost would migrate with it. But that's perhaps for later ... > > Thanks, > Quentin >