From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F22F93FFAB4 for ; Tue, 31 Mar 2026 15:03:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774969412; cv=none; b=RLJOF+vnJ01LZZDRA2tZofxG1gl1TTW/eeSq/ZTnM1emmLPPnTaaJDd1kgixAVKEiO/T+toAnXt/O334gJDH6Xyh6d/42d6Qixbi3sK3CyhQ3EtplAwtHkq20z0fDy2kE7gKPgx3gZJgRUaN6Rv8AHY2o77E1V9of19qHvLLFAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774969412; c=relaxed/simple; bh=E2Tb4wTfbdog+WeZY7Am5MdpsKVXYsglUMBxOhUQvD8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WODRVc3GXYVGWnQfQwC8EC5a1VNdOZXXm2NZ8YRQDZY8QvGoTwU/k/gE3slEBEgQy+HCpqFA+vAW1KiQDENq62lE3PV8MsQE5PFI7SMvkxiYMmchz+c7utZxMHY2dSzWUM96N9FuZJrpXROE3VoWDdgkSMT+y5qOERkLOQpMS+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=QbkhjFC6; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="QbkhjFC6" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62V8aN1C347700; Tue, 31 Mar 2026 15:03:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=UczSSS 9CKK95FgzuEtbmjOPbGqJ97U8Cbw/iDHovot0=; b=QbkhjFC6gAr6MTt0cBIEnk PUgNi1PfNC4vVuJv6qtjL1P2PNxQDk54Tv19KQvlWrljI3Gp3jwOKG+X4WE6SFrU E9D2O3sZ6d5apVaI7pupKn+TA0Q1hwIWmzVgx1JoEfjG3r8/M985D0/qN3m4KAXw U96/LjBb20x49sZDu4m8k1NA/Hrp0jLNEwfwQ2vk0k4n9T1JTlzzK4FL0LI+95xD fsi32YMIwmDFdTYOvJDGPlF5Cno6vAJgypfdZ4dqlJqJkkwvvgVi/gkgkMAU0vXh NYM9cVeNJIojD4MULhN0ztYGaEIi43nVk3Hyj492MXfcP3KOrbNxS8aLb9SoicOA == Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4d66q33wcq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Mar 2026 15:03:07 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 62VBLaZc006362; Tue, 31 Mar 2026 15:03:05 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4d6spy1pqk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Mar 2026 15:03:05 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 62VF35Rc29884936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 31 Mar 2026 15:03:05 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 286A358059; Tue, 31 Mar 2026 15:03:05 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ACD3658058; Tue, 31 Mar 2026 15:03:00 +0000 (GMT) Received: from [9.39.16.245] (unknown [9.39.16.245]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 31 Mar 2026 15:03:00 +0000 (GMT) Message-ID: <13904ac8-6608-4f03-9806-36518931eb3c@linux.ibm.com> Date: Tue, 31 Mar 2026 20:32:59 +0530 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] sched/numa, mm: Skip page promotion if cpu pid is valid To: "David Hildenbrand (Arm)" , "Huang, Ying" Cc: Andrew Morton , Ingo Molnar , Peter Zijlstra , Ritesh Harjani , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baolin Wang , Ying Huang , Juri Lelli , Mel Gorman , Vincent Guittot , Dietmar Eggemann , Steven Rostedt References: <20260326071216.11883-1-donettom@linux.ibm.com> <2b8f30a6-a8d1-4ea5-8078-5eec399c8609@linux.ibm.com> <87cy0kpfdx.fsf@DESKTOP-5N7EMDA> <7dd35e65-e0c2-423d-a82d-c9e488e85e33@kernel.org> Content-Language: en-US From: Donet Tom In-Reply-To: <7dd35e65-e0c2-423d-a82d-c9e488e85e33@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-GUID: 4-Uf4ZRh-RgSKH1svsIRljpnOZzmk9iW X-Authority-Analysis: v=2.4 cv=frzRpV4f c=1 sm=1 tr=0 ts=69cbe22b cx=c_pps a=5BHTudwdYE3Te8bg5FgnPg==:117 a=5BHTudwdYE3Te8bg5FgnPg==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=U7nrCbtTmkRpXpFmAIza:22 a=VnNF1IyMAAAA:8 a=kD2cJtFTWjehufG_4jQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-ORIG-GUID: m0jlVuAZezlh8X8H-qMakLj-V9ls3wOm X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzMxMDE0NCBTYWx0ZWRfX25yqOX0eLUJY ofDEyWrj2xU0RTdJ1owbx+VIvpMf/proqVbmYzwQinydUNM15CcLczmS3VZE2hJWEtzBR4t8mnz yKroEdMBo8bcq7DHPJxaVFX15KIdtRq6pUtdNO4r66vxMtOJNalZtoGHWzrKA+angcy110yk2MG PcSvtFl5fNdtzFWwA9zwspbT7Y21wSxLQ2SaLUHmtMnOlFsJIhFIJw8lg5wtIBtoDe9xGzrGsve SCtX6SwWz6990dhhxiAYRIZHLvVDWjz8khUDph4H77BA6yJSMPtRs7AL+8wfSJEiUDJ7d7v11LS oU+KH3JDTzuVYWIqD1gUFPmoFI3kfmn/j1jx71+EE66G/T7LS82w8dTQJ2qEzz+pJRvS5ei7zHY p1GXJ0wAyDA2p1zce11lRHjCqyzUiomUGQM5J3Mw/KBEbjF3F8Zzyn+Z0kIMJ9mX+zQG31lyC1h Wp5BXHQWDdpnmyzTijw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-31_03,2026-03-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603310144 On 3/31/26 3:34 PM, David Hildenbrand (Arm) wrote: > On 3/31/26 10:33, Huang, Ying wrote: >> Hi, Donet, >> >> Donet Tom writes: >> >>> On 3/26/26 3:59 PM, David Hildenbrand (Arm) wrote: >>>> Is that measurable? Should we at least have a Fixes: ? >>>> >>>> /* >>>> * When ... >>>> >>>> IIUC, as timestamp we use jiffies_to_msecs(). So, soon after bootup, >>>> we would no longer get false positives for cpupid_valid(). >>>> I suppose overflows are not a problem, correct? >>> Thank you, David, for guiding me in the right direction. >>> >>> I initially thought that overflows would not occur, and therefore >>> cpupid_valid() would not produce false positives. However, >>> after looking into it further, it appears that overflow can >>> happen when storing the access time. >>> >>> The last_cpupid field is used to store the last access time. >>> From the code, it appears that 21 bits are used for this >>> (#define LAST_CPUPID_SHIFT (LAST__PID_SHIFT + LAST__CPU_SHIFT)). >>> >>> With 21 bits, the maximum value that can be stored is >> It can be less than 21 bits, if CONFIG_NR_CPUS is small. >> >> DEFINE(NR_CPUS_BITS, order_base_2(CONFIG_NR_CPUS)); >> >>> 2097151ms (35Hrs) . If the access time exceeds this >>> range, it can overflow, which may lead to cpupid_valid() >>> returning false positives. >>> >>> I think we need a reliable way to determine cpupid_valid() that >>> does not produce false positives. >> Yes. IMHO, false positives is unavoidable. So, the patch fixes a >> temporal performance issue at the cost of a longstanding performance >> issue. Right? > > Could we set aside a bit to indicate "cpuid vs. time" ? We'd lose one > bit for time, to we care? Thank you, David, for the input. This sounds like a good idea—I'll give it a try. -Donet > > Would make it all easier to get ... >