Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp367832rdh; Thu, 23 Nov 2023 06:12:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyT6ocwzpNSUa6BdsnioJrm+fBTm4PVcgjZ4xOYpM4wEQvFIae1B8pvlHLoxhLvpYxRZet X-Received: by 2002:a17:902:d2cb:b0:1cc:4488:afba with SMTP id n11-20020a170902d2cb00b001cc4488afbamr3973823plc.6.1700748730377; Thu, 23 Nov 2023 06:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700748730; cv=none; d=google.com; s=arc-20160816; b=yiRh9RkCerKDrh6f3q347VWVZliVVtEZXyeZVgx64uZh+lbAmFxePeBvM7bycB6xWm jkA6e6e57jkv4uIprxWs+T5EswOcXFffbwtT2jobTcCPOVNHDnU5NGn5amRQ6YcAkmXY xX3aVFVQB1lMjAPATfiPOSAiMBvYmq+Wgg585jWecNomuZvHWpMebIOcgJhxvTo1NHga simb0nArS6QtWgm8X2/UnlvW48Mpb26dKG74aO9Gi0vsEOGa6VfEgM01Z8DghptaX7uy jdTu95pE1rH6hunrN0+PWwPtSZVs28nqn7IGjimGLXZvUSH0tG1oS1lK8kfujl2qTpXS A66A== 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=43S2JKE+XlknJ7InMXn72r82rK7OdZlK6EXXoJcK908=; fh=b7gr25bm+umROFjaEF3KFcCwqu9uwiFp1AJU+lx6A4E=; b=vo7M3S5nkcyxtyvfntWMfkziZ4JqyeSVmPRyvtFi8baRatJKbD7d7G3Wh9i2OAD+Bc 9qt3qC6NTEd4xcV9ZYVQVr/XZT9iDNzDA7C5Vd39IEX8tu+5UWiv27ZhjR5XKnGfdPa5 P7rFocCx3CgpGYH7/7cAJ4nCj5s5YBp4nGeBravr436Zz2JRQI+/lMRF1tZ/oqgO16KK POhsCQMfa4FD3rDQ07NzCKb7dnrz2i8u55TSWc03zCGeKTTkZTIJopbcG40WBq7z3xAf ARBxu8jNAe8IvpAWWxnYQC14D1bwgV6u/C4wS+kPHrUNd3oGHpeOEJDjfbcTz3EnT5fJ 3oJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=QaxrnGOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b6-20020a170902ed0600b001cf665a0922si1159314pld.468.2023.11.23.06.12.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 06:12:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=QaxrnGOP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 75FC4805DC6E; Thu, 23 Nov 2023 06:10:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345711AbjKWOKV (ORCPT + 99 others); Thu, 23 Nov 2023 09:10:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345703AbjKWOKT (ORCPT ); Thu, 23 Nov 2023 09:10:19 -0500 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E271B2 for ; Thu, 23 Nov 2023 06:10:26 -0800 (PST) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c887d1fb8fso11772991fa.0 for ; Thu, 23 Nov 2023 06:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1700748624; x=1701353424; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=43S2JKE+XlknJ7InMXn72r82rK7OdZlK6EXXoJcK908=; b=QaxrnGOPE1u1Bcz5geVkJpyyAk9FFayQKerfYtl5JPw9v8EEvs+WeooNyX/oB5lsdZ AxnrFHYtmPZqktmY8HByDMDGdANuNNnp0Rpai0FXCv35o6eIE7vH91Os2KoWd3HODdTe M/67FEYXkV+DojfdGF4gLZgd03M1t917bKN3FLFm+FIIMyoi9eUjKwQ0B/Tq9zGq1OJE tzEkCDwZEU8ARGMzKCALqMu3s9oGlsHw5cBnidqtZkQnK/ZJEYP24TwDcdQjIBkGv5GL aF470SyaNBwhWibJVE6cjdjXyfX1hhk0oKYEmv1/+YRL2a1LWuSzaXGJpuem32xJ4QWq YHsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700748624; x=1701353424; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=43S2JKE+XlknJ7InMXn72r82rK7OdZlK6EXXoJcK908=; b=N4Jc24JcvttRMLA11EbqqACuvyJlCkeURUxpuDnoXYcEoDkLzqJDpy/gnyHLYtQCP+ uyj3jQ1EuNxSjvFjkJxTOxP1t5raD6Dc95RpI/gESpQcsdL7XwKb4orLSrOm13dt6p4T aQLFcWGImXQ0u4UcpFTZ1BW4X03rYIQ/YoPJNJHe4WV4Uo4vlIElvT6T9UpqxbGzEwre +NklgV0owZv6jGGaWtYm+UAjo63M7a92x4PVioUigNVZxUjPigKi619c8K9IVFkLzezg mUxbKrlsh5PuoKk+r4fYXDiUnzr5pRIXDhijGYJfQzAbvGzkhWCf2a4cgOOp0/fn+Cjg m03w== X-Gm-Message-State: AOJu0Yzjz3zD9JLP1kGSmTunT97LmDSu/Tb+kb43jG4L8gQCjT2vsuVN yQmQxZtyHJs+WX8pKql3sF4a4g== X-Received: by 2002:a2e:9842:0:b0:2c8:8025:1c8e with SMTP id e2-20020a2e9842000000b002c880251c8emr3716596ljj.17.1700748624167; Thu, 23 Nov 2023 06:10:24 -0800 (PST) Received: from airbuntu (host109-151-228-202.range109-151.btcentralplus.com. [109.151.228.202]) by smtp.gmail.com with ESMTPSA id t17-20020a05600c451100b0040b379e8526sm1386686wmo.25.2023.11.23.06.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 06:10:23 -0800 (PST) Date: Tue, 21 Nov 2023 23:01:50 +0000 From: Qais Yousef To: Vincent Guittot Cc: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, rafael@kernel.org, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, lukasz.luba@arm.com Subject: Re: [PATCH] sched/pelt: avoid underestimate of task utilization Message-ID: <20231121230150.eq2kc72bvyn6ltur@airbuntu> References: <20231122140119.472110-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231122140119.472110-1-vincent.guittot@linaro.org> X-Spam-Status: No, score=-0.3 required=5.0 tests=DATE_IN_PAST_24_48, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 06:10:44 -0800 (PST) On 11/22/23 15:01, Vincent Guittot wrote: > It has been reported that thread's util_est can significantly decrease as > a result of sharing the CPU with other threads. The use case can be easily > reproduced with a periodic task TA that runs 1ms and sleeps 100us. > When the task is alone on the CPU, its max utilization and its util_est is > around 888. If another similar task starts to run on the same CPU, TA will > have to share the CPU runtime and its maximum utilization will decrease > around half the CPU capacity (512) then TA's util_est will follow this new > maximum trend which is only the result of sharing the CPU with others > tasks. Such situation can be detected with runnable_avg wich is close or > equal to util_avg when TA is alone but increases above util_avg when TA > shares the CPU with other threads and wait on the runqueue. > > Signed-off-by: Vincent Guittot > --- So effectively if have two always running tasks on the same CPU their util_est will converge to 1024 instead of 512 now, right? I guess this is more accurate, yes. And I think this will hit the same limitation we can hit with uclamp_max. If for example there are two tasks that are 650 if they run alone, they would appear as 1024 now (instead of 512) if they share the CPU because combined running there will be no idle time on the CPU and appear like always running tasks, I think. If I got it right, I think this should not be a problem in practice because the only reason these two tasks will be stuck on the same CPU is because the load balancer can't do anything about it to spread them; which indicates the system must be busy anyway. Once there's more idle time elsewhere, they should be spread and converge to 650 again. Not my forte, but LGTM anyway. Cheers -- Qais Yousef