From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (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 0B048326938 for ; Tue, 30 Jun 2026 23:27:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782862076; cv=none; b=Zx1kW1Ttz+PmEosF3veenrRBTRNK105abi4e4IuN42bqfD0kGpdL7i122unLqoF1PE17pEKRdMl5qvJqOrSZMCApWBUPDrhOo3OrGMDo6XACXa65BAuWr03bEkZjBIRNnyhMnEQhwsByOOVgogBQG0CZ9FXrYhATwoGPqiivagw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782862076; c=relaxed/simple; bh=GtHzYMaaF3v4UBjAVj7EndqKG4BL/qmUFDM/olQsFVM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hQBUrE7LpGJA0Yi2b8sY7a9TuYlGfSIKaEAxKTFFs8cqkOUtPwTElFkDjvz1hGGzlCIGOatXyd+2iV7GXIsSMhsVasjZvTbY080FmU+yI87JBGFzJIrMVCFl6Rgree783CxDr648HY/E6PjX4ull6uvKBEG2ARRz+0usdWW3x04= 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=k5LEu7ob; arc=none smtp.client-ip=209.85.219.45 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="k5LEu7ob" Received: by mail-qv1-f45.google.com with SMTP id 6a1803df08f44-8f1e274ccb9so344606d6.2 for ; Tue, 30 Jun 2026 16:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1782862074; x=1783466874; 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=z8VxY8AgSRitjH8l91RmH5GEBz/bwewUsAZtM00QZ6k=; b=k5LEu7obEJGhrxqVDbKKcu0G36eYKHCbpTdLbjizGjcq6w8K0ov34s6kQ/LSHWXQst eZbv31sdRujBmp3RQqyu1CW5vSO5GOlN5Yu/9GrX0h3FAq5irg5Pol1Q2kmQQQCX9x3Y n29+FMpqo5rFpmogUW8TgwU4ndKCL58dkEXi3pUfJpLU5wZRBpE0+ncvNrzGjji+OtLE RmiDU+mkTceV3NOnzDhM60i1dGaMMF6nCKmV1CrK63dbQYpK6pJhi4VYcozl86dG5M6u gtkE+7SBmNqCrLnxWSvKltQ5dVTTQxSlA7YMli69G8vLxmeFSQUp7MhP1xXm3jhs8KAk 9XmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782862074; x=1783466874; 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=z8VxY8AgSRitjH8l91RmH5GEBz/bwewUsAZtM00QZ6k=; b=l5Gr98YEnDaIpyazkVjCuwHYhoznf25sFPMmRw9m+oHTxL4n2Z9WbPKCbybsoYeLYK GjExD8CMOfGn1F8YnXZ7RXZwai0JALF5oe7nMGp5wHp1tX2mEmHgmOI+mw3k/SLkwG5Y LhG/B9gmhblH3fySqKTXiEPl2E8zQgbaujKbjblk0yiBeCknratY8u2fM6e/7BeMy414 hGILNdrj3te9yFb9S2Py3j3baX2e7m6m2Bq1gfS70RHXBo7mVv7Zygt1hc+IKmbhE0XQ 0P5YTfdKJSDiPq0EQnPAAoe4vlEzHxRb6rUd5711qFwVOUqPcvUlY9MkVKnpJIEiaxoe cn7w== X-Forwarded-Encrypted: i=1; AFNElJ8a4QxNrO+UYdpwhkOApZQq1X+xYCWUQdkCaNGuRH8GH1jsnhpKuZiXnlQ1csGMpjty7hPbeI47gOUZZUM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8OMZAOwyLk8Uq+Wh3CBCtShEbAGcDJ/RD2a1h62WG4URzH1hX 1eZYy4rJkcBEP7sQNuUYr4l8uLyuaX2AKFJwVOY5PGBT8EQmRELIJakxu4ZnZIsfbyc= X-Gm-Gg: AfdE7clLuBB0EL+/Bf3glT0vrh2zwUyhXjt6yiYpnnGuDS4o71gVDFd6bk8BIZrB0+J 2k0Fix1CrahzjV5ydw+5Pg4HNTvqgVVykoPumYYxIxuER+H4cOouTjje/ATkoJ+niln8uGCeHeo JCGR3hiBZp9ftB2nia3GrPVHnSrp/t6y0+b1nV8010adv03BzJq0GWtty7dEOPwFcI9iaZUR2LS qyPrn9m8P+nAAD47v8KRApTdvEC7SeA/cR1GEfPd3KcbO187pXHClXGILweiFPyVhpyfEXUNO/n fSaSVRR0gEIs90b45vG7AeT9NRycmLCelBJX0vqFkPSVqWUXkFA9SLE97r93QNCa/2s3VsvqXAc 9WkBksXPY3IOyYKbDSRyfjvtneMhj+n4P9BrnK/ThOTh5cATwhQQ3tXJEK5mUyr96VaV/2Nao33 tDnKgmcfFsvMrfy16ieqa4DpoLoFXLcGRB27MPrUnI6ZKx7Kb5BDbWaXFDW6fuCNeWwmw2 X-Received: by 2002:a05:622a:349:b0:51a:84b8:df75 with SMTP id d75a77b69052e-51c108a0f92mr82576621cf.50.1782862073978; Tue, 30 Jun 2026 16:27:53 -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 6a1803df08f44-8f3618b6b13sm2985436d6.34.2026.06.30.16.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 16:27:53 -0700 (PDT) Date: Tue, 30 Jun 2026 19:27:48 -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> <20260630155517.38a99de9f32d20abcbf9440b@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: <20260630155517.38a99de9f32d20abcbf9440b@linux-foundation.org> On Tue, Jun 30, 2026 at 03:55:17PM -0700, Andrew Morton wrote: > On Tue, 30 Jun 2026 16:57:43 -0400 Gregory Price wrote: > > > 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. > > Is OK, we could make this change in a million other places. > > > > 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. > > Cool, what was the Subject? > [PATCH] mm/mm_init: handle alloc_percpu failure in free_area_init_core_hotplug https://lore.kernel.org/linux-mm/20260630214039.2263562-1-gourry@gourry.net/T/#u I didn't bother with Cc:stable because it's also 10 years old and doesn't seem likely to actually get hit, but if you think it should be stable let me know. > > I'll queue this patch in mm-hotfixes for some testing while we await > further review (please). > Thank you! ~Gregory