Re: Wrong example command for auto-tuned DAMON-based proactive reclamation, and solution/workarounds
From: Arijit Desai
Date: Mon Nov 30 2026 - 17:01:36 EST
Hi SJ,
(Replying to https://lore.kernel.org/damon/20261122202258.161562-1-sj@xxxxxxxxxx/
,
as the original mail did not reach my inbox.)
On Sun, 22 Nov 2026 12:22:57 -0800 SJ Park <sj@xxxxxxxxxx> wrote:
> A right approach to utilize DAMON for auto-tuned proactive reclamation
> would be using 'age_ms' DAMOS fitler [6] instead of the age threshold
> (--damos_age).
[...]
> Workaround 2: Small coldness threshold
I tested both the age_ms filter and a small coldness threshold on a
vLLM CPU inference workload. Both work as expected. Sharing the
results below.
Setup
=====
- VMs: 16 vCPU, 62 GiB, mm-new 7d1a16abe4cc, 16 GiB swap file, zswap
off.
- Workload: vLLM v0.34.0 CPU, a 3B model in BF16, 8 GiB KV cache. 32
concurrent users, 96 requests, about 1,700 prompt and 256 output
tokens each.
- DAMON (damo 3.4.6): DAMOS pageout on the vLLM worker process, access
rate 0%, intervals auto-tuning, 256 MiB/s space quota, and a
some_mem_psi_us quota goal.
- Setups:
- as-is: --damos_age 2m (converted to 1,200 aggregation intervals),
PSI goal 1 ms/s.
- small threshold: min age of 2 aggregation intervals (set via
sysfs), PSI goal 0.5 ms/s.
- age_ms: min age 0, plus a reject age_ms filter for 0-119,999 ms,
PSI goal 1 ms/s.
- 4 runs per setup. Each change is against no DAMON on the same VM.
Results with MGLRU
==================
as-is small threshold age_ms
output tokens/s +0.2% -0.7% -0.2%
inter-token lat. -0.2% +0.9% +0.3%
worker RSS -0.06G -2.54G -1.80G
swapped out 0.20G 3.13G 1.93G
swapped in 0 0.028G 0.003G
some memory PSI 0 0 0
No DAMON: 26.5 output tokens/s, 18.4 GiB worker RSS.
The small threshold pages out more, but also pages out some memory
that is still used now and then, so ~10x more comes back from swap.
The age_ms filter gets about 70% of the savings at under a third of
the cost.
Memory PSI stayed 0 in every run, even with swap-ins, so the PSI goal
never throttled DAMOS. As far as I can tell, that's because
MADV_PAGEOUT-ed folios under MGLRU don't keep PG_workingset, so their
refaults aren't counted as memory stalls.
Results with the classic LRU
============================
small threshold age_ms
output tokens/s -0.3% -0.1%
inter-token lat. +0.4% +0.1%
worker RSS -1.70G -1.55G
swapped out 1.76G 1.65G
swapped in 0.003G 0.002G
some memory PSI 10-30 ms/run ~20 ms/run
quota at max 24% of time 51% of time
Here the PSI goal works and throttles DAMOS, so the small threshold's
cost drops to about the age_ms filter's level. The age_ms filter does
well with both LRUs, since it doesn't rely on the PSI goal to avoid
hot memory.
Note that "worker RSS" is memory unmapped from the process. Much of it
stays in the swap cache for a while before it is actually freed.
I'm also sending a patch that makes DAMON_RECLAIM apply its min_age
via an age_ms filter, as you suggested.
Thanks,
Arijit