Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1482779pxv; Fri, 2 Jul 2021 05:04:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyABnMo+Njqetb3b92rPI+oHv38YVMeGfYNZT0DPeAyAvKUz6W2HND2TYu5608VzAcViT3D X-Received: by 2002:a17:906:3386:: with SMTP id v6mr4827861eja.434.1625227494283; Fri, 02 Jul 2021 05:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625227494; cv=none; d=google.com; s=arc-20160816; b=WTAevsKA69+In8Wwjt1cdqMQ/TXPocST3yKtFqm8Tt9dYNQ8gN75OQGLcz1gzb7/ZN kzRyWFdHPTjKfxm43XIzr436m/rdy9eV6EBx9iVDLVctjfYBcEJ4I9S1nVmnPSEYpyy6 4MvtLm8YWR71Sn/Do8LckwTaAFICya1wpUcvhSgYn5XMc9/qBGnNowTZf44WwTE372L3 affC2E+H8QUHb9MubtyO5uWVV5K3blzRfDoemM9R53xSqc7YMwbSP9uGY/DMbaiVhGFi Lk1dVwIU2qeiAiqLjR8JC2FUpocDDfmQyScbfPZ6YqTyR1dwvEAW06434POJoeFarlCz 8xOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D59vjIFHsm1bwSteYMmO3Ib3ErHnsCny5NoZ3raY1vo=; b=LjmMH87cdzMLe0T3Cl7idP/FBKSgOSmkzw2bFdlZsccpJRGYAJ59mpjlZWg0aabHdH +1nFeiwtlsAQ3FCNQeQwfcyuroOGFsKHNUdI7hXJLoU6xd6Punlyr674Y8F1vksMCbbN k17AY+WIkwtCiMZ2sEUbyJ3vjDMn0FNVlRbq77gOkGVWKeprviiRXfHQlN8kVaBDv/Bj bmpmz9pSYQku7/CxBbVofPAHF2l1fEupseTAljD5uCULBoGfliuT6MFYr8/WkW4XVjmO dmi0Ju41wVp83lMlldSrVH1FCRDmss7IigaQGaSabSmLrhOxJzOyA6RMj2WGs3sd2wma jMqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l9ffb1Ys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si2889315edd.502.2021.07.02.05.04.14; Fri, 02 Jul 2021 05:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=l9ffb1Ys; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232085AbhGBMDX (ORCPT + 99 others); Fri, 2 Jul 2021 08:03:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232067AbhGBMDQ (ORCPT ); Fri, 2 Jul 2021 08:03:16 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 817CFC061764 for ; Fri, 2 Jul 2021 05:00:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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; bh=D59vjIFHsm1bwSteYMmO3Ib3ErHnsCny5NoZ3raY1vo=; b=l9ffb1YsS4W/xQ4gKtVC/5wkLQ DHi7qgqIscJ1Ae4y9g/YeweFURc7Tv/tSo9aNi+oJEZVHwtBP2iKKkQTqEIEp8EbpP666EikPmFuq tRi9J0OHjN1Vg4V9UU1jRAPYH6SgwsyFFZ3a8Cmv1hgqPUKqPQBgs1wmqT04Vo5+oZo9Aqcu/Fe2N LnyTNaq8w32s6wmNybdErCXJCqtrRb8uAC02w8TlkEFO2DaQg78+ZlOSCqerXUHM4u86RnVxPhSMb 1QUllXIZiln4Ushqu1tzTsyfGSt66/diyHCLbgxTWjiJc5OvSkJW9q+mrsv6ORomFWlbR5sG+0TKo 3whEk7Ew==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzHqQ-00Dqnn-7z; Fri, 02 Jul 2021 12:00:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A2070300091; Fri, 2 Jul 2021 14:00:29 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 728D92CEACB1C; Fri, 2 Jul 2021 14:00:29 +0200 (CEST) Date: Fri, 2 Jul 2021 14:00:29 +0200 From: Peter Zijlstra To: Qais Yousef Cc: Xuewen Yan , valentin.schneider@arm.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, patrick.bellasi@matbug.net, qperret@google.com Subject: Re: [PATCH v2] sched/uclamp: Avoid getting unreasonable ucalmp value when rq is idle Message-ID: References: <20210630141204.8197-1-xuewen.yan94@gmail.com> <20210702115421.gcju2vluhof6rp6f@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210702115421.gcju2vluhof6rp6f@e107158-lin.cambridge.arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 02, 2021 at 12:54:21PM +0100, Qais Yousef wrote: > Yep. How about the below? > > --->8--- > > sched/uclamp: Ignore max aggregation if rq is idle > > When a task wakes up on an idle rq, uclamp_rq_util_with() would max > aggregate with rq value. But since there is no task enqueued yet, the > values are stale based on the last task that was running. When the new > task actually wakes up and enqueued, then the rq uclamp values should > reflect that of the newly woken up task effective uclamp values. > > This is a problem particularly for uclamp_max because it default to > 1024. If a task p with uclamp_max = 512 wakes up, then max aggregation > would ignore the capping that should apply when this task is enqueued, > which is wrong. > > Fix that by ignoring max aggregation if the rq is idle since in that > case the effective uclamp value of the rq will be the ones of the task > that will wake up. > > --->8--- Much better, I've updated it. Thanks!