From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B69340B6D8; Thu, 14 May 2026 14:09:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778767765; cv=none; b=MplFENTaJmXlMioc7Yyuu3vpbYHFgYuhtCzxWwwsI63xA6KkH8fnPgeOaRml5HmttIf9IrRwnEak6ECl4ztNBFi5z7zlS9njIbzTFLa2qFii+Pava+eBTtWDr4wg0YhfavU357o4dnbh5AdVXA6wGgaWC7sJ1qaF4raPbScGwHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778767765; c=relaxed/simple; bh=cN6FA2fDmcwC+JRPicLwVTnBJQclCA8SmpykqguB6yE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nxcZzbM9QtC5b1OU4Xy6pRMD3loVU6JbWhaVjxQJ4cl/Pd5I86fmUznXr3dym0R5/agxa+pqhm5/aUQhfT8ED5ssc6UJJn6wxUplQ6wiZWsiQdTN4lyCreR1jCuxWQMABpoy3b9nS2yQP4d+8kecV6aD9zE9QynuFCrHPca0YPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RF/nIHl+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RF/nIHl+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA831C2BCF7; Thu, 14 May 2026 14:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778767765; bh=cN6FA2fDmcwC+JRPicLwVTnBJQclCA8SmpykqguB6yE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RF/nIHl+xd7P/vWAHiQA+OmQT8Lpqd24rkXlzlEP90So6PU5fT5u/TFY+j8jZSBZN WX9K56+F3S+JHfKAKD7OtN2E5NqNMn11xTZynFLRTOLZvPdz76Zpho68y9iPEIcj0K dDFnLzWU/cuzN4PltomnYSPhEb1rITh7I8zjUgbsm3/A8P/kVFpZAWQ8NPN5d7Jk/l 9mw4wKt9TiyCwqTBasPmoEC9aW+4+9nt7e43dTjQVtvLXWe+Zs8N6Rjq4VV25cgEE9 2ETPd3PfmqHCCn4YW/MV653AOsH5tdjniv6aOklfsB+U8tO0vUyJMP9ydwfx0p36Lz QgdEZV6oSxNrQ== From: SeongJae Park To: Cc: SeongJae Park , "Liam R. Howlett" , Andrew Morton , David Hildenbrand , Jonathan Corbet , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Shuah Khan , Suren Baghdasaryan , Vlastimil Babka , damon@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH v2.1 20/28] Docs/mm/damon/design: document data attributes monitoring Date: Thu, 14 May 2026 07:08:53 -0700 Message-ID: <20260514140904.119781-21-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260514140904.119781-1-sj@kernel.org> References: <20260514140904.119781-1-sj@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Update DAMON design document for newly added data attributes monitoring feature. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index fa7392b5a331d..6731c3102d0ff 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -276,6 +276,43 @@ interval``, DAMON checks if the region's size and access frequency (``nr_accesses``) has significantly changed. If so, the counter is reset to zero. Otherwise, the counter is increased. +Data Attributes Monitoring +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Data access pattern is only one type of data attributes. In some use cases, +users need to know more data attributes information. For example, users may +need to know how much of a given hot or cold memory region is backed by +anonymous pages, or belong to a specific cgroup. For such use case, data +attributes monitoring feature is provided. + +Using the feature, users can register data attributes of their interest to the +DAMON :ref:`context `. The +registration is made by specifying a probe per attribute. Each of the probe +specifies a rule to determine if a given memory region has the related +attribute. The rule is constructed with multiple filters. The filters work +same to :ref:`DAMOS filters ` except the supported +filter types. Currently only ``anon`` filter type is supported for data +attributes monitoring. + +If such probes are registered, DAMON executes the probes for each region's +sampling memory when it does the access :ref:`sampling +`. The number of samples that identified +as having the data attribute (hitting the probe) per :ref:`aggregation interval +` is accounted in a per-region per-probe counter. +Users can therefore know how much of a given DAMON region has a specific data +attribute by reading the per-region per-probe probe hits counter after each +aggregation interval. + +This is a sampling based mechanism. Hence, it is lightweight but the output +may include some measurement errors. The output should be used with good +understanding of statistics. + +Another way to do this for higher accuracy is using :ref:`DAMOS filter +` with ``stat`` :ref:`action +` and ``sz_ops_filter_passed`` :ref:`stat +`. This approach provides the data attributes +information in page level. But, because it is operated in page level, the +overhead is proportional to the size of the memory. Dynamic Target Space Updates Handling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.47.3