From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 C2C6D47276A for ; Tue, 30 Jun 2026 20:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782853071; cv=none; b=sqzTTpbjgFVYg8qJdnNMdMVrOurYUY9oGB29wnV3bz1hKAU91QxbVkblP8QU6erGYlKV6myPE9rAgk1boFM1L+ULRrfYOjyd7prg4cNuRNr66j/m3GobbanTbqckAoOhCJWVG/bAGd6OI7ZYACOHhlBk9fGo2WmxWb6EtJ7s0mA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782853071; c=relaxed/simple; bh=tki8VYOorrL7Vh2P/GhEe6UqvDv1psdAe9UhD9ggn0c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IKktuyBvzcJIw7G1xSdV8w+e0WUp+vGyv+0E44uk6OaCGKLM75+NHoCB+sw3BlPB4KTbO4+Jp0uzRVkajv3bB+N1cWGF1e/0FiaZnwqB8VB5NON2/G0qxFIgkuJuZWS8VFscxOCFHFTI1DBSiXgxACk0T0dz1cq3E5SGQZWe7v8= 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=UwaKNwoT; arc=none smtp.client-ip=209.85.222.176 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="UwaKNwoT" Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-92e53581361so219057785a.1 for ; Tue, 30 Jun 2026 13:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1782853069; x=1783457869; 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=P+IJodXzk6nIKTwEHgsn4EfzwEPSclnTV/6cyemr0hQ=; b=UwaKNwoTNQ4yh1q4/sOwnEh8nbMAnQuRNK5UaNzfkulZ+TQWZRtoYR6IbpzBkxVl1Y R8xaphWVkot1fA01WHVK1RYNVip1jzzLv73dwVgWQwu5zyHgYTG/7ySxc4l3V8dS+IGq e1mLfvmX2JGyxlzmzLMnqv2LkO9MGUlwoHW1Fa5IL/Yl+74j2bFipkwcrw5rL8Q4rJYk gtLaW0HEQXgjpUkO+3AXrefKDeJH6AoF9ScZ8HBH40Lv2ZWETLLxO/Cux6oPs9ZDR5xI hqhQM1UDvWNBbl3cuJALJd3dCxmtTXdPAbDzV5Ijy6Jh9BVFsu3MQ239zlePeozDpxp0 r4og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782853069; x=1783457869; 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=P+IJodXzk6nIKTwEHgsn4EfzwEPSclnTV/6cyemr0hQ=; b=j+OeYQgTLY2uFRQWUoA9RI7jwUhxYlgm+78itjoxN9DdeqgL1uc/Syoo8iX5TNWI8E zT9LypoNvwOzXHEU6WnCGmynNxGFN0NwGk1bJJ8OC1TXL9cvBKB67mlnLy19TAO4IWB9 KyuhqL22jK0NGFYBTuMSi6WZJ3ld/UI9bwo73Yhs0xlJllA8ltCbisY4TkYnBcce2ehD ip90K8WrWBtLSCJCru3fhG3cYzF2M4p38PAM9TkLKODIvX1bl4t6C3OScqhuBrbNxpxe HTVP04jwZBC1pZDaMOFI9hOHi95XbLIgdB6Yw/r8WIILs1kn9X1zW7pLG2WstIWI7Q0+ /YtQ== X-Forwarded-Encrypted: i=1; AFNElJ/yP77s5GvQ9vMm8A/4qSC4sdJ09kfnWcp4CjzD2RBXG1xdzcqucV0WdXTFf5oF2btEOhsKiSdG4Be2vvQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0lYRnf/RmQnDXqWWVRhrqHt4HzWSs3JT9IIImEHcMR70xencx 6wGeQZG4JPuhKEzFoZ9I9r1LPqwM0dR4v7zvdRCnXXK+fDUE1H886ay7CH/hM2VHk0E= X-Gm-Gg: AfdE7clOCmkGwa1SItX4jC1Kh2vdd86/UJWovHBRW8Xef8SR8UG1pGxmntRM/P5qTgO v0AzrzoKMSq6BPDG43cHoImDussYPJslNKIUMv+nUWmj4oR5qLw3NQxCvag/49r8VjMVG70Vyny ZLsroWUyDF12XmBoxyuZBLFsXc3p3CmdI9cyzTg3AOEti9VeXhwr2cSdELqMniT0VmnWTswpXCJ xor8WIkxfj9/4mrTqgj6CoHlZZeFmEpSipJLwSQAFh3nWMkSD4mVvK4I1eGni71wlI1ds6vMWQq 3lAz4Rx+WlZfDsn5fUyg80hjl4r9Bq7fYw7i3tLgwNbjMd1Ck3DGgPGeR1053NMRmlJJgsIkmAH f+NHaHSOsTP5sVshIWzCwPvZCUCEgn8l41lCXynxUr5ZwR4cFLl2AZVv9nwvd4ZgfO9AKZAirsq 4rGbPDfVf1WMUk2mdacythCPCN19LpTxTkhRSL1wbVsUhDTNIa9zMUHJQviBUbg1E3njnr X-Received: by 2002:a05:620a:40d3:b0:92e:4a4a:4478 with SMTP id af79cd13be357-92e6d840616mr373996485a.31.1782853068602; Tue, 30 Jun 2026 13:57:48 -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-92e622e7473sm348604085a.25.2026.06.30.13.57.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 13:57:48 -0700 (PDT) Date: Tue, 30 Jun 2026 16:57:43 -0400 From: Gregory Price To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rppt@kernel.org, vbabka@kernel.org, mgorman@techsingularity.net, hannes@cmpxchg.org, stable@vger.kernel.org Subject: Re: [PATCH v2] mm/vmstat: fold stranded per-cpu node stats when a node comes online Message-ID: References: <20260627202243.758289-1-gourry@gourry.net> <20260627161007.81e4533ce561c2951a69f927@linux-foundation.org> 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: <20260627161007.81e4533ce561c2951a69f927@linux-foundation.org> On Sat, Jun 27, 2026 at 04:10:07PM -0700, Andrew Morton wrote: > On Sat, 27 Jun 2026 16:22:43 -0400 Gregory Price wrote: > > > + struct per_cpu_nodestat *p = per_cpu_ptr(pgdat->per_cpu_nodestats, cpu); > > > > - p = per_cpu_ptr(pgdat->per_cpu_nodestats, cpu); > > + for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++) > > and that's a lot of items. > > I guess the overall loop count won't be large enough to cause issues, > but it's large! > > Perhaps there's some simple test we can do on the per_cpu_nodestat to > avoid the inner loop? Perhaps might need to add a field for this? > I took a look, but that would involve adding another per-cpu field and then making sure all the races on that field are respected as well. Not sure it's worth it for such an extremely rare event. I can try to get clever on the folding logic if you'd like, let me know. > btw, "for(int i..." is allowed nowadays. It'll make this code nicer, IMO. > Otherwise i can send you a respin for this. > And... Sashiko seems to have found a pre-existing issue: > https://sashiko.dev/#/patchset/20260627202243.758289-1-gourry@gourry.net > Incoming patch for this shortly. Pretty trivial. ~Gregory