Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp453809ybl; Fri, 24 Jan 2020 03:32:28 -0800 (PST) X-Google-Smtp-Source: APXvYqyK6XNEPW0pn6ufuE7yi4VjSMO0tIt/VPuQjwp4qx3taT0xcELl2WGrzA4RqPhA6JgcN2Lu X-Received: by 2002:a9d:5c8a:: with SMTP id a10mr2197628oti.95.1579865547887; Fri, 24 Jan 2020 03:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579865547; cv=none; d=google.com; s=arc-20160816; b=Ric2/Ax8YoB6s/2qABwXRNI9sB51LMFJFfVHfEDXP1GAnoeFYFqY2glNh3uNOxZod0 ZoyhqiHvXHkvjmrLZT6edXj+aI7cQ9PaYzBTARNUHmSM/HLL258Xb4hXZmJjJYp3BZDZ 4RmFRSKE+axyEEl+atc+PsGWrKgqP//CMpO0Q8VFebCLardRDVYHynBRaRIcFMpdxGDt 72OC8Z2wpeHpt6SmzzGDu4Fwf+twxjXfpHq9RZJwiBmpcyiXxQd9MV8s+vfacCfz/UHM swtx+64kZ1jimtX0jOnoAUcJvLTmTGhU5+1En8x2tPS7zT4OBgTOH6OFmP/IznOcRjD4 2Tfg== 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; bh=v7s4NKYF1ICzCOFiiS4CaWBUMuzvlVbaqf2WFMTkRlQ=; b=tVXTct292lQClYhl8sYnW4vfTS6QEdgW/sSU4UU59aCC0D31DYcdFTKleLlsxrr9nc UiFRo9taepsiufKWtl4dIsO5J9Djo4a3cWKGo1kSr96VgFbW5J37A3Lrw47/Ljw+Zupy 1DzevM0rUfxEviC9/0NSIxw2clQodPt5hxHWsnegJHBFFM43QfvNDNz2bsuM2Go/80Hx 5aoRWslmNgvFe0JoA9fZLQHV/+bBYqc6ttV60hG1cw2V4aGE//rX9rZ9VdgUkWNi0tOx +LtSUMtomk8lQ3rbs908as+9i0PzvW4U4rBKG8cdyj1EmKlESzwoBZCS6e3ZgT3UTVdy CO+Q== 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 t15si2243137oij.189.2020.01.24.03.32.16; Fri, 24 Jan 2020 03:32:27 -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 S2404326AbgAXLa5 (ORCPT + 99 others); Fri, 24 Jan 2020 06:30:57 -0500 Received: from foss.arm.com ([217.140.110.172]:50188 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404317AbgAXLa4 (ORCPT ); Fri, 24 Jan 2020 06:30:56 -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 B1A99328; Fri, 24 Jan 2020 03:30:55 -0800 (PST) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EAB613F68E; Fri, 24 Jan 2020 03:30:53 -0800 (PST) Date: Fri, 24 Jan 2020 11:30:51 +0000 From: Qais Yousef To: Valentin Schneider Cc: Quentin Perret , 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 Subject: Re: [PATCH] [RFC] sched: restrict iowait boost for boosted task only Message-ID: <20200124113050.i6ovkibcmutypm3q@e107158-lin> References: <20200124002811.228334-1-wvw@google.com> <20200124025238.jsf36n6w4rrn2ehc@e107158-lin> <20200124095125.GA121494@google.com> <849cc9f0-f4ae-f2b6-8449-f55697928cf5@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <849cc9f0-f4ae-f2b6-8449-f55697928cf5@arm.com> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/24/20 11:01, Valentin Schneider wrote: > 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. Capping iowait boost value in schedutil based on uclamp makes sense indeed. What didn't make sense to me is the use of uclamp as a switch to toggle iowait boost on/off. Cheers -- Qais Yousef