Skip to contentSkip to conversation

Docs/damon: add TLB flush policy document

PATCH In review Kunwu Chan 2 participants 5 messages Jun 5 – Jun 9

Subsystems (4)
lore
Share & tools
lore

Kunwu Chan

author
#0 lore raw

PATCH 1/1 Docs/damon: add TLB flush policy document

From: Kunwu Chan <[email protected]>

DAMON avoids TLB flushes after clearing PTE Accessed bits for sampling. The overhead was measured and found significant [1]. Production workloads with large working sets flush TLB buffers naturally, so accuracy impact is negligible.

On systems with large TLB buffers and small test workloads, stale TLB entries persist across sampling intervals and produce false negatives. This comes up repeatedly on the mailing list and in private inquiries [2][3].

Add a document on the design decision, trade-offs, test environment problems, and recommendations.

---
 Documentation/mm/damon/index.rst     |   1 +
 Documentation/mm/damon/tlb_flush.rst | 131 +++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 Documentation/mm/damon/tlb_flush.rst
Documentation/mm/damon/index.rst +1 -0
index 318f6a7bfea4..5e239437dab3 100644
@@ -19,6 +19,7 @@ DAMON is a Linux kernel subsystem for efficient :ref:`data access monitoring
 
    faq
    design
+   tlb_flush
    api
    maintainer-profile
 
Documentation/mm/damon/tlb_flush.rst new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#1 lore raw

Hi Kunwu and Lian,

Quoted 12 lines · On Fri, 5 Jun 2026 11:10:08 +0800 Kunwu Chan <[email protected]> wrote:

From: Kunwu Chan <[email protected]>

DAMON avoids TLB flushes after clearing PTE Accessed bits for sampling. The overhead was measured and found significant [1]. Production workloads with large working sets flush TLB buffers naturally, so accuracy impact is negligible.

On systems with large TLB buffers and small test workloads, stale TLB entries persist across sampling intervals and produce false negatives. This comes up repeatedly on the mailing list and in private inquiries [2][3].

Quoted 6 lines

Add a document on the design decision, trade-offs, test environment problems, and recommendations.

Thank you for this great patch!

Documentation/mm/damon/tlb_flush.rst

Quoted 24 lines
---
 Documentation/mm/damon/index.rst     |   1 +
 Documentation/mm/damon/tlb_flush.rst | 131 +++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 Documentation/mm/damon/tlb_flush.rst
Documentation/mm/damon/index.rst +1 -0
index 318f6a7bfea4..5e239437dab3 100644
@@ -19,6 +19,7 @@ DAMON is a Linux kernel subsystem for efficient :ref:`data access monitoring
 
    faq
    design
+   tlb_flush
    api
    maintainer-profile
 
Documentation/mm/damon/tlb_flush.rst new file +0 -0
new file mode 100644

[...]

Great document! That said, it feels like a good complete article or a paper, rather than DAMON documentation that pursue to be short and essential. I feel like this fit more to be published in a blog like DAMON project blog [1], or news site like LWN. If you'd like to, please feel free to upload a PR or send patch for DAMON project blog source [2].

Mainly due to the verbosity, as I above mentionedd, I'm not sure if the current shape of this patch is the best to be merged as is. I also find the background part of the document is a kind of duplicate of some information in design.rst. What about putting only essential information in a condensed way on the design.rst?

[1] https://damonitor.github.io/site_about
[2] https://github.com/damonitor/damonitor.github.io/tree/master/blog_src

Thanks,
SJ

[...]

author
#2 lore raw
Quoted 57 lines · SeongJae Park <[email protected]> 于2026年6月6日周六 08:54写道:

Hi Kunwu and Lian,

Quoted 12 lines · On Fri, 5 Jun 2026 11:10:08 +0800 Kunwu Chan <[email protected]> wrote:

From: Kunwu Chan <[email protected]>

DAMON avoids TLB flushes after clearing PTE Accessed bits for sampling. The overhead was measured and found significant [1]. Production workloads with large working sets flush TLB buffers naturally, so accuracy impact is negligible.

On systems with large TLB buffers and small test workloads, stale TLB entries persist across sampling intervals and produce false negatives. This comes up repeatedly on the mailing list and in private inquiries [2][3].

Quoted 4 lines

Add a document on the design decision, trade-offs, test environment problems, and recommendations.

[1]

Quoted 2 lines

[3]

Thank you for this great patch!

Review

Quoted 11 lines
---
 Documentation/mm/damon/index.rst     |   1 +
 Documentation/mm/damon/tlb_flush.rst | 131 +++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 Documentation/mm/damon/tlb_flush.rst
(quoted diff) +0 -0

b/Documentation/mm/damon/index.rst

Documentation/mm/damon/index.rst DAMON is a Linux kernel subsystem for efficient

Quoted 4 lines

index 318f6a7bfea4..5e239437dab3 100644

Documentation/mm/damon/index.rst +0 -0
@@ -19,6 +19,7 @@ DAMON is a Linux kernel subsystem for efficient

:ref:`data access monitoring

Review

Quoted 8 lines
Documentation/mm/damon/index.rst +1 -0
    faq
    design
+   tlb_flush
    api
    maintainer-profile
 
(quoted diff) +0 -0

b/Documentation/mm/damon/tlb_flush.rst

Quoted 1 line

new file mode 100644

[...]

Quoted 9 lines

Great document! That said, it feels like a good complete article or a paper,
rather than DAMON documentation that pursue to be short and essential. I feel
like this fit more to be published in a blog like DAMON project blog [1], or
news site like LWN. If you'd like to, please feel free to upload a PR or send
patch for DAMON project blog source [2].

Mainly due to the verbosity, as I above mentionedd, I'm not sure if the

Quoted 9 lines

current
shape of this patch is the best to be merged as is. I also find the background
part of the document is a kind of duplicate of some information in design.rst.
What about putting only essential information in a condensed way on the design.rst?

Thanks, SJ. I agree — this document reads more like an article than short

docs.

I'll follow your suggestion and submit it as a blog post to the DAMON project blog instead.
Will send a PR to [2] soon. Thanks for the clear guidance.

Quoted 9 lines

[1] https://damonitor.github.io/site_about
[2] https://github.com/damonitor/damonitor.github.io/tree/master/blog_src

Thanks,
SJ

[...]

author
#3 lore raw
In reply to SeongJae Park
Quoted 58 lines · SeongJae Park

Hi Kunwu and Lian,

Quoted 12 lines · On Fri, 5 Jun 2026 11:10:08 +0800 Kunwu Chan <[email protected]> wrote:

From: Kunwu Chan <[email protected]>

DAMON avoids TLB flushes after clearing PTE Accessed bits for sampling. The overhead was measured and found significant [1]. Production workloads with large working sets flush TLB buffers naturally, so accuracy impact is negligible.

On systems with large TLB buffers and small test workloads, stale TLB entries persist across sampling intervals and produce false negatives. This comes up repeatedly on the mailing list and in private inquiries [2][3].

Quoted 6 lines

Add a document on the design decision, trade-offs, test environment problems, and recommendations.

Thank you for this great patch!

Documentation/mm/damon/tlb_flush.rst

Quoted 24 lines
---
 Documentation/mm/damon/index.rst     |   1 +
 Documentation/mm/damon/tlb_flush.rst | 131 +++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 Documentation/mm/damon/tlb_flush.rst
Documentation/mm/damon/index.rst +1 -0
index 318f6a7bfea4..5e239437dab3 100644
@@ -19,6 +19,7 @@ DAMON is a Linux kernel subsystem for efficient :ref:`data access monitoring
 
    faq
    design
+   tlb_flush
    api
    maintainer-profile
 
Documentation/mm/damon/tlb_flush.rst new file +0 -0
new file mode 100644

[...]

Great document! That said, it feels like a good complete article or a paper, rather than DAMON documentation that pursue to be short and essential. I feel like this fit more to be published in a blog like DAMON project blog [1], or news site like LWN. If you'd like to, please feel free to upload a PR or send patch for DAMON project blog source [2].

Quoted 6 lines

Mainly due to the verbosity, as I above mentionedd, I'm not sure if the current shape of this patch is the best to be merged as is. I also find the background part of the document is a kind of duplicate of some information in design.rst. What about putting only essential information in a condensed way on the design.rst?

Thanks, SJ. I agree — this document reads more like an article than short docs.

I'll follow your suggestion and submit it as a blog post to the DAMON project blog instead.

Will send a PR to [2] soon. Thanks for the clear guidance.

Quoted 8 lines

[1] https://damonitor.github.io/site_about
[2] https://github.com/damonitor/damonitor.github.io/tree/master/blog_src

Thanks,
SJ

[...]

maintainer
#4 lore raw
Quoted 5 lines · On Tue, 9 Jun 2026 16:11:30 +0800 KunWu Chan <[email protected]> wrote:
Quoted 4 lines · SeongJae Park

Hi Kunwu and Lian,

On Fri, 5 Jun 2026 11:10:08 +0800 Kunwu Chan <[email protected]> wrote:

[...]

Quoted 6 lines
Quoted 6 lines

Mainly due to the verbosity, as I above mentionedd, I'm not sure if the current shape of this patch is the best to be merged as is. I also find the background part of the document is a kind of duplicate of some information in design.rst. What about putting only essential information in a condensed way on the design.rst?

Quoted 6 lines

Thanks, SJ. I agree — this document reads more like an article than short docs.

I'll follow your suggestion and submit it as a blog post to the DAMON project blog instead.

Will send a PR to [2] soon. Thanks for the clear guidance.

Sounds good, looking forward to the PR!

Quoted 3 lines
Quoted 3 lines

[1] https://damonitor.github.io/site_about
[2] https://github.com/damonitor/damonitor.github.io/tree/master/blog_src

Thanks,
SJ

[...]