From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D00B3246F5 for ; Thu, 4 Dec 2025 13:09:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764853773; cv=none; b=B+goQ+PiE+FZAqVcqI/25/fmOk0DpWMzNp0j1jgXH3d5UVPP36PLl78w5IUTOJDpiihBXMxOFKxWI5QGeVFcT0tgm24t1k4clfei/IuT2wBI+eEnPlWqaJXYsR9qfg+E3A1XNr2ZUxzttS31hlVtjGuFJuVnnJn89nurLpFfl9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764853773; c=relaxed/simple; bh=vqbXiRxWLHjfG2MWt/3Cm34ZDVKdiO2WYKLG79qs3N0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=gbVbTt50yv2wY6VBNPGs27th8TLWu03lAYMfpF8sR0FvfW1OwAPTfGJsVrGymYiKM4XypOHrtz+DPppMgIMDwsC1uZSrHe4FDEmm3GQV2DuuD197MCaLW2roNVkNYHezALyPDM5I8zuHcnWM6iBrYC88EPJDPKZ+w/uY7zJDvEM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 C30E3339; Thu, 4 Dec 2025 05:09:23 -0800 (PST) Received: from [10.57.75.163] (unknown [10.57.75.163]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8611B3F59E; Thu, 4 Dec 2025 05:09:28 -0800 (PST) Message-ID: <885de678-fd46-4a44-ac92-098bdb6b9cfe@arm.com> Date: Thu, 4 Dec 2025 14:09:26 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/2] sched: update the rq->avg_idle when a task is moved to an idle CPU To: Huang Shijie , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org Cc: patches@amperecomputing.com, cl@linux.com, Shubhang@os.amperecomputing.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, vschneid@redhat.com, vineethr@linux.ibm.com, kprateek.nayak@amd.com References: <20251203053056.4128-1-shijie@os.amperecomputing.com> From: Dietmar Eggemann Content-Language: en-GB In-Reply-To: <20251203053056.4128-1-shijie@os.amperecomputing.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 03.12.25 06:30, Huang Shijie wrote: > In the newidle balance, the rq->idle_stamp may set to a non-zero value > if it cannot pull any task. > > In the wakeup, it will detect the rq->idle_stamp, and updates > the rq->avg_idle, then ends the CPU idle status by setting rq->idle_stamp > to zero. > > Besides the wakeup, current code does not end the CPU idle status > when a task is moved to the idle CPU, such as fork/clone, execve, > or other cases. Is there a case which is the most important one? (e.g. idle load balancing)? I still can't see the reason why this code should be changed (was asked in v4 already). Do you have a workload on your machine which gives you better scores in case you set 'rq->idle_stamp = 0' in all those cases? What is is actual issue in the current code? Does 'this_rq->avg_idle' get too big so you spend too much useless time (since pulled_task == 0) in sched_balance_newidle() because the bailout condition: sched_balance_newidle() ... if (!get_rd_overloaded(this_rq->rd) || this_rq->avg_idle < sd->max_newidle_lb_cost) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... goto out; doesn't trigger anymore? [...]