Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp979553rdh; Fri, 24 Nov 2023 02:35:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQsi8OgHFOJ/sI9xNKpnATwM6R5fif+HIBq4kk2jp5o9pqwrzGsxEk36c/Unul3DLxZlql X-Received: by 2002:a05:6a20:3ca5:b0:18b:3158:4231 with SMTP id b37-20020a056a203ca500b0018b31584231mr3249882pzj.16.1700822117641; Fri, 24 Nov 2023 02:35:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700822117; cv=none; d=google.com; s=arc-20160816; b=A8KArGMWoOw/bNwjS6QGjjTkFpHb43hx2+CzyOYANUyUk9hlUjlmgZjXbdqZOOZS3u qW4bKRQOmUIYBfNpCZq/2Af6YoTB0wy46J+2yAMjTmwFjcMi/9aA+yoyy6oyP0CcPx4Y vblynQxAaVZAdanPU+cBYIsJDQy/ByIelsGJdT8WWG5csjnKDDFcYO4F2JKRmbz/KsXr Akf0Ssd0SI4MoQc1dtkJ8a+Kl39qXvce275LUGJVo1ECFYtRGbdlXC0LZZNK/92XjASI TL/ws6KXwP/q7w/uHEeAmaPOB8wVQRJj5zzO0csAyqYaQl7+TbHhec/Iz71dYgsn8rw0 /dtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=TdN92MD7ESbbX2Gg4QKsgWJFlAETR1Ig3728uCTYKww=; fh=Mc5mjxcXnsQzcoyoBKBcJCzXHeO64K7JX0Fnd+jWUvU=; b=Lhbrvk4VrvrH4AgBJjMZYpFJybLPZZlVY8Qadev38r+1/unTHz53VnB7dnXvql0j3f 17Wqb/omh+gUzrbLQpZPMtcH/Gj4ZcR25SypLksTiFLHObsD+/c3KnVdbZZSmWz5u+e2 3RBsQRK6R/e+0hQbGZ5T2p0SwaDknAhG9JMR34xVqSXN/hTquHpgJm5AA5+SRicaaNtj etqTHP84xGZvh3F7mv/Cl/CBrxOUrHJC63gGOYaH9PxIbrMON97ZuyO1YjC6OmQ45HL5 WYKfujzU9bqzurHr6Y+f5b9bAXfmePIkcL1zUW6dJfB64wNMB1wyDtKZ5k+LkW0imBs6 LdEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f11-20020a056a001acb00b006cb6e6a740fsi3295350pfv.74.2023.11.24.02.35.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 02:35:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4356980AF824; Fri, 24 Nov 2023 02:35:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345392AbjKXKfA (ORCPT + 99 others); Fri, 24 Nov 2023 05:35:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbjKXKe4 (ORCPT ); Fri, 24 Nov 2023 05:34:56 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E79B818E; Fri, 24 Nov 2023 02:35:02 -0800 (PST) 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 154E31FB; Fri, 24 Nov 2023 02:35:49 -0800 (PST) Received: from [10.57.4.20] (unknown [10.57.4.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97BAF3F7A6; Fri, 24 Nov 2023 02:35:00 -0800 (PST) Message-ID: <39cde23a-19d8-4e64-a1d2-f26bce264883@arm.com> Date: Fri, 24 Nov 2023 10:34:59 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] sched/pelt: avoid underestimate of task utilization To: Vincent Guittot Cc: lukasz.luba@arm.com, juri.lelli@redhat.com, mingo@redhat.com, dietmar.eggemann@arm.com, peterz@infradead.org, bsegall@google.com, rostedt@goodmis.org, bristot@redhat.com, mgorman@suse.de, vschneid@redhat.com, rafael@kernel.org, qyousef@layalina.io, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <20231122140119.472110-1-vincent.guittot@linaro.org> <0bc60a26-af18-4108-8b8d-238a1df1775b@arm.com> Content-Language: en-US From: Hongyan Xia In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 24 Nov 2023 02:35:15 -0800 (PST) On 22/11/2023 17:37, Vincent Guittot wrote: > The same but with plain text instead of html ... > > On Wed, 22 Nov 2023 at 17:40, Hongyan Xia wrote: >> >> Hi Vincent, >> >> On 22/11/2023 14: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. >> >> Thanks for bringing this case up. I'm a bit nervous skipping util_est >> updates this way. While it is true that this avoids dropping util_est >> when the task is still busy doing stuff, it also avoids dropping >> util_est when the task really is becoming less busy. If a task has a >> legitimate reason to drop its utilization, it looks weird to me that its >> util_est dropping can be stopped by a new task joining this rq which >> pushes up runnable_avg. > > We prefer an util_est that overestimate rather than under estimate > because in 1st case you will not provide enough performance to the > task which will remain under provisioned whereas in the other case you > will create some idle time which will enable to reduce contention and > as a result reduce the util_est so the overestimate will be transient > whereas the underestimate will be remain My concern is mostly about energy efficiency, although I have no concrete evidence on energy impact so I'm not firmly against this patch. > >> Also, something about rt-app. Is there an easy way to ask an rt-app >> thread to achieve a certain amount of throughput (like loops per >> second)? I think 'runs 1ms and sleeps 100us' may not entirely simulate a >> task that really wants to preserve a util_est of 888. If its utilization > > > We can do this in rt-app with timer... Thanks. Looking at the rt-app doc, I think a timer with absolute time stamps does what I want.