From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0B4318BBD for ; Fri, 23 Jan 2026 01:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769133610; cv=none; b=kF/FHY3Ay1KsfiJuj6XHznCo0SZmlo3u68cW+bu6Dh7cxLI8X5cfJzNXxUgFMTMKgwSN5pAXjWQJfAfl4IiJunJVcNeBwiKpBPyVYd+6aPbGEliFIGC7akcemy+0z8FrEqc5hO1O9hIurJhcbooglWhSjaBYi6VsuOErlpWeP98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769133610; c=relaxed/simple; bh=lbd7dbMKu/VqNcrZV6qemfWOSOaPyZ7iUeBOk/ANZLI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EOAZd7Lh0uRaJvG+xbLn7LxflIRB4AXDtU1nLgbHBmS4+0XtxJQ7O32pCnTJH1ruulxkkXRNw7H3e/roLjoQk5+SD854fp6lkeIZ1LNAv/WoijDl83ooguzUGEjhrUCSamcTUCDJ7ngvqBFvcJTtSFxuRTrBHPhM90MTPfwBOL4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FW7DofMR; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FW7DofMR" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-34c27d14559so1052133a91.2 for ; Thu, 22 Jan 2026 17:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769133586; x=1769738386; 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=97I4VfuSLmE445PwjpWCLNsrxfdr/ac3S+fcnbNjRC8=; b=FW7DofMRFqo8KUXber9mMXmpiqaIphl/QzPr3Y/fWz81N7wbnErbJyJlpJiAKlUNM0 tLbsYyjyprDH76a2+MlPXxFEjTOkL74/eugXf1FdzvATowjEhvA692VoRzqB10Lz5biQ +8xmceEYAmDoMdb/LDVzKHzGKlSb0nXpdTJsHTvJUqe7gjgd4CSa3MINuzj8RIiOlgKg Avv3/oq4CCC2mWOY8ewPqvUPric4h6PazqyKQvSPK4odse+3P9NBbWC5pSejDd5eSy2i DOKx+6czvocOquSJXX7lLzwnu2Jsz+B+jz6tmzI1hKYADJL6kI0AvrF9JrglMIzoFvoD o8Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769133586; x=1769738386; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=97I4VfuSLmE445PwjpWCLNsrxfdr/ac3S+fcnbNjRC8=; b=hI4YFuFM6jz5w7DbBpjxNHs4rM2O4kFaUAMMFkj1T8yeSN8NOkG7vT/eLkPk9N2tTj S3XJe20/2R/k0NPPyFAahgk5wORxvCbFxIOgkSnbMS1eYVQ30gjVXHrM5MMo3hj3YuMR CVGUzmwZWBeqzz7sbOcE/zhu0M8WTL0CQwKpPiBgGedYpLMQ8US8+mKvBB1DZg+0e+BX mLW5c40FHJ5erZs0ARu45JKj8SMfp1+1YaIYhOEW8zm9n8WzdM1KtUSieJRSC7tFWagh 3INhDE2+KoHVjdHGCfrDdMu3xjHpWQxoZNUNqgYTD5mBP+IT8ca595Fz7QetDLIOSlqF rOcA== X-Forwarded-Encrypted: i=1; AJvYcCU3KrOJ1QI1yAT8AXsUb2pdNx9bMwyiQhegZzHIGCg1/yUu7TMpQuwdAh8QxWYKKLiYQc9DM63iFYnJEQE=@vger.kernel.org X-Gm-Message-State: AOJu0YzHko1i2rU/TSX7w0sM12i+ypPMEtpLnjqnzxLB421WnnquI8s4 b4HwluUtY4W3OYUkEgzJ6EeOZtpXunfkiQZiP6aCY4Cpu/rdfYMb2Zec X-Gm-Gg: AZuq6aJYp1N2Ln6ttkrLXDdSwLUafzUgjHqT8Jilvh69T+iHPHs2EjefB20M0tOZTeF 5eZKplGRItpKyWtlwKARnywZgyoTjHvILKxoU3PF6up4HfJ+75MQxVhzb0qcH6698TxtkL/K4sA 8T0fZWeLQhu6z7kBA3Z+UBF6Wnx+gyjVbgHgbqV4ducBnIruhi5efTXmScgY2tJgi85GNvaZ+oQ iYyfMSVwcyH16fJybvwnf0bJ9MjF8Ch2g3tAh0j3JsqVY3yTiR1/MoXYMAlNyLDVUC2MnqNMKxL BGY839s3qV2KdA+8RwEHHwJqPb/Wf9as9YaiT+N+/3YjQTj99ROLIAdD0W4ylEmdPxr6sZtB6wO xw6qRUws9+l7MLLBcbDVgmOmCRDfQQ/XAHdZXhovCqCJuzSsT5+2MU9GbU7fnVINV9EVannmylm J2108TEyBBKWZJL0tg5XNvEycqs6Wr X-Received: by 2002:a17:90b:3505:b0:340:bb64:c5e with SMTP id 98e67ed59e1d1-353673232e2mr1235422a91.14.1769133586086; Thu, 22 Jan 2026 17:59:46 -0800 (PST) Received: from SH-HV00110.Hygon.cn ([112.64.138.194]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3536eaaca08sm267895a91.2.2026.01.22.17.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jan 2026 17:59:45 -0800 (PST) Date: Fri, 23 Jan 2026 09:59:37 +0800 From: Huang Shijie To: Shubhang Kaushik Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Shubhang Kaushik , Valentin Schneider , K Prateek Nayak , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8] sched: update rq->avg_idle when a task is moved to an idle CPU Message-ID: References: <20260121-v8-patch-series-v8-1-b7f1cbee5055@os.amperecomputing.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260121-v8-patch-series-v8-1-b7f1cbee5055@os.amperecomputing.com> On Wed, Jan 21, 2026 at 01:31:53AM -0800, Shubhang Kaushik wrote: > Currently, rq->idle_stamp is only used to calculate avg_idle during > wakeups. This means other paths that move a task to an idle CPU such as > fork/clone, execve, or migrations, do not end the CPU's idle status in > the scheduler's eyes, leading to an inaccurate avg_idle. > > This patch introduces update_rq_avg_idle() to provide a more accurate > measurement of CPU idle duration. By invoking this helper in > put_prev_task_idle(), we ensure avg_idle is updated whenever a CPU > stops being idle, regardless of how the new task arrived. > > Changes in v8: > - Removed the 'if (rq->idle_stamp)' check: Based on reviewer feedback, > tracking any idle duration (not just fair-class specific) provides a > more universal view of core availability. > > Testing on an 80-core Ampere Altra (ARMv8) with 6.19-rc5 baseline: > - Hackbench : +7.2% performance gain at 16 threads. > - Schbench: Reduced p99.9 tail latencies at high concurrency. I am very glad to see this result. :) Thanks Huang Shijie