Re: [RFC PATCH v4 0/9] mm/damon: hardware-sampled access reports
From: Ravi Jonnalagadda
Date: Mon Oct 19 2026 - 00:30:31 EST
Hi Rui Yan,
On Sun, 18 Oct 2026 05:16:13 +0800 Liew Rui Yan <aethernet65535@xxxxxxxxx> wrote:
> On Sat, 17 Oct 2026 15:11:18 +0800 Liew Rui Yan <aethernet65535@xxxxxxxxx> wrote:
[...]
> > Later, I noticed that about 10 minutes after starting DAMON, the 'seen'
> > stopped increasing:
[...]
> I found that if I enable the kernel NMI watchdog, this issue can be
> fixed. So I think this is not issue of this patch. What do you think?
Thanks for testing the series!
Agreed, this is an AMD IBS / x86 NMI quirk rather than an issue in this
patchset.
On AMD IBS, when a counter overflows it sets IbsOpVal in
MSR_AMD64_IBSOPCTL, stops counting, and sends a single edge-triggered
NMI. If that NMI edge is lost (e.g., across C-state transitions),
IbsOpVal stays set and the counter remains frozen on that CPU until
perf_ibs_handle_irq() clears it and re-arms the MSR. That also explains
why the sample count in your graph stepped down gradually over time
(100k -> 36k -> 18k -> 4k -> 0), as individual CPUs got stuck one by
one. When the NMI watchdog is enabled, its periodic NMI walks all
NMI_LOCAL handlers (including perf_ibs_nmi_handler()), which spots the
pending IbsOpVal bit and re-arms IBS.
For ibs_op, a larger period such as sample_period=262144 (as used in the
cover letter) or setting config=0x80000 (cnt_ctl=1, dispatched micro-ops
instead of clock cycles) also helps reduce the NMI rate on the CPU.
Also, if it helps for testing, the damo branch in the cover letter [1]
already has sysfs read/write support for the perf_event prep attributes
(commit 1178ccb) and tools/damon_tier_gen.py for generating IBS/PEBS
configs. Your probe_hits_wsum support in 'damo report access' on your
branch is a nice addition as well.
[1] https://github.com/ravis-opensrc/damo/tree/damo/auto-tier-bw-2026-10-04
Thanks,
Ravi