From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 24414800 for ; Sat, 27 Jun 2026 20:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782592943; cv=none; b=rewavNYc35SH5gm/3z/Algxoz3nKxA5Syaa4h56ia1yS19A3Z0d7l98Hhct56uq2nqZEtExA7RplITBWC9M92pBcuEU9MvxBWSXZ0A3WYZX1AtSqa+zLRHWqITo8Lwdu2b5c2QzTvx/AqyvlVRV2t9sj0LGTRZ9MOLattW00qxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782592943; c=relaxed/simple; bh=7vb4snxpMOpyUr0gr4AhCLWmvUzZ8GqvNt/munNwM6s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pQZACkF80JunyOADnePZoTmKnMO69oCdvm6pXaMGJBrq2JCIUtC8Z/aHI7sRxUii5G3vAs0jdJuCk2mUXum1sBCTNXMhNw8WMeq3oXQWng17ytJc9vNExoY0QQosVDB8fwm8vbHiRNI0eq1tg/M+j/1oLbOp48bYK0gZ5lcb+7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=NHaOIZ59; arc=none smtp.client-ip=209.85.222.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="NHaOIZ59" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-920fbdffa31so174504985a.3 for ; Sat, 27 Jun 2026 13:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1782592941; x=1783197741; 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=UvBTXqN1MAazPmYZrbZsf15Ac2BOg/NxzUUoaLCPN5k=; b=NHaOIZ59u8gKxw7npgJ6bR4dLFwGJYTa+D2IEvUChuZhhRbtlxjFVaihWazirK8tqB h0e2mZHv3rb4GABo7X4d3muhLOPW+4bCmgqYzinavKkC0t8mDSHPYeZfW5yUftcGxNoA e9KvQXhqzNgpWFYypJHlqUT9p7d0+18DERE/e2w6Ds95+pZTYAjpSlxfomUR5IQcZ7tY WOai7NFh1FZROUmTLeFrCdvTYILzrsfCL+/wEOwUzNLXm7bD3LQ+1K0jC/B0w/rRRQKZ 3BgJUdk72ayOSAQsAo50s4MqJj4IzrwX6IRjB3QB/cJSTmlP25+7+CGgKW0ftyltfmdH /30g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782592941; x=1783197741; 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=UvBTXqN1MAazPmYZrbZsf15Ac2BOg/NxzUUoaLCPN5k=; b=dwRcqtVeFwBZxILA+A92LlVOczRtCarkcRs1hg1qj1m0TmGiHx49ApZG/r+qQcmPDy FQ9GGE8qrlAwmBvekOOMPFIyBKR6hPDPI/sh8rQkF6eeJJnVTX9goOSuhluEwns3a5L0 j7E4lIGp6trHIrlZsVsMfUaexL/OYYXEFwzqy0UCMu83tSUTp2iT6Zr08E9CllRwE2kd qOhMcysp+vJjGlGKD6Pu0KkS65GJU8AgDyjA5lXyJgeim65Ja1PPwze2WVxW5L+9psEm Lb2PSBZlTfaCymuEq/ru89ExZuyNDsZ63SVEgtyYg0lVS1WiglPiKIte5UUp1urOb6F1 IlCA== X-Gm-Message-State: AOJu0Ywmy8aDj3juq6ILjTt1Ki/KAwHZCSxjfysCpOFKnf/kVHhYDCYF ZBbu+2t0gq5cohIYHzVt0sKjbbbJKnoneIyko4w3fEsDIEMtveLTg2UXVQhAaYNXHDs= X-Gm-Gg: AfdE7cl9erRrLeYqc4aEQNfioY960Aojvy+UdItjDtJTy2G9QU9mn9Ubecj6JJnNSfE niig0/lSe177SZNMgDEokep4av1PkMXLHae4/76Xy4LZe4pAYZTcIaBsO4DAeGys4bY3KZxmg1Y DDwwrpoLrFL4N82vptxbsf1QylX1gkZn5ZWiVAVLLoxaKfZNT5vkE1pdJ+Xq9eT4MmVSNIrU1JV 0borBkyRN2ekjB6bVFB2zQT+0mj/1XbayVbCsR2XC8U6XBC5Qsy+oq+t+/0CHyUtCJHzSnqNUsa g/mEcjKshzUxAY/NMlN9nfiWBy+Y9oo/lqLQQABU/vPui3jrGNCR+gkFnlgVzMxP2EMq4FclJLX UL0d4a/Gl5ifJRyCIf+50dxSs2hEZNHRBhszMCXx5wrSVPGxsW+zTAmTUhThSUhJ6xoQ1m6OMOS aphj98dapkTRAIjTkcpel3ehwuGj4FYpLMuHFkaJsjgU8jNQ9ddJTFLau368rLmf4SWn3LtaGf3 A5NUwE= X-Received: by 2002:a05:620a:2915:b0:922:2baf:d757 with SMTP id af79cd13be357-9293d4a105fmr1727191785a.58.1782592940972; Sat, 27 Jun 2026 13:42:20 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id af79cd13be357-925fda626b9sm1585236085a.14.2026.06.27.13.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jun 2026 13:42:20 -0700 (PDT) Date: Sat, 27 Jun 2026 16:42:15 -0400 From: Gregory Price To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org, kernel-team@meta.com, akpm@linux-foundation.org, david@kernel.org, ljs@kernel.org, liam@infradead.org, vbabka@kernel.org, rppt@kernel.org, surenb@google.com, mhocko@suse.com, osalvador@suse.de, hannes@cmpxchg.org, mgorman@techsingularity.net, stable@vger.kernel.org Subject: Re: [PATCH] mm/vmstat: flush per-cpu node stats when a node goes offline Message-ID: References: <20260627073107.523499-1-gourry@gourry.net> 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: <20260627073107.523499-1-gourry@gourry.net> On Sat, Jun 27, 2026 at 03:31:07AM -0400, Gregory Price wrote: > A per-node vmstat counter is pgdat->vm_stat[] plus per-cpu deltas. > A balanced counter can sit split as global=+N / per-cpu=-N. > > The folds reconciling the split only walk online nodes, so when > try_offline_node() marks a node offline - per-cpu deltas are stranded. > > A subsequent online zeroes the per-cpu area but not pgdat->vm_stat[], > orphaning the +N permanently. All NR_VM_NODE_STAT_ITEMS are affected. > > Flush the deltas before the node leaves the online set. A remote > fold races the periodic per-cpu fold, so do it as per-cpu work. > > Discovered when a node/compact call hung for a nearly empty node, as > the math to determine throttling broke. Reproduced by repeated memory > hotplug/unplug cycles on a node under pressure. NR_ISOLATED_ANON > ratchets up and never returns to zero. > > Fixes: 75ef71840539 ("mm, vmstat: add infrastructure for per-node vmstats") > Cc: stable@vger.kernel.org > Signed-off-by: Gregory Price Realized I changed the title on v2: https://lore.kernel.org/linux-mm/20260627073107.523499-1-gourry@gourry.net/ Core issue was the zeroing at online time causing the skew, just have to do the fold there instead. disregard this version please