From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (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 0D0AF31F9A3 for ; Wed, 1 Apr 2026 09:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775036924; cv=none; b=PpGMBb8lARAj05as4oyCnljHo/90o5xXe+iI7stKCGAIX4mw0vkc2bNsZTa+T37Utl+EL4ieD1b8cEucsIToJckGYHMif0eTTy8N5w6vMnuycUnSrd6H2byWtudIwdOr5QD4+JKiVRRHvoiY1xz4ZmfWGIGCsTiMvBgY3Q5K/xM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775036924; c=relaxed/simple; bh=uIrrSVwd6ZBkXEIquib0F7vfG4q39BdoeZAxMdtbqUQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=To4yuypHWnVmGE45nL+4JU3nvCh5p1T5WtmNH9gPnp03I7f80YJP6Ey60Wkm8N9EDbdTDWpr4Kx2mj0D7dM8EJ1uISazfWmGpl3bOfdI2R1wjHUgaPt8Qqc9muSzl03u61NIv2fzIbElcNJCDLsBxRYQmhvIwD8Cu/CgcVIcAT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=o6x9jOhP; arc=none smtp.client-ip=115.124.30.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="o6x9jOhP" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1775036915; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=GQ8lIZi5cNaNtDxgsiU368Gc/m69M0yE00uYzoQg624=; b=o6x9jOhP+XhfGVZ9LYGYGdnCRa8UYBcJUPbYYy3DnajAsTrx+R4EgkZP2Z3OnYgSAnsEfNGVDY3nBc7BF5/Bbgv30LIiovI3wRkx+/GBqr3J5md/EkAs5l8iEwWWHU62v/2kgGxdWLySSxNFrTkxcHZKC4fmTdqOrTm5yc3cM+s= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R661e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam011083073210;MF=ying.huang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0X0AXFuR_1775036903; Received: from DESKTOP-5N7EMDA(mailfrom:ying.huang@linux.alibaba.com fp:SMTPD_---0X0AXFuR_1775036903 cluster:ay36) by smtp.aliyun-inc.com; Wed, 01 Apr 2026 17:48:33 +0800 From: "Huang, Ying" To: "David Hildenbrand (Arm)" Cc: Donet Tom , 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 Subject: Re: [PATCH] sched/numa, mm: Skip page promotion if cpu pid is valid In-Reply-To: <7dd35e65-e0c2-423d-a82d-c9e488e85e33@kernel.org> (David Hildenbrand's message of "Tue, 31 Mar 2026 12:04:10 +0200") 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> Date: Wed, 01 Apr 2026 17:48:23 +0800 Message-ID: <874ilvui3c.fsf@DESKTOP-5N7EMDA> User-Agent: Gnus/5.13 (Gnus v5.13) 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=ascii "David Hildenbrand (Arm)" writes: > 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? Do we need one more bit for time and cpupid? However, page flags are precious resources. > Would make it all easier to get ... --- Best Regards, Huang, Ying