From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 1321A352016 for ; Fri, 16 Oct 2026 22:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792190106; cv=none; b=E1a+OMa1l94YH9tyykQ/zalAeQfpEhG+SLkoqO6IwRQtfCI/0W3p9MFeynAJEQ26d6UQ8U6/K86GdlAnIr3jHIBsbg4FatdXYtET85nkoHz9C0E5qdIaoJQ7aTQkzlc2llfFxlGFCKWvLw7emXx4KH9GguuXpYeU6vYqu4sHxyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792190106; c=relaxed/simple; bh=b7OGKvhsJjjfXr4q4R/UClaDBJvsU704uXuJcvC1Ai0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=aZmHXREw6chmb1rnDKuQwYRuwOVyocqsfG6IuJt7LaVO7XeQgs/F0MD0ciZMgtUk57UZ55UEv36oTFUXo5EYtLQiKfZEakpnl7W1CwM5uSggQafmQ8FpbddBsaBAIMimXwLNAfj7evtLl5zCbIs/vH8ziI222JrzGV3kpxdNFZc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mA4Wf2G9; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mA4Wf2G9" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2db33db4de9so25045ad.0 for ; Fri, 16 Oct 2026 15:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1792190104; x=1792794904; darn=vger.kernel.org; h=content-type:mime-version:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=UfiAlLwpckXLSSoGlBblxykTWKXYXbwMTB7pRP0Lj2U=; b=mA4Wf2G9wqq1LDU5GVXcqk/GpwFDqCIC5r/1bJsygR5mV3LX8zAZflUoBpT6nFwh/5 3KvHVoQ3GByMGtHrI1uQ+nP/5ArdMLdnx69xdMGWcRKGEMkeEhse/ggirLeyOKjOd3HW 8e6TD41CbRVpFuC0D5xsaZ3Rl5IEbidR0qzuAXmzHL9VLN9c7jLzMm4TS8BoTMFMeEcF XIzgoliO64aKjHISjjLP7pK6rHCdfRDFfaoDJw4snH0dmP+5u2kI/JPXb3tjy4ON1czu +W4Z7xm7y2MeUvLtVa1DjGchLfxwBn+fX/MHJnf/lHS7KS9ltOtuI7GQdOSyoE++TPEr nRsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792190104; x=1792794904; h=content-type:mime-version:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=UfiAlLwpckXLSSoGlBblxykTWKXYXbwMTB7pRP0Lj2U=; b=Hp3M3DaoPwVynqHmUEGKwxzf2yKr61rTbNl7tsHwYi/TfU53/RAIKLTGkBP5B7Glyz ZqyyicLe2iy0gPcQ8y7E3L17hR6F971uh3JMVKDYcnDRrUs+kAFcKpVNXZ1bdPceLuSS wF8uEj03CzI1Xkm/oKcFawzMe3ihds2d28tqyKDbO53euTvs7rsoQk5vMqfHnh6nO1j6 NbCSJ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qXoEI= X-Received: by 2002:a17:902:d48c:b0:2cf:9ec1:ea6e with SMTP id d9443c01a7336-2e9b31afe12mr1007515ad.8.1792190102405; Fri, 16 Oct 2026 15:35:02 -0700 (PDT) Received: from [2a00:79e0:2eb4:9:17ee:cb47:3ad4:ee3c] ([2a00:79e0:2eb4:9:17ee:cb47:3ad4:ee3c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-89f56c87e66sm1698081b3a.13.2026.10.16.15.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 15:35:01 -0700 (PDT) Date: Fri, 16 Oct 2026 15:35:00 -0700 (PDT) From: David Rientjes To: Andrew Morton , "David Hildenbrand (Arm)" cc: Christoph Lameter , Vlastimil Babka , Mathieu Desnoyers , Sarthak Sharma , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [patch v5] mm: vmstat_kunit: add synthetic benchmark for mm stats In-Reply-To: <920ba123-077e-c42d-ebdf-a5effccf2073@google.com> Message-ID: <8b077a83-3f79-cbfa-0273-e086b0e51ae4@google.com> References: <920ba123-077e-c42d-ebdf-a5effccf2073@google.com> 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 On Fri, 9 Oct 2026, David Rientjes wrote: > From: Christoph Lameter > > Add a synthetic benchmark that can be used to measure performance of MM > statistics. This is used to analyze any improvements or regressions in > functions that are frequently used in hot code paths. > > This is the first of three tests that measure the execution times of > critical MM functions anticipated to be used by developers to measure the > impact of any core changes that would end up causing workload performance > issues. Vmstats are embedded into MM hotpaths, so any regression can > cause performance and scalability impact for users. Google has carried > these tests internally and kept them updated since Christoph posted them > back in 2009 for this purpose. > > This can also be used to detect regressions over time, from kernel > version to kernel version, independent of development use cases. > > The test is run by KUnit or doing modprobe vmstat_kunit directly. > > Sample output: > KTAP version 1 > 1..1 > KTAP version 1 > # Subtest: vmstat > # module: vmstat_kunit > 1..3 > # vmstat_test_inc_dec_zone_page_state: 10000 ops: inc_zone_page_state -> 8 cycles (4 ns/op), dec_zone_page_state -> 9 cycles (4 ns/op) > ok 1 vmstat_test_inc_dec_zone_page_state > # vmstat_test_interleaved_zone_page_state: 10000 ops: inc/dec pair -> 17 cycles (8 ns/op) > ok 2 vmstat_test_interleaved_zone_page_state > # vmstat_test_count_vm_event: 10000 ops: count_vm_event -> 4 cycles (2 ns/op) > ok 3 vmstat_test_count_vm_event > # vmstat: pass:3 fail:0 skip:0 total:3 > # Totals: pass:3 fail:0 skip:0 total:3 > ok 1 vmstat > > Assisted-by: Gemini:gemini-3.8-flash > Signed-off-by: Christoph Lameter > Signed-off-by: David Rientjes > --- > v5: > - added dependency on CONFIG_VM_EVENT_COUNTERS > - expanded commit description > > Once we're happy with this change, I'll apply the same treatment to the > proposed pgalloc and slab tests. > I've added the rationale for the change to the commit description as primairly being used by developers to benchmark and monitor any regressions in functions that are known to be super hot and impact workload performance. This is the simplest of the three tests that Christoph provided back in 2009, the others are pgalloc and slab tests, see https://marc.info/?l=linux-mm&m=178547194364290 and https://marc.info/?l=linux-mm&m=178547193264283 for those. Based on the feedback to move to kunit, I forked this one off independently because it was the simplest to address all the feedback and pave the way for the other two to be upstreamed afterwards. Is this acceptable for merge? If we're happy with this, I'll move onto the pgalloc and slab variants.