From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sg-1-102.ptr.blmpb.com (sg-1-102.ptr.blmpb.com [118.26.132.102]) (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 2078833ADB9 for ; Wed, 17 Dec 2025 09:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=118.26.132.102 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765964510; cv=none; b=s6BYjj4cwuDc7OlV3FTaXo62QOFcKrcmCLKgFhw2JrLRHjkkxpfn/QraJ1E2HlljIzRjQu6EPwbq1eCwTGd9oF8nm9X1ODMof7mKNejddax9kMy/PdIMgUj5gq04Aw32YfcYWEuoDJbC0QJLSP0dOyTfsNb68qTaFeqxcKmKmEQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765964510; c=relaxed/simple; bh=vNalnMarzeFqZN/Q4uLv7OlFdihGRPVU3Ix8W/TtVtg=; h=To:Subject:Message-Id:Content-Type:Cc:From:Date:In-Reply-To: Mime-Version:Content-Disposition:References; b=CQgcDp6gHO04R8Z0L9qWGYFpp2ULI0byRuP5PyyC7hkNAAWUqZmM/c3oZQc1Kso1SpfnzWdl0zC1TPBqMS/oNzRPPiezfnIATilwJ9CNVq6B+QtDM7aPhn3Y/fMXFJKCPQIPimXJtb5phLRlQvz9EhcDo8jlzriaULHuv1dQNCE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=ikIRfP+v; arc=none smtp.client-ip=118.26.132.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="ikIRfP+v" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1765964491; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=sLcg9aGwZtJWd/9xQCHYRIdZuPdUL3yEckbmR/G0+5w=; b=ikIRfP+vuY470szvooYxcPtUCHSGTy+7XEZ7shgXIvphQDk6DPpYEkBTCZY6P3dMMEwGwc B5hK57T8oK7t7cfFRX+xHdoK2QYDiBksEbnYj0eHBh0F0NhAwVMdyFcC6C0ZvrEX+TlURf Gh7XXXm5T6XfX8TVinW9VP7Db1aumLKd7pdK1n62BEYNWKiCr9zHNDpy4I1WMVy16mLtcW 0V0QjhXIkiBXtmC6EePZFJsBwyh0JIzD6/MD1pEjjLza09uJClW7YUbXXMu1hk18IXuJuI 0w5JUTk2vbP4ghKx3ORwbCH0eM/LlSJDFobhoqGgVoGyyqqcnVjYysLQV0HCLQ== To: "Chen Yu" , "Tim Chen" Subject: Re: [PATCH v2 17/23] sched/cache: Record the number of active threads per process for cache-aware scheduling Message-Id: <20251217094053.GA2073381@bytedance.com> Content-Type: text/plain; charset=UTF-8 X-Original-From: Aaron Lu Cc: "Peter Zijlstra" , "Ingo Molnar" , "K Prateek Nayak" , "Gautham R . Shenoy" , "Vincent Guittot" , "Juri Lelli" , "Dietmar Eggemann" , "Steven Rostedt" , "Ben Segall" , "Mel Gorman" , "Valentin Schneider" , "Madadi Vineeth Reddy" , "Hillf Danton" , "Shrikanth Hegde" , "Jianyong Wu" , "Yangyu Chen" , "Tingyin Duan" , "Vern Hao" , "Vern Hao" , "Len Brown" , "Aubrey Li" , "Zhao Liu" , "Chen Yu" , "Adam Li" , "Tim Chen" , From: "Aaron Lu" Date: Wed, 17 Dec 2025 17:40:53 +0800 In-Reply-To: Content-Transfer-Encoding: 7bit Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Disposition: inline X-Lms-Return-Path: References: On Wed, Dec 03, 2025 at 03:07:36PM -0800, Tim Chen wrote: > @@ -1501,6 +1507,7 @@ static void __no_profile task_cache_work(struct callback_head *work) > mm->mm_sched_cpu = m_a_cpu; > } > > + update_avg(&mm->nr_running_avg, nr_running); update_avg() doesn't appear to deal with small numbers well and can have an error as large as 7, e.g. when nr_running < 8, nr_running_avg will always be 0 and when nr_running >= 8 && < 16, nr_running_avg will be 1 - 8, etc. AMD Genoa has 8 cores per LLC and this will break exceed_llc_nr() there. > free_cpumask_var(cpus); > }