From patchwork Wed Dec 13 19:03:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003352dys; Wed, 13 Dec 2023 11:03:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+zDKL0RuxfcMWeq9VvTQzRbBldWF/tVoVVH9wjxKekPOsQRhJz6MS567/ch13lUvvhJSp X-Received: by 2002:a17:902:7e82:b0:1d0:6ffd:ced1 with SMTP id z2-20020a1709027e8200b001d06ffdced1mr4348606pla.138.1702494236646; Wed, 13 Dec 2023 11:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494236; cv=none; d=google.com; s=arc-20160816; b=uRM8DIs/M+jaDnwbZPpqmFdgqAYnuIQCEERCgWPDhw17M+c4vXOs3+1eatxbnGXcGp sOer2xk8Jqlo2gaU7jE82p0T1c3XbyqU2c8MbKP23mYPj75SWwlwWdRIROqWpLnKk2QW h/H35ng0JZ3wrCNcXUTYh0rbMhpSvEw2sKUp+3jLzVJfvEjpvkiwqQkVNBDCC+WhmaZQ Q/d3AeCrhdN+l9Ln0tzrveHWEVp8MZCBOYY6IZrRIPdi9jleD+9Mg1FIslhbFSJlxYWb tfAfcWX4XPKzwsjASmeGNexXNSP6OhTP8rfskNsJGRTbjKA3eH7z4oU+RYhqWqgvboAD w9mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uVHyYSGpOQsScDTHUEVed1QVfAfQSkGLuhr9Kf2CW/U=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=QatGgNDSsIiJfLzd6TFqGIl7RfE3cuCXQwkSpmCTB1fpWgOUxWoCxagItodf8ihcSe z1UCdBHEOAzbj/9Jv5kHEDduqSMhe3lkYROfi2OC+8TReRM0+Q0kVdI2g6B4SfBGt65v P0N6YcC5kLN5STkEBbV/+pBoaLLpYPuohNtCG5QDd+dTlW8MD/Z2pQuXFAI2oaHb/VdG UEVWd2XsS+mIHtcMHQAVIqxViGbjm1C3Y+u7PKHxKRI+nBsgO2Irxk6Crh/VLNx8YxJo 9AZAW5j30xjmPnxblxDWreFTl1COc2QV7Z29880V02fgjJTXNOTFDUw3hfqVk6W5w80/ r9hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsMpltOj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id n9-20020a170903110900b001d09c54485esi10185437plh.568.2023.12.13.11.03.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:03:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FsMpltOj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D3D1580BB3F6; Wed, 13 Dec 2023 11:03:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379294AbjLMTDn (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbjLMTDl (ORCPT ); Wed, 13 Dec 2023 14:03:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D8BE95 for ; Wed, 13 Dec 2023 11:03:48 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AFD9C433C7; Wed, 13 Dec 2023 19:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494227; bh=zkxV/sJ91hBwZ2pcDcldOS6t/0SJ1DBEmN593qqkP8A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FsMpltOj8b5LLTVNjVwEqLIsRh8q05n4NT8JLQWlwVypSIKY6eN74NUwjf7yqfpGu K5QgM7ZGlZgpO0+2xyPPwj7bykR38c57sfAW+T9Ao8j5z3hwb5zsGYaX2bp4ERAOIq Z5wLSbvbkf1poMf7iFSWJqG/+SAJvZeyYvzfeH2S3K7/YAgYvasfi6Pe7ExgKIKrZE WDpJQTooHK/zayfuGnOGXGPjkCbLj8B817wwNwwlfOY6fC/vNqRivwT1mVnuksHKVT r3q+ype7ln+bWVGHZ2b1VkLaO6j54rq63bhQPDjWe1sKfbbmdfzHqCHP/3eXz3IIpK Ff4KF5MNj0fOQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] mm/damon: update email of SeongJae Date: Wed, 13 Dec 2023 19:03:33 +0000 Message-Id: <20231213190338.54146-2-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:03:53 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194596642894390 X-GMAIL-MSGID: 1785194596642894390 SeongJae is using his kernel.org account for DAMON development. Update the old email addresses on the comments of DAMON source files. Signed-off-by: SeongJae Park --- include/linux/damon.h | 2 +- mm/damon/core-test.h | 2 +- mm/damon/core.c | 2 +- mm/damon/dbgfs-test.h | 2 +- mm/damon/dbgfs.c | 2 +- mm/damon/modules-common.c | 2 +- mm/damon/vaddr-test.h | 2 +- mm/damon/vaddr.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 12510d8c51c6..5881e4ac30be 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -2,7 +2,7 @@ /* * DAMON api * - * Author: SeongJae Park + * Author: SeongJae Park */ #ifndef _DAMON_H_ diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 6e5e9502d648..876e398557b0 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -4,7 +4,7 @@ * * Copyright 2019 Amazon.com, Inc. or its affiliates. All rights reserved. * - * Author: SeongJae Park + * Author: SeongJae Park */ #ifdef CONFIG_DAMON_KUNIT_TEST diff --git a/mm/damon/core.c b/mm/damon/core.c index 2c0cc65d041e..36f6f1d21ff0 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -2,7 +2,7 @@ /* * Data Access Monitor * - * Author: SeongJae Park + * Author: SeongJae Park */ #define pr_fmt(fmt) "damon: " fmt diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h index 0bb0d532b159..2d85217f5ba4 100644 --- a/mm/damon/dbgfs-test.h +++ b/mm/damon/dbgfs-test.h @@ -2,7 +2,7 @@ /* * DAMON Debugfs Interface Unit Tests * - * Author: SeongJae Park + * Author: SeongJae Park */ #ifdef CONFIG_DAMON_DBGFS_KUNIT_TEST diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index dc0ea1fc30ca..7dac24e69e3b 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -2,7 +2,7 @@ /* * DAMON Debugfs Interface * - * Author: SeongJae Park + * Author: SeongJae Park */ #define pr_fmt(fmt) "damon-dbgfs: " fmt diff --git a/mm/damon/modules-common.c b/mm/damon/modules-common.c index b2381a8466ec..7cf96574cde7 100644 --- a/mm/damon/modules-common.c +++ b/mm/damon/modules-common.c @@ -2,7 +2,7 @@ /* * Common Primitives for DAMON Modules * - * Author: SeongJae Park + * Author: SeongJae Park */ #include diff --git a/mm/damon/vaddr-test.h b/mm/damon/vaddr-test.h index dcf1ca6b31cc..83626483f82b 100644 --- a/mm/damon/vaddr-test.h +++ b/mm/damon/vaddr-test.h @@ -4,7 +4,7 @@ * * Copyright 2019 Amazon.com, Inc. or its affiliates. All rights reserved. * - * Author: SeongJae Park + * Author: SeongJae Park */ #ifdef CONFIG_DAMON_VADDR_KUNIT_TEST diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index a4d1f63c5b23..a67454b825dc 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -2,7 +2,7 @@ /* * DAMON Primitives for Virtual Address Spaces * - * Author: SeongJae Park + * Author: SeongJae Park */ #define pr_fmt(fmt) "damon-va: " fmt From patchwork Wed Dec 13 19:03:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003391dys; Wed, 13 Dec 2023 11:03:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3gosRtb3xl9u+3XwYvVJyMz0sGh5lYKnaN4VgHZML6kbRshhTpk+PnkliqF3itoRHe1va X-Received: by 2002:a05:6a20:4295:b0:190:38ef:3a57 with SMTP id o21-20020a056a20429500b0019038ef3a57mr11823749pzj.28.1702494239167; Wed, 13 Dec 2023 11:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494239; cv=none; d=google.com; s=arc-20160816; b=xvc4Fosa55jxClnQ4/3EWfhQQUrLuQu41AQgea83Sem4nW192kv+7ICiwdhm7MbvSw oXUUphYvx/hx37Z6cMIqSyhvqLLPlpd9VXuqdzhhXJyf35CytUpi0zMjwJg50D5jSS12 LDNTD4epe4Kxw8D7+k9emIxJ1FnD5sSJDwRuJmssXLE9spoEmEIIujvoGq9EVpUiQBpD fHPs5erXGKeewJkWmhvgaRIYxXtPFTujmAn6qADAm3sDBKrxiH0qYftBrmMuaIWsei4c v4nt+nW5dcX1sPPs47FsuGUa+gs/UhTRNXyUCphAaQTkf5vPbDYW4Ye+MY+mO4ZQd9Gm TnKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DxjDroIjLb/yV0SRilP6CnvUfpB6EMvy8qlj20QciKs=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=XK3X9AIat/28F6lmmDywcmm2cRpmnvSPguyYXSz+J2XhCtJ/O7Tyfg35oO5KpYgOai W7HRfiLm5MZCUMK3bDv3BZmNDLyfrGILyIZ7mbRFxEUok6plN8IAzBW8yTZyE0pPnaUf a2E1Jl4dEZHTugvVGRUHJ8PbgDQ50FBaOPK/IIaniKwQSHeD3a8QWGUKoHKP8mihkXo3 a5Qnr76DvqjaGTTbsf9AucvmUy/dVFeLTMravZxK7xDykexrVskyXFYekO0C2w7YvplG EfQ1QLVb3KixOuu1wYY63ZTJWDzfIXLWyRxJ9g1+dNBNIYPukRXKhjkbkWth8WfYQZFk a+Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gh6j4zF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id k24-20020a6568d8000000b005c66616240bsi9978093pgt.567.2023.12.13.11.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:03:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gh6j4zF8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5FCC08029D01; Wed, 13 Dec 2023 11:03:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441829AbjLMTDp (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379292AbjLMTDm (ORCPT ); Wed, 13 Dec 2023 14:03:42 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9126595 for ; Wed, 13 Dec 2023 11:03:49 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC743C433C8; Wed, 13 Dec 2023 19:03:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494229; bh=gjBQjP/YI+pvMOKNh4ddMdbLJ3KLmfM9HXn1Dp4kPVs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gh6j4zF8l93bobVI7GSErZD+7LyrzAOafaTw/R+gygXqiWV4CRdqWwXQ4WHnfcO5A ntCVTNa3MG2BjUATa9SvAKwQAfINk5MJbH1cQsimTz2xBRm2XyU16JA/pkCDCVZBLM tYqx26QhH06nd6+RI/CnV0NU7hK5ynOAW+Z0EaxqXgVK7aTJLDK+cN15J+KLBe+wGl FPY1GTm8dlM/DZ8CdH2eMVZ9cww7cSXDsMBAbUrukA7Khyyau/bnOZiSGqHIhpwnXk UQuZluFbU+/gS0nN3hGdfFYeZSaojRVgc0zs0RTAEI3p5ZqKWxiCp7cU9I6UkJIWWW PXaXBm0veoOYA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/6] mm/damon/core-test: test max_nr_accesses overflow caused divide-by-zero Date: Wed, 13 Dec 2023 19:03:34 +0000 Message-Id: <20231213190338.54146-3-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:03:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194598938472777 X-GMAIL-MSGID: 1785194598938472777 Commit 35f5d94187a6 ("mm/damon: implement a function for max nr_accesses safe calculation") has fixed an overflow bug that could cause divide-by-zero. Add a kunit test for the bug to ensure similar bugs are not introduced again. Signed-off-by: SeongJae Park --- mm/damon/core-test.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 876e398557b0..0cee634f3544 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -302,6 +302,16 @@ static void damon_test_set_regions(struct kunit *test) damon_destroy_target(t); } +static void damon_test_nr_accesses_to_accesses_bp(struct kunit *test) +{ + struct damon_attrs attrs = { + .sample_interval = 10, + .aggr_interval = ((unsigned long)UINT_MAX + 1) * 10 + }; + + KUNIT_EXPECT_EQ(test, damon_nr_accesses_to_accesses_bp(123, &attrs), 0); +} + static void damon_test_update_monitoring_result(struct kunit *test) { struct damon_attrs old_attrs = { @@ -487,6 +497,7 @@ static struct kunit_case damon_test_cases[] = { KUNIT_CASE(damon_test_split_regions_of), KUNIT_CASE(damon_test_ops_registration), KUNIT_CASE(damon_test_set_regions), + KUNIT_CASE(damon_test_nr_accesses_to_accesses_bp), KUNIT_CASE(damon_test_update_monitoring_result), KUNIT_CASE(damon_test_set_attrs), KUNIT_CASE(damon_test_moving_sum), From patchwork Wed Dec 13 19:03:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003771dys; Wed, 13 Dec 2023 11:04:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgkum0kjiizKspNdAxZnLLfG2ljNvuwiGtSmrZ4Hop1ftND5Fa4vMSU5EOADK1nRDfRaHm X-Received: by 2002:a17:902:ec92:b0:1d0:b013:229 with SMTP id x18-20020a170902ec9200b001d0b0130229mr5462904plg.23.1702494264322; Wed, 13 Dec 2023 11:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494264; cv=none; d=google.com; s=arc-20160816; b=yMiyHCed1OM1yVpovdS2DKR6unEcfd7+H2Hbe5vE16kTDpkTiv7L059rRo3sABF0IF cWmPwWqJ1A7pZOUKb0n6wuKZTbxjpbmYyx72IJNeqayjpnqjmzM6YUoKjntmWDF3/Rt2 h/kNmCsqqvAqRBKmMJBs0QTTl5F7516p8uPigw4wjM3cv5p3Ht5Dfpw5b6t2D2M2ANfA myUJPf4ozn8QB2wJi6j7U4iVwgjhGpy9YD8GjukBZKMu5tQ2XlWCu6FzSMMwEj2isg5A daCjoDFaarGUAeqvye2clXWd52/4ePh7s9tXEVb05Od+y8/WQXTon9gpmxJBG8Kq1Jep ca7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/JpHE1Fbo0I1s3wjHDCA/SuT9Y2KeovIqrYikHaS9VQ=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=KaZ/t0G5a/29XvQaZD+BXl89ldDcQIN1UcQv+Fk1soOu5IzyG7r0qwQVKwEPM30/d/ R5ODBTRdDvuz29i2S9jr7XrBLSY2Pmy4eZGqaVusA7m17mKBVAJzBIg4pLGIzst49VbI Z3PqHYTjD/xdN8FhhZC3u6+v2ntEklbDPHNQIDDyP2tQQmaC9/qQ+IeZYdG8BoXS3SQG YLNCs+wh6dJ7NpjqOtvfr2cPTT8eqwmz4OM7l6pal0y35Dc194iHZAq9cvVEy5isVCjI hHrZpTm0/ar7rCHVLG/bO9NGEBH+1y0u7qDyC3M5debKW3VM0IQyMTcwJJLTNrhh2ooL bUvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hyr+2MY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001cfe02fa89esi9900551plk.117.2023.12.13.11.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hyr+2MY6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 1AEB9826EDBF; Wed, 13 Dec 2023 11:04:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442035AbjLMTDr (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235444AbjLMTDo (ORCPT ); Wed, 13 Dec 2023 14:03:44 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CD1BE3 for ; Wed, 13 Dec 2023 11:03:51 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BFAEC433C9; Wed, 13 Dec 2023 19:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494230; bh=DCzjM8ciFmSW1ZwCtCZzL7l/QtzSRPhWneY+wKj+vU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hyr+2MY6xPiuvWwHsyk6RV0Torov76tR6btlHqK49UggV0nEVIZ7ovqJ6MqiyQoBT GJ6ggkCUIcocYQhX+C89P+Vh9n1X1PnrDZs1fw0/7mW6bDPCgI8S6xipNOcslhVGmf OFrxcOB7yW+r6aoNVwiKd6TxmCRcFJdJN6sC2uhEVPUbFUSqM/8TKyhIA/VF2kSaJM byTvwbOaaFViPxmxVRJISegjpfBKtMo0iUh7T10NR3wVO+1YRpxRMcSv3FINCQEFxC w2Y77OA4sFv5hwpDOHF64Drm8gPpHk4VToAgobXt0zKgYIKbhnxYA9yC2GCMeSeSXg sbt3PYCKBjPoA== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] Docs/mm/damon/design: place execution model and data structures at the beginning Date: Wed, 13 Dec 2023 19:03:35 +0000 Message-Id: <20231213190338.54146-4-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:04:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194625521172883 X-GMAIL-MSGID: 1785194625521172883 The execution model and data structures section at the end of the design document is briefly explaining how DAMON works overall. Knowing that first may help better drawing the overall picture. It may also help better understanding following detailed sections. Move it to the beginning of the document. Signed-off-by: SeongJae Park --- Documentation/mm/damon/design.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 8b4a49ac057d..1bb69524a62e 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -5,6 +5,18 @@ Design ====== +.. _damon_design_execution_model_and_data_structures: + +Execution Model and Data Structures +=================================== + +The monitoring-related information including the monitoring request +specification and DAMON-based operation schemes are stored in a data structure +called DAMON ``context``. DAMON executes each context with a kernel thread +called ``kdamond``. Multiple kdamonds could run in parallel, for different +types of monitoring. + + Overall Architecture ==================== @@ -490,15 +502,3 @@ modules for proactive reclamation and LRU lists manipulation are provided. For more detail, please read the usage documents for those (:doc:`/admin-guide/mm/damon/reclaim` and :doc:`/admin-guide/mm/damon/lru_sort`). - - -.. _damon_design_execution_model_and_data_structures: - -Execution Model and Data Structures -=================================== - -The monitoring-related information including the monitoring request -specification and DAMON-based operation schemes are stored in a data structure -called DAMON ``context``. DAMON executes each context with a kernel thread -called ``kdamond``. Multiple kdamonds could run in parallel, for different -types of monitoring. From patchwork Wed Dec 13 19:03:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003728dys; Wed, 13 Dec 2023 11:04:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IG355P0qweKrREIrcHnwNcTbyE3i6G2XTVLN7+uub+mz6AnwHz6i1YuXfF7+4fYghXm0YFz X-Received: by 2002:a05:6a00:9382:b0:6cd:ecdf:b244 with SMTP id ka2-20020a056a00938200b006cdecdfb244mr5823085pfb.5.1702494261537; Wed, 13 Dec 2023 11:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494261; cv=none; d=google.com; s=arc-20160816; b=z5SvwDkXautRtMc1ozYelYL48rwtcvEg4j0r7779K0A7caig7eSBGMQAkE0dBP6/gd YVBgojRG5uqQsWXml85VzB0fc3CsKTzjPL3QNqmrAlumlMuhnLDkGtvtsQgeb5ZD4ElZ zPf25szErL3dv780C4tQ/aigXA3bAURJ+fM199E3IHQzQDyt/5JL/zSmgiiOm3pZyO5+ 5BWhufKk7WbF4bYbxKJPSquWjwb3JIUpx024tBr7nvfTb8wQFm5I/AZ43W+EP4CZTMDq K9ggGnF3qJQGGaFtuaJx3IEYtORbFa3kAhOkgmpG9Z2WrWTcseLijSs73xiqlfLNmH/Z bY/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tg2uyb7t+PZjG0lQa6RK4Xkz+2cMWFz3xMAwaynfzIY=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=ucF/h5q6e4HT9l1Lepou3yc4w+cFyJzwDYUDBY7fOVzCshSOJKtIprVtFEFBByipa0 hWJ6pvxHg48I3g7onqNxrf0XAGfOwYyL2Idr3H8qb55pbvwIYLdKPbSp6m6b7QzsMKtO 913MA8CTfudGN1O4OC2JaYC0NVJG+xyc4gAyfkJ51hnPwFPZfEguP6JFuabwCgqpn3Ju q2lxYq8HjEIyAFoS1jdCP6AIT6Cc27S0w5mVcb8QTsoeTMtHTzFGt7JKeQRIXXCS5z3m rQIUym86CFVCi3dyperrR6fTubGl5eTxISkRKl5vBg425QDRwarmpaqp79FhPqFhlXlq rybw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e6h4+M4V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q13-20020a056a00088d00b006d08892e9f8si5936722pfj.124.2023.12.13.11.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:04:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=e6h4+M4V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4529A80BC504; Wed, 13 Dec 2023 11:04:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1441827AbjLMTDw (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442025AbjLMTDq (ORCPT ); Wed, 13 Dec 2023 14:03:46 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F5F299 for ; Wed, 13 Dec 2023 11:03:52 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87CDFC433C8; Wed, 13 Dec 2023 19:03:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494232; bh=pWtLPm1/J2Yj2cliVy3Ne0rBNlxUd7IWRzTe9t9tVB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e6h4+M4VC9qAjLnh23mRoTfYMBmcRe7YK9YydYIyZ09VAvI0u25sqAx5wFzEOvglJ bms5Ts/CteG4vueQMg0M8R1KIdBc+qylann1icA1m6XQNV6UlClJgSixwym3Q+/OPS 7hrXEww0BdjszDcObO12DcG5bh8L4kZd9r28ZQfQTwR1RIQSZRhdG1VKUCz0W/Ys2g nz+1I5d/UazRfTgZj0FBz50eg7TgQHkNSyjdp2e0MMuKAeTtxSJF2VfLkeNlzkwk3Y xGJSvQHRdo8ZPUBWZUjiNk4KmGiBYRjv4fZLRTXiDdfShsfeDmQgOn0LCEktym8yFU ZBkifW1LIrDiw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] Docs/admin-guide/mm/damon/usage: update context directory section label Date: Wed, 13 Dec 2023 19:03:36 +0000 Message-Id: <20231213190338.54146-5-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:04:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194622899265539 X-GMAIL-MSGID: 1785194622899265539 The label for context DAMON sysfs directory section is having name sysfs_contexts. The name would be better to be used for the contexts directory. Rename it to represent a single context. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index ff9f62e65722..d3514367703b 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -164,7 +164,7 @@ number (``N``) to the file creates the number of child directories named as details). At the moment, only one context per kdamond is supported, so only ``0`` or ``1`` can be written to the file. -.. _sysfs_contexts: +.. _sysfs_context: contexts// ------------- @@ -288,7 +288,7 @@ The ``action`` file is for setting and getting the scheme's :ref:`action from the file and their meaning are as below. Note that support of each action depends on the running DAMON operations set -:ref:`implementation `. +:ref:`implementation `. - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Supported by ``vaddr`` and ``fvaddr`` operations set. @@ -428,7 +428,7 @@ pages of all memory cgroups except ``/having_care_already``.:: echo N > 1/matching Note that ``anon`` and ``memcg`` filters are currently supported only when -``paddr`` :ref:`implementation ` is being used. +``paddr`` :ref:`implementation ` is being used. Also, memory regions that are filtered out by ``addr`` or ``target`` filters are not counted as the scheme has tried to those, while regions that filtered From patchwork Wed Dec 13 19:03:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003610dys; Wed, 13 Dec 2023 11:04:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2L11ZXajgt44bFMEp3ywXDPBK3fHwZ8QQwQdK71dpXS/BY1sJ8lui+cthtljlS/vbVdc+ X-Received: by 2002:a17:902:d48b:b0:1cf:d0fe:8e51 with SMTP id c11-20020a170902d48b00b001cfd0fe8e51mr9371220plg.29.1702494252366; Wed, 13 Dec 2023 11:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494252; cv=none; d=google.com; s=arc-20160816; b=SSvMWv5GJxzAEMV+GPH0yjP9VKkVQhEMLOcaeuLKmpnCnQwkEi1yxmqQCtNXBk+7HS x0tDbQc3X+emiJZDm5yyVehOgXdIggI/noWujMdb6hE4JG/gKPFKwLLgWyt+I+U3GDv7 up092HzWkUXjcGYZtvlUD7OLKXYRmju9mYOlNHv06qXEbivuS6AnpMhZSdeptcLOLlB2 sFe8KN1E3JuAy1ImJ56AvkroTKoRQZZxe265M1cgfUsQC/u9DBpQj+b6HHzqLQSWN8tf Blrx7GlZSNc/f6eTe9ajCwaD6NEJBoghfshki3YIbAHyTiJDaFFsRVgNGbpD3AJa9HLI D9pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V5H5VveeMnDDzqbWQaVm9TZlhjPnJIl6dXPxA89NsM0=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=ybSltVKu9k823Q/J5NswU63rpUSwqtF/kTfxEH59PE7Zh22qVg/L6FR/A6b5PpbkI6 DZtBDLzCFEJqe2VK5ulViZsSoBPOBvdJuQ4lyPOF21oTQahe+LfKkUc7N3wV/kpqE4bT iq9o8s+qVSS7LxPRCesZqBFSDOdEzcksmhem/i+TzRQ+kCZUzjoGa8Xxj+eScdDTaeJ4 gEcWtBaZKtx3Cf+RycEunJtCyAopycf+p4UwZZIcIEwmJC50Ead4a2VbcTNNG5eBRBHJ hyWbRAeTqPJUZ9brUhypTyJE1db6siVAhDZzkPb5aUWs2sPvC0//Vs21JNKWaaIntpJ8 xlPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F4ZYtp9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l2-20020a170902f68200b001cfd0ddc5absi10069718plg.331.2023.12.13.11.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:04:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F4ZYtp9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3E50580C6DDB; Wed, 13 Dec 2023 11:04:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235475AbjLMTDy (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233811AbjLMTDu (ORCPT ); Wed, 13 Dec 2023 14:03:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB756B0 for ; Wed, 13 Dec 2023 11:03:53 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF17C433CB; Wed, 13 Dec 2023 19:03:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494233; bh=KJAl103OAFoAr+UeUtJKB48jbALa8Ynn0eVxO6I87hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F4ZYtp9e6u1S7vJVoTQuManLwGlrjOeID7BQLcnqFPRmQJPlm0o42k6kIz6uqAfU+ /HE5a9iWB/nCg4QL7ho2iGnYV78Rzv91bOo4uwfG8hwgqoniBuN+bYKp600U99SX/2 z4TYpYXhvBqmr2HXUHooXJ56cx0BIyv65XrswEfh3fot7+WOrwj6Dh0fGrxS/qXJ0d MwDbUOg8Llty3aCoY3Nb/Jb2XinjBJdNkkEJeB7L5Oujli7nQ2ACJPkBYBdVMKlALB XDyzklyW5EI8kshSqnJnQ21yO5J4ZdyD+hN/+Ljd+y7ttdyvcWB2x/pINClxdh92EA KiEA+aTGWd87A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/6] Docs/admin-guide/mm/damon/usage: add links to sysfs files hierarchy Date: Wed, 13 Dec 2023 19:03:37 +0000 Message-Id: <20231213190338.54146-6-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:04:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194613339371750 X-GMAIL-MSGID: 1785194613339371750 'Sysfs Files Hierarchy' section of DAMON usage document shows whole picture of the interface. Then sections for detailed explanation of the files follow. Due to the amount of the files, navigating between the whole picture and the section for specific files sometimes require no subtle amount of scrolling. Add links from the whole picture to the dedicated sections for making the navigation easier. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 70 ++++++++++++++------ 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index d3514367703b..671d3e50b998 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -59,43 +59,47 @@ Files Hierarchy The files hierarchy of DAMON sysfs interface is shown below. In the below figure, parents-children relations are represented with indentations, each directory is having ``/`` suffix, and files in each directory are separated by -comma (","). :: - - /sys/kernel/mm/damon/admin - │ kdamonds/nr_kdamonds - │ │ 0/state,pid - │ │ │ contexts/nr_contexts - │ │ │ │ 0/avail_operations,operations - │ │ │ │ │ monitoring_attrs/ +comma (","). + +.. parsed-literal:: + + :ref:`/sys/kernel/mm/damon `/admin + │ :ref:`kdamonds `/nr_kdamonds + │ │ :ref:`0 `/state,pid + │ │ │ :ref:`contexts `/nr_contexts + │ │ │ │ :ref:`0 `/avail_operations,operations + │ │ │ │ │ :ref:`monitoring_attrs `/ │ │ │ │ │ │ intervals/sample_us,aggr_us,update_us │ │ │ │ │ │ nr_regions/min,max - │ │ │ │ │ targets/nr_targets - │ │ │ │ │ │ 0/pid_target - │ │ │ │ │ │ │ regions/nr_regions - │ │ │ │ │ │ │ │ 0/start,end + │ │ │ │ │ :ref:`targets `/nr_targets + │ │ │ │ │ │ :ref:`0 `/pid_target + │ │ │ │ │ │ │ :ref:`regions `/nr_regions + │ │ │ │ │ │ │ │ :ref:`0 `/start,end │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... - │ │ │ │ │ schemes/nr_schemes - │ │ │ │ │ │ 0/action,apply_interval_us - │ │ │ │ │ │ │ access_pattern/ + │ │ │ │ │ :ref:`schemes `/nr_schemes + │ │ │ │ │ │ :ref:`0 `/action,apply_interval_us + │ │ │ │ │ │ │ :ref:`access_pattern `/ │ │ │ │ │ │ │ │ sz/min,max │ │ │ │ │ │ │ │ nr_accesses/min,max │ │ │ │ │ │ │ │ age/min,max - │ │ │ │ │ │ │ quotas/ms,bytes,reset_interval_ms + │ │ │ │ │ │ │ :ref:`quotas `/ms,bytes,reset_interval_ms │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil - │ │ │ │ │ │ │ │ goals/nr_goals + │ │ │ │ │ │ │ │ :ref:`goals `/nr_goals │ │ │ │ │ │ │ │ │ 0/target_value,current_value - │ │ │ │ │ │ │ watermarks/metric,interval_us,high,mid,low - │ │ │ │ │ │ │ filters/nr_filters + │ │ │ │ │ │ │ :ref:`watermarks `/metric,interval_us,high,mid,low + │ │ │ │ │ │ │ :ref:`filters `/nr_filters │ │ │ │ │ │ │ │ 0/type,matching,memcg_id - │ │ │ │ │ │ │ stats/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds - │ │ │ │ │ │ │ tried_regions/total_bytes + │ │ │ │ │ │ │ :ref:`stats `/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds + │ │ │ │ │ │ │ :ref:`tried_regions `/total_bytes │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age │ │ │ │ │ │ │ │ ... │ │ │ │ │ │ ... │ │ │ │ ... │ │ ... +.. _sysfs_root: + Root ---- @@ -104,6 +108,8 @@ has one directory named ``admin``. The directory contains the files for privileged user space programs' control of DAMON. User space tools or daemons having the root permission could use this directory. +.. _sysfs_kdamonds: + kdamonds/ --------- @@ -154,6 +160,8 @@ If the state is ``on``, reading ``pid`` shows the pid of the kdamond thread. ``contexts`` directory contains files for controlling the monitoring contexts that this kdamond will execute. +.. _sysfs_contexts: + kdamonds//contexts/ ---------------------- @@ -214,6 +222,8 @@ writing to and rading from the files. For more details about the intervals and monitoring regions range, please refer to the Design document (:doc:`/mm/damon/design`). +.. _sysfs_targets: + contexts//targets/ --------------------- @@ -221,6 +231,8 @@ In the beginning, this directory has only one file, ``nr_targets``. Writing a number (``N``) to the file creates the number of child directories named ``0`` to ``N-1``. Each directory represents each monitoring target. +.. _sysfs_target: + targets// ------------ @@ -255,6 +267,8 @@ In the beginning, this directory has only one file, ``nr_regions``. Writing a number (``N``) to the file creates the number of child directories named ``0`` to ``N-1``. Each directory represents each initial monitoring target region. +.. _sysfs_region: + regions// ------------ @@ -265,6 +279,8 @@ region by writing to and reading from the files, respectively. Each region should not overlap with others. ``end`` of directory ``N`` should be equal or smaller than ``start`` of directory ``N+1``. +.. _sysfs_schemes: + contexts//schemes/ --------------------- @@ -276,6 +292,8 @@ In the beginning, this directory has only one file, ``nr_schemes``. Writing a number (``N``) to the file creates the number of child directories named ``0`` to ``N-1``. Each directory represents each DAMON-based operation scheme. +.. _sysfs_scheme: + schemes// ------------ @@ -310,6 +328,8 @@ Note that support of each action depends on the running DAMON operations set The ``apply_interval_us`` file is for setting and getting the scheme's :ref:`apply_interval ` in microseconds. +.. _sysfs_access_pattern: + schemes//access_pattern/ --------------------------- @@ -323,6 +343,8 @@ to and reading from the ``min`` and ``max`` files under ``sz``, ``nr_accesses``, and ``age`` directories, respectively. Note that the ``min`` and the ``max`` form a closed interval. +.. _sysfs_quotas: + schemes//quotas/ ------------------- @@ -369,6 +391,8 @@ metrics for the values. Note that users should write ``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond directory ` to pass the feedback to DAMON. +.. _sysfs_watermarks: + schemes//watermarks/ ----------------------- @@ -388,6 +412,8 @@ as below. The ``interval`` should written in microseconds unit. +.. _sysfs_filters: + schemes//filters/ -------------------- @@ -483,6 +509,8 @@ and query-like efficient data access monitoring results retrievals. For the latter use case, in particular, users can set the ``action`` as ``stat`` and set the ``access pattern`` as their interested pattern that they want to query. +.. _sysfs_schemes_tried_region: + tried_regions// ------------------ From patchwork Wed Dec 13 19:03:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 178263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8003595dys; Wed, 13 Dec 2023 11:04:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlxEaJeeuTRt+siFcXwe7v+3LITZ2tHRGQ3XsvP2mCxGOZu7bthBuhXQ3sLr2T1U3lbM/Y X-Received: by 2002:a17:902:b486:b0:1d0:a36c:3e2e with SMTP id y6-20020a170902b48600b001d0a36c3e2emr3644225plr.61.1702494251505; Wed, 13 Dec 2023 11:04:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702494251; cv=none; d=google.com; s=arc-20160816; b=pe1T6TbYKKdo8W7wsqI+BGxP83DzT91uK6nwlcvAalhxtM73dbydEOcd7ZDAcnisFL 7rHz9QuJPSyWxLypcz8OPiCqXIHbdF24URqTTlqciHaFpuOdUE4BqceT99kTHiwh6Oap VrACIKGt2xlHZhSno7fOEzmFKpKQFuDOARhrtC5XDuohILzEZKQDiNMb3ViUppaOkpH+ cCkxOPoaQFNGBbzDwpuMndxSrCnXIWEIVjqgVlDsKBJ2fdDmojSNGuQqgdmMVOjjtdVW lYJMC5E6laPJVjkPktPxTZp6R1Wt1YQTje0+eAJXp7EAewM5dFZPdIblHRZCMGbOmxIE Beag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z5ZZL030cjbFKJESoqIXvbN6aND0RDo6Xr5J0iXaGuI=; fh=jKijsxc1Z2CHKVFf4S4lB42jMLcn6gTpewOn4Tq1/VM=; b=E7oXai9tqb/tdmsU6MyQ/AtUMaLHogdaeYd1foZviLWP5peBO376JEN7BtUF9GIJ6y EcrGfV5LhryK/ctj4EAwQg58P7y5ILSUhcSP4o32kAwWlRAVBcGYlyKH3B3rwuNb5yLw SR7mF12sz6UqnUBhKchWxsb72TinhUmxDcnhf/rlBWOEpErX2Uyple1Ywz95dFrt3tLb TtDaHjqMajnpGaEzdHYnF7t/9f9Q2id5I6wTtu84OQQHC2GctyTZd2My2/KtYW7ljNAc v5vQszHpdouTOSvstxaX9BmljOcDmP9FoFcd8rVYy6IX4xrUQuFbBfTHrblm0vyAcgqw E/7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CmocNWl3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o18-20020a170902d4d200b001d347c358a9si2139031plg.6.2023.12.13.11.04.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:04:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CmocNWl3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EE349802D23B; Wed, 13 Dec 2023 11:04:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379349AbjLMTD4 (ORCPT + 99 others); Wed, 13 Dec 2023 14:03:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235386AbjLMTDu (ORCPT ); Wed, 13 Dec 2023 14:03:50 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6109BDB for ; Wed, 13 Dec 2023 11:03:55 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70EBAC433C9; Wed, 13 Dec 2023 19:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702494235; bh=kQlCzt4zp30gEmZhugHeoZj6PZuokXzF1ZrH8vPgcLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CmocNWl3Jdc8Dqs1hBubEL4b1RStm9nRj5Jc2Rli1sDWRw7vuP4QcTV6z46jKUSqC PthmZ9WuzR3CbA9bZpzGCeRTfCbZwSNr1Plrlqvrz98vJiLjZ8LWKhUzXpYLrkRidG FviqdxoXZhJhX4hOQNnGgUXBqfppAvzUTy3lwoT0Cl2+v17BHIWFeLyZ9IIoxShOmI Yhem41ybWkVGEKSAmTaYfcsCYXKU6DEklVlGKg5MABzCEaBqfIH9kPymXnu2UAeAs5 Ec8qOrOwG2hnE69hrDDgp8ETY6MQgORm/i6Bkl9B4OtZXYhYgxKev6q87rVzLlB4Mu lfdW8oBINHfEw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] Docs/admin-guide/mm/damon/usage: use a list for 'state' sysfs file input commands Date: Wed, 13 Dec 2023 19:03:38 +0000 Message-Id: <20231213190338.54146-7-sj@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231213190338.54146-1-sj@kernel.org> References: <20231213190338.54146-1-sj@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:04:09 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785194611975668574 X-GMAIL-MSGID: 1785194611975668574 There are eight command inputs for 'state' DAMON sysfs file, and those are verbosely explained in multiple paragraphs. It is not easy to find explanation of specific command, and getting whole picture of supported commands. Replace the paragraphs with a list. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 47 ++++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index 671d3e50b998..9d23144bf985 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -130,30 +130,29 @@ In each kdamond directory, two files (``state`` and ``pid``) and one directory (``contexts``) exist. Reading ``state`` returns ``on`` if the kdamond is currently running, or -``off`` if it is not running. Writing ``on`` or ``off`` makes the kdamond be -in the state. - -Writing ``commit`` to the ``state`` file makes kdamond reads the -user inputs in the sysfs files except ``state`` file again. Writing -``commit_schemes_quota_goals`` to the ``state`` file makes kdamond reads the -DAMON-based operation schemes' :ref:`quota goals ` -of the kdamond. - -Writing ``update_schemes_stats`` to ``state`` file updates the -contents of stats files for each DAMON-based operation scheme of the kdamond. -For details of the stats, please refer to :ref:`stats section -`. - -Writing ``update_schemes_tried_regions`` to ``state`` file updates the -DAMON-based operation scheme action tried regions directory for each -DAMON-based operation scheme of the kdamond. Writing -``update_schemes_tried_bytes`` to ``state`` file updates only -``.../tried_regions/total_bytes`` files. Writing -``clear_schemes_tried_regions`` to ``state`` file clears the DAMON-based -operating scheme action tried regions directory for each DAMON-based operation -scheme of the kdamond. For details of the DAMON-based operation scheme action -tried regions directory, please refer to :ref:`tried_regions section -`. +``off`` if it is not running. + +Users can write below commands for the kdamond to the ``state`` file. + +- ``on``: Start running. +- ``off``: Stop running. +- ``commit``: Read the user inputs in the sysfs files except ``state`` file + again. +- ``commit_schemes_quota_goals``: Read the DAMON-based operation schemes' + :ref:`quota goals `. +- ``update_schemes_stats``: Update the contents of stats files for each + DAMON-based operation scheme of the kdamond. For details of the stats, + please refer to :ref:`stats section `. +- ``update_schemes_tried_regions``: Update the DAMON-based operation scheme + action tried regions directory for each DAMON-based operation scheme of the + kdamond. For details of the DAMON-based operation scheme action tried + regions directory, please refer to + :ref:`tried_regions section `. +- ``update_schemes_tried_bytes``: Update only ``.../tried_regions/total_bytes`` + files. +- ``clear_schemes_tried_regions``: Clear the DAMON-based operating scheme + action tried regions directory for each DAMON-based operation scheme of the + kdamond. If the state is ``on``, reading ``pid`` shows the pid of the kdamond thread.