From patchwork Fri Sep 9 20:28:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D304BECAAA1 for ; Fri, 9 Sep 2022 20:29:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D57618D0002; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D05B18D0005; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA6A98D0002; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A6D138D0005 for ; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7C2A41404C2 for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) X-FDA: 79893686376.06.CF999D8 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf21.hostedemail.com (Postfix) with ESMTP id DB5851C008C for ; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 573D8B82656; Fri, 9 Sep 2022 20:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B0CDC433D7; Fri, 9 Sep 2022 20:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755345; bh=hZYNe4incADQflac8QuxFEY25e1dLUMw1HCGMf1nJPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVd46DjfyD5K6T5dIhqM++JmCaEKjX2kucCKjE5XWfr29DaoDkrwaAQaQKKt+eUtY bq//B5BzvLiLtyLZGF5vHQgZiExTcIhRv58oQgZC2yRQs1OcumuX42jf1i5z8+QRUt ekSTZdZnTDrgbjkROJ/FB2TMCCcltd7gnqK30X4xrW5tgUu3wJAMaIBCpPGgutdulR SnJUHsMB2E42d/TEFyxDks146Swk7bfDgYxvTZs5WUvkZTLce3SMWVaVBCKy2IovSn xL+4MKKQrzpSFuWuSgWC3DQXNxKUOgLwQRLQVKB8T8PCwnK2g1KwrrYZxrX5PDYsxX 4TZR0hmKuiW7Q== From: SeongJae Park To: Andrew Morton Cc: Shuah Khan , linux-kernel@vger.kernel.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, SeongJae Park Subject: [PATCH 1/7] selftest/damon: add a test for duplicate context dirs creation Date: Fri, 9 Sep 2022 20:28:55 +0000 Message-Id: <20220909202901.57977-2-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755348; a=rsa-sha256; cv=none; b=QxUgHe9te2iQJHinTe916rzztpsjMRK9w3rkMfIg2CIqDAFblTD6NobDFADWvOTsias141 AzeP8Xj5B1TxNw6chSpvtZZb9PEaHkdRCJ6+tHKPLFglZ6JZ2Fakqzbka/y9juk57INMAo ZmrgIw+gxzoD/5HRlXX+NgilXKGv2uo= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HVd46Djf; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755348; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DfuierM8GuMai/NRfsu23h5rJ7+Qgmg5FCbC6IHXuUg=; b=Eu9RVSKxcTkZi9V67UE2Tqaul8hkXfuJu0GiFqdDGmdiqSO3aLw5IAAtNjuo0nlU0RCzvo QHX22flzw4QwyNBfX82EmvYwkYdtVub6F/poKKZxkuMPlb0Eq2XUKaBWHsOKqeExncO+R6 L+IGJD3XkXoydmSc1HHL2MlFv+aKIFk= Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=HVd46Djf; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-Stat-Signature: y7y7k9b1ty6mprmxrp84cemdr5hwti5n X-Rspamd-Queue-Id: DB5851C008C X-Rspamd-Server: rspam01 X-HE-Tag: 1662755347-5644 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000067, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit d26f60703606 ("mm/damon/dbgfs: avoid duplicate context directory creation") fixes a bug which could result in memory leak and DAMON disablement. This commit adds a selftest for verifying the fix and avoid regression. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/Makefile | 1 + .../debugfs_duplicate_context_creation.sh | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile index 0470c5f3e690..a1fa2eff8192 100644 --- a/tools/testing/selftests/damon/Makefile +++ b/tools/testing/selftests/damon/Makefile @@ -6,6 +6,7 @@ TEST_GEN_FILES += huge_count_read_write TEST_FILES = _chk_dependency.sh _debugfs_common.sh TEST_PROGS = debugfs_attrs.sh debugfs_schemes.sh debugfs_target_ids.sh TEST_PROGS += debugfs_empty_targets.sh debugfs_huge_count_read_write.sh +TEST_PROGS += debugfs_duplicate_context_creation.sh TEST_PROGS += sysfs.sh include ../lib.mk diff --git a/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh b/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh new file mode 100644 index 000000000000..4a76e37ef16b --- /dev/null +++ b/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +source _debugfs_common.sh + +# Test duplicated context creation +# ================================ + +if ! echo foo > "$DBGFS/mk_contexts" +then + echo "context creation failed" + exit 1 +fi + +if echo foo > "$DBGFS/mk_contexts" +then + echo "duplicate context creation success" + exit 1 +fi + +if ! echo foo > "$DBGFS/rm_contexts" +then + echo "context deletion failed" + exit 1 +fi + +exit 0 From patchwork Fri Sep 9 20:28:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A18BECAAD5 for ; Fri, 9 Sep 2022 20:29:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31D778D0005; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CDF58D0006; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1978C8D0005; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EE5DF8D0006 for ; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B6AA8AAF99 for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) X-FDA: 79893686376.05.43CE901 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf04.hostedemail.com (Postfix) with ESMTP id 481B54007B for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F2468B82658; Fri, 9 Sep 2022 20:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 369FEC43470; Fri, 9 Sep 2022 20:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755345; bh=OVGs4WGaZlHSNw1bV9aTKJG9y36ZzMQPGlZGZcjins0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ip+V2dwR7+a6tDS2JAnQCwO5rJFAyowrX5+FfGIBNIsTYot/Veb/nwDlEqmeNtUQs nEMBGWe6pqrJyEb8Hs+MdAFA+I5oFdJNB36NlBpZC0nkTMOd21lG8iO2Ra4ypuPpjQ 4W5dX/F5GI0AkFryiAkYJKkQO8JIV3lB45w4lT7jL47LAAaPIRzynMz6uwU45Bh+XZ E5o5BI4Lyarzt66Xj/yFuiQb9R8RZ3h4J+c8G2gc9WN4gZbF7NICi52SH5OVqMv0in TH9MrIoz+J6fNJe93GTJ17U6HxX04QkESr522tdExGQL28caqt3vzzSA3ojYrHEmu/ K2etw9lz6iwkg== From: SeongJae Park To: SeongJae Park , Andrew Morton Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yun Levi Subject: [PATCH 2/7] mm/damon/core: avoid holes in newly set monitoring target ranges Date: Fri, 9 Sep 2022 20:28:56 +0000 Message-Id: <20220909202901.57977-3-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755348; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=PHG3tseMODOqgX44qZm0G5El+SJLZ2NP77K3XscEj4I=; b=r+YU79Sy9DD+hW6ObXE0Zq5/lYrBvv3oVos9NPuENDHJoAzsyGbBK5sdBOcN83eWAZgZLO BaIVwzH6HYv+W1Cs8F/8HvcQUWhiVyUvCaLxXKB6S76+LAQ0c8QoCkVhBQzd+O3q/fLgwP hjNCXKW8SKaDeoRdTSWLBIP1pyLNU9U= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ip+V2dwR; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755348; a=rsa-sha256; cv=none; b=6Sd16KG2XiF9QZelF3DWkSquM+wSTnDtZtiFG6r/tQLfVB9GFU6JZ6Enm5oh5hVCH8d67I hPgu4XN6HDLs2mqlx5YUzah5uz+aw+7yVs4pQZ2gVIS00aU25lg5KJsI1QT8zl9NCKL4Pr 3Q2abXpe3OACEivb0sPeZDD7QuhnvUo= X-Rspam-User: X-Stat-Signature: 9gupx8skj5c8tgpp3qe6gzx44agy779e X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 481B54007B Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ip+V2dwR; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1662755348-241480 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When there are two or more non-contiguous regions intersecting with given new ranges, 'damon_set_regions()' does not fill the holes. This commit makes the function to fill the holes with newly created regions. Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces") Reported-by: Yun Levi Signed-off-by: SeongJae Park --- mm/damon/core.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index bae41990f422..6f6c9c9aca9d 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -168,6 +168,27 @@ static bool damon_intersect(struct damon_region *r, return !(r->ar.end <= re->start || re->end <= r->ar.start); } +/* + * Fill holes in regions with new regions. + */ +static void damon_fill_regions_holes(struct damon_region *first, + struct damon_region *last, struct damon_target *t) +{ + struct damon_region *r = first; + + damon_for_each_region_from(r, t) { + struct damon_region *next, *newr; + + if (r == last) + break; + next = damon_next_region(r); + if (r->ar.end != next->ar.start) { + newr = damon_new_region(r->ar.end, next->ar.start); + damon_insert_region(newr, r, next, t); + } + } +} + /* * damon_set_regions() - Set regions of a target for given address ranges. * @t: the given target. @@ -226,6 +247,9 @@ int damon_set_regions(struct damon_target *t, struct damon_addr_range *ranges, first->ar.start = ALIGN_DOWN(range->start, DAMON_MIN_REGION); last->ar.end = ALIGN(range->end, DAMON_MIN_REGION); + + /* fill possible holes in the range */ + damon_fill_regions_holes(first, last, t); } } return 0; From patchwork Fri Sep 9 20:28:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 015A8ECAAD3 for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89C178D0003; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84B318D0002; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73A428D0003; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 608108D0002 for ; Fri, 9 Sep 2022 16:29:08 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 29BC2A03DD for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) X-FDA: 79893686376.24.6AE3BDB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id C7271C00AA for ; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D18B062031; Fri, 9 Sep 2022 20:29:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8795C43140; Fri, 9 Sep 2022 20:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755346; bh=sDNPmkLNtbffCB7yBaG1vDK4L/fqo+2nXKmiK+SjhXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eA7mXHTj8CAzo/dRgZSWiewM44BtCMTaJAUI9iyDT9w6sOiNgjuaUS2ZfVGYovW7E 9k6WBRLbxhAiHv9bHVh/qo5r0lg4YESkE3zkAK7pzw+NywcHTJEMEqgrfERvlidZ0A LPIMksQdov+1IBnQnEiQIzijc8XrHiowTTfHfasQbD/gd74RFUHCtEMutN29RSDhao TPg8Du/HzkL4FuSyu7EasSyO8eaEUBMaBnLUnVGpfDTL0EJIH7gftvsq+SJoAd30Eh 9/HCo1PD50vk1Cgy09CIiTs6Rh5mNuxmqIgbYOvkf/X4aEuXCLI+uc90DVpznw4k9Z 5cToMONkW4Gzw== From: SeongJae Park To: Andrew Morton Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 3/7] mm/damon/core-test: test damon_set_regions Date: Fri, 9 Sep 2022 20:28:57 +0000 Message-Id: <20220909202901.57977-4-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755347; a=rsa-sha256; cv=none; b=kESzi2M1KjXAyWESN0QtQpgcYH+ktKjHMra8Xk7ZdU4xSuU2KrydlRQHPVKRplas9ZY8kW NJCTpIB2HEr6cqpjkR5FTvoWyu0OTDkKzQymw+Omsk8AboWVMiCX7qISPB3Adb9PR3K7W0 gfsGFSUitUTtyt0yjO8OrgTqwQIIsiI= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eA7mXHTj; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755347; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KnSLIbchjvCYXR8yRecYEOIGYLhUlIpdciGflEDlDrM=; b=blcb3zU6KwKg9bXE46eJbuWLjWtzsBIPhWbwWCM+d2a2GJRVTZ0fUtaCwF5JqwC/pw0E1q dIwulS6SxqSOHl54nHP3QvcOZ2XAC92tKyGs+k8SF7Hfxw2+iUs+76FI8sluaz6sZuTA56 3hLRbow+LKxj6KSrQKKoecjLmVzTcCw= Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eA7mXHTj; spf=pass (imf28.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-Stat-Signature: 89nmfqyixrngspm1t4agungimz34fswu X-Rspamd-Queue-Id: C7271C00AA X-Rspamd-Server: rspam01 X-HE-Tag: 1662755347-428009 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Preceding commit fixes a bug in 'damon_set_regions()', which allows holes in the new monitoring target ranges. This commit adds a kunit test case for the problem to avoid any regression. Signed-off-by: SeongJae Park --- mm/damon/core-test.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 45db79d28fdc..3db9b7368756 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -267,6 +267,28 @@ static void damon_test_ops_registration(struct kunit *test) KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), -EINVAL); } +static void damon_test_set_regions(struct kunit *test) +{ + struct damon_target *t = damon_new_target(); + struct damon_region *r1 = damon_new_region(4, 16); + struct damon_region *r2 = damon_new_region(24, 32); + struct damon_addr_range range = {.start = 8, .end = 28}; + unsigned long expects[] = {8, 16, 16, 24, 24, 28}; + int expect_idx = 0; + struct damon_region *r; + + damon_add_region(r1, t); + damon_add_region(r2, t); + damon_set_regions(t, &range, 1); + + KUNIT_EXPECT_EQ(test, damon_nr_regions(t), 3); + damon_for_each_region(r, t) { + KUNIT_EXPECT_EQ(test, r->ar.start, expects[expect_idx++]); + KUNIT_EXPECT_EQ(test, r->ar.end, expects[expect_idx++]); + } + damon_destroy_target(t); +} + static struct kunit_case damon_test_cases[] = { KUNIT_CASE(damon_test_target), KUNIT_CASE(damon_test_regions), @@ -276,6 +298,7 @@ static struct kunit_case damon_test_cases[] = { KUNIT_CASE(damon_test_merge_regions_of), KUNIT_CASE(damon_test_split_regions_of), KUNIT_CASE(damon_test_ops_registration), + KUNIT_CASE(damon_test_set_regions), {}, }; From patchwork Fri Sep 9 20:28:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85E43ECAAA1 for ; Fri, 9 Sep 2022 20:29:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAB118D0008; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B0C118D0006; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8EA068D0008; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 673DD8D0006 for ; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2741CC04CF for ; Fri, 9 Sep 2022 20:29:09 +0000 (UTC) X-FDA: 79893686418.16.1EBC734 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf29.hostedemail.com (Postfix) with ESMTP id BC2731200BC for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4EDD1B82655; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7546BC43144; Fri, 9 Sep 2022 20:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755347; bh=+JPntM3lX5pH/5fi2+GQ8i2rNQKTll5DPTLZEASzM9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nWHwek/Szye5DMLzBFmaPxtUn4ezlwepsaKQUmZykk41j2zyTUWB/FJwtO72P6mbZ CFs/U2+NGnBAR+Eet5xyVkWza3COoCYw6TgIT4ZpjNYkW0tbAbQShh1Hoy59TkM2++ /LDNn5T/aqtQwujshahWDYnQAvf76wneXL3UNoKSDqfutw5k74Sge3jy9ii3auJl/4 VYHk/MrYQm0cqRzS9vrog33f3RWb5p+wlC48z3BhkJHH0c5W+Y3T5ksuyjrjsuF6Uu 4ngGdeMzEI1QBrRYKKjxLbS/8dWrU3k0AqJf+N/L/uBZFc8oYqkQkZhGLfKQADaQKP m+Y65rnv1CMqA== From: SeongJae Park To: Andrew Morton Cc: Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 4/7] Docs/admin-guide/mm/damon: rename the title of the document Date: Fri, 9 Sep 2022 20:28:58 +0000 Message-Id: <20220909202901.57977-5-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755348; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jpvYKhskzVXbweRJstEDRf1Fqk9uVxX+tzSVo9wvEBc=; b=Uz5337+jJKHe5dID5hV7NuOWyfOeJfo96F02Qi25u9rWHO2joTrkkOvowoE8kYrRa68sbx h56/eWDFH+roI2reYPziCR9cP74HztFKf9VaEQY1XAXit9kGnJW5U5TIBQ/ThjjtDpU256 ow42D4S+BjezR0uYPzAUQcWqoKchMws= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nWHwek/S"; spf=pass (imf29.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755348; a=rsa-sha256; cv=none; b=QJkFyqGn3tmAO01ozk/1cU8kc0Xjf/knKOH4nJrO8+sa0Zzva436Qjel/hLxXzCflXmFtz ptFHxhd8hwf9M2pmRKKZ8Qyg/wClr6MDL64ofhLN9lqE+O5iNIbTfEpl2iayK1xQTtgiwH UGCexPu+tSJ/pKL0THrRVusQpvG9Af4= X-Rspam-User: X-Stat-Signature: e6otunopmchiigzkq3aqehd41smea6fx X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: BC2731200BC Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="nWHwek/S"; spf=pass (imf29.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1662755348-77512 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000031, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The title of the DAMON document for admin-guide, 'Monitoring Data Accesses', could confuse readers in some ways. First of all, DAMON is not the only single way for data access monitoring. And the document is for not only the data access monitoring but also data access pattern based memory management optimizations (DAMOS). This commit updates the title to 'DAMON: Data Access MONitor', which more explicitly explains what the document describes. Fixes: c4ba6014aec3 ("Documentation: add documents for DAMON") Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/index.rst b/Documentation/admin-guide/mm/damon/index.rst index 05500042f777..33d37bb2fb4e 100644 --- a/Documentation/admin-guide/mm/damon/index.rst +++ b/Documentation/admin-guide/mm/damon/index.rst @@ -1,8 +1,8 @@ .. SPDX-License-Identifier: GPL-2.0 -======================== -Monitoring Data Accesses -======================== +========================== +DAMON: Data Access MONitor +========================== :doc:`DAMON ` allows light-weight data access monitoring. Using DAMON, users can analyze the memory access patterns of their systems and From patchwork Fri Sep 9 20:28:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972162 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D77ECECAAD3 for ; Fri, 9 Sep 2022 20:29:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 128C48D0009; Fri, 9 Sep 2022 16:29:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB4E58D0006; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAA928D0007; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 840E18D0007 for ; Fri, 9 Sep 2022 16:29:09 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5401C80501 for ; Fri, 9 Sep 2022 20:29:09 +0000 (UTC) X-FDA: 79893686418.10.A5935E9 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf27.hostedemail.com (Postfix) with ESMTP id ECBE1400D4 for ; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DD9DDB8265A; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 305CCC433D6; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755347; bh=IVI0uztyLdqiIcGkJ6QAz29p+51cm+1zAFG0uPXs980=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgCf8HHYz+Mue5wkrTQp6HPSQvKWiS/WVzqdQZ76t+jXZZ+M0gL9R8qffIzGMLUW4 92RFwyduoEUZ0+aR+LCs+MpVfSZEnThVH9Vlw3KufEnPHRUeRwEasfpxjMHsbwy/pP hpSsNN8qLbSWViLgcBT4yBxnERNoRJozW708Q61kRTx/30Y2q6e7ZyeYNN+dl50gFS Wc1v3CwpWYo8TzfSgsV6ufZ24ffJBOuHYMRPDjoiOWIdd2hTjPbeDDHBwuTlzVLPpn pCHcYxQv96BEUtIo3sb1X9+DK2VOPkwbJEOrNXsEgGWixbdDw4bmv4P30J5xYxE7L6 v3zLn5MuGGngA== From: SeongJae Park To: Andrew Morton Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 5/7] mm/damon/Kconfig: Notify debugfs deprecation plan Date: Fri, 9 Sep 2022 20:28:59 +0000 Message-Id: <20220909202901.57977-6-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cgCf8HHY; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755349; a=rsa-sha256; cv=none; b=pZHmakoRUqhzHaW4J49irgiZHC55HhopxpKJo+1wG5BnjcNcTCw2TVJxbT8MdKdYffEXFV kCqLH6Ht7pbWiWp1Ng35ndasyKGQJ4ZZ3LXPADwo6wQ6c8PadDZUnSSFZA43yekbKivPry ++Mo6q+67aQn+llAVjjzJZEMSq+TbOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755349; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jUYy1R2hN8pnOsEZtmXb2Xz+G0dem17annSgWvAXzmA=; b=gZUumZl//gSc/3JDIl7enHHXWgc3jBtV9LXjlgoYqjDnrDoKb1XF1KfLVye/DFiMtdfzBP +mu8coBl3ZHyZRhhh07GRRGyLAv22+4DqIm+QBUNXcbJObfFcHq2pOqEExqIEh+AfzoXmG 61xIdzU47MkdBB5otnfcNBYsL6r1Wd4= X-Stat-Signature: 5gbb4smqj1wdnywbgkyk4j8e78nhqxn1 X-Rspam-User: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=cgCf8HHY; spf=pass (imf27.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: ECBE1400D4 X-HE-Tag: 1662755348-461526 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface") announced the DAMON debugfs interface deprecation plan, but it is not so aggressively announced. As the deprecation time is coming, this commit makes the announce more easy to be found by adding the note to the config menu of DAMON debugfs interface. Signed-off-by: SeongJae Park --- mm/damon/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig index 66265e3a9c65..7821fcb3f258 100644 --- a/mm/damon/Kconfig +++ b/mm/damon/Kconfig @@ -68,6 +68,9 @@ config DAMON_DBGFS If unsure, say N. + This will be removed after >5.15.y LTS kernel is released, so users + should move to the sysfs interface (DAMON_SYSFS). + config DAMON_DBGFS_KUNIT_TEST bool "Test for damon debugfs interface" if !KUNIT_ALL_TESTS depends on DAMON_DBGFS && KUNIT=y From patchwork Fri Sep 9 20:29:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972165 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7A22ECAAA1 for ; Fri, 9 Sep 2022 20:29:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB62D8D000B; Fri, 9 Sep 2022 16:29:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E19638D0006; Fri, 9 Sep 2022 16:29:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C45CA8D000B; Fri, 9 Sep 2022 16:29:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A18308D0006 for ; Fri, 9 Sep 2022 16:29:13 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 74992AB15E for ; Fri, 9 Sep 2022 20:29:13 +0000 (UTC) X-FDA: 79893686586.10.DBFDBEF Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf15.hostedemail.com (Postfix) with ESMTP id F16E2A0081 for ; Fri, 9 Sep 2022 20:29:12 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 6DDEBCE249F; Fri, 9 Sep 2022 20:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C003BC433D7; Fri, 9 Sep 2022 20:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755348; bh=ayER6vHBJnsSeDv1Q+T6kbhfCJxElLtfrCsQPcSQvis=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iD8DOEQkHEPiFguPg2q2x1CH6DC+RWF5kt118ZFZ19ZF4+PcPl1PZdCkNz1H836qo B9Ngi6ACuVnbW2X62N2XmVeBamhhZDEjBZKnSqH9eRwt6Pbresu8Xr/emgRLfkZbXS sjMeqfVlkvRdGqK/k7w/F/gLOXxUgDshpjv5kqbZmZDJsumay8YY0z++Q3dEHX/8yZ QmpPzlktA4HvMvZK6PQKZHP/SzezYwxCMVUD+/TIEBK0TGZ65EG1v2tMJGd4YMIa7k DbYfQT+uVbA0nwnW8nY0ED5RBOKJPbTpRsPbgBPu+pSqHQ/fIcHpZY2e7Kj5qHCkB8 Bh8DuuDPtC8QQ== From: SeongJae Park To: Andrew Morton Cc: Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 6/7] Docs/admin-guide/mm/damon/start: mention the dependency as sysfs instead of debugfs Date: Fri, 9 Sep 2022 20:29:00 +0000 Message-Id: <20220909202901.57977-7-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755353; a=rsa-sha256; cv=none; b=KVWt6oHHlplvhhChXdC90BcdCFlyiykTVDBLXxHJOmZ68rn5XFkCYQg03REjlR+Dtql789 TjHzvmoAZ4zSReLaVpWvdseptjH75J7hnLKh7rje3SZVFFrUcDTIc+C15sKoiFFYAo1N67 MBV1edfOnUzVW2dyKJUeWIcNMdR8oXc= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iD8DOEQk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755353; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Yf3ELlUirxl9CMhzK5MiW/ogxWaiHKcRWZUDjUzIu+U=; b=RUr+35njLX8sj6e/lOholw6qrD8stTXDE1Ih2EDrXZQwOSdp90lxB5B69nQp3mZeNKRRJ9 7LTz8QSapx1A/c0pGEeNZt4gPm7Cwj0qW9tajYzq0zR15+2HGvhpq3JqCL87dNOuX5xnPE ckglHv6yWVFEB3UKQrXIvuHzTavMxZI= Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iD8DOEQk; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org X-Rspam-User: X-Rspamd-Server: rspam10 X-Stat-Signature: coxbdpaprt1j6bfohzctk6stghsh599r X-Rspamd-Queue-Id: F16E2A0081 X-HE-Tag: 1662755352-466990 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 'Getting Started' document of DAMON says DAMON user-space tool, damo[1], is using DAMON debugfs interface, and therefore it needs to ensure debugfs is mounted. However, the latest version of the tool is using DAMON sysfs interface. Moreover, DAMON debugfs interface is going to be deprecated as announced by commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface"). This commit therefore update the document to tell readers about DAMON sysfs interface dependency instead and never mention about debugfs interface, which will be deprecated. [1] https://github.com/awslabs/damo Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/start.rst | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/mm/damon/start.rst b/Documentation/admin-guide/mm/damon/start.rst index 4d5ca2c46288..9f88afc734da 100644 --- a/Documentation/admin-guide/mm/damon/start.rst +++ b/Documentation/admin-guide/mm/damon/start.rst @@ -29,16 +29,9 @@ called DAMON Operator (DAMO). It is available at https://github.com/awslabs/damo. The examples below assume that ``damo`` is on your ``$PATH``. It's not mandatory, though. -Because DAMO is using the debugfs interface (refer to :doc:`usage` for the -detail) of DAMON, you should ensure debugfs is mounted. Mount it manually as -below:: - - # mount -t debugfs none /sys/kernel/debug/ - -or append the following line to your ``/etc/fstab`` file so that your system -can automatically mount debugfs upon booting:: - - debugfs /sys/kernel/debug debugfs defaults 0 0 +Because DAMO is using the sysfs interface (refer to :doc:`usage` for the +detail) of DAMON, you should ensure :doc:`sysfs ` is +mounted. Recording Data Access Patterns From patchwork Fri Sep 9 20:29:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12972164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87674ECAAD3 for ; Fri, 9 Sep 2022 20:29:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ABF48D000A; Fri, 9 Sep 2022 16:29:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1988D8D0006; Fri, 9 Sep 2022 16:29:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F04338D000A; Fri, 9 Sep 2022 16:29:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D30F48D0006 for ; Fri, 9 Sep 2022 16:29:11 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 92663A0192 for ; Fri, 9 Sep 2022 20:29:11 +0000 (UTC) X-FDA: 79893686502.06.3B7A5A6 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf16.hostedemail.com (Postfix) with ESMTP id 42DC618007F for ; Fri, 9 Sep 2022 20:29:11 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 36662B82625; Fri, 9 Sep 2022 20:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D210C433B5; Fri, 9 Sep 2022 20:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662755349; bh=c/LlClDFkomglVBmI+e/AfXU1bu10Srp2u/iwk3ayRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SKFDbBEJPpu9o71DSKWucKzDnYfHJ46Mw5IuVdh4sib1buz9UJZY9VFsxJ9TmVpfv 9W/+Ijx7nGgKZJYWkUigQUJIrgiiN6YW3+QP0VMvmtRG51ij1jf7yZXr/pUZmMfx4M xhsfQSlc4wwOZgOdr+5LGwolssAveCxQEMewgp4SDM2BDeNZwTt6j0gMzDBshvizuS P+r19tASMND//x7KTOpqkILncHfSczF9fgmPJYoBKilS+v0bQZmQZFdVbi8ZaYuShk 3O/2RBFW1U8gxrYkeQgi2GKm+FEvYQCcmWMRPv95JPuYMqkiKwjGg+5UYoUMAd3mZ+ bqCHFxBWTgHhA== From: SeongJae Park To: Andrew Morton Cc: Jonathan Corbet , damon@lists.linux.dev, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 7/7] Docs/admin-guide/mm/damon/usage: note DAMON debugfs interface deprecation plan Date: Fri, 9 Sep 2022 20:29:01 +0000 Message-Id: <20220909202901.57977-8-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220909202901.57977-1-sj@kernel.org> References: <20220909202901.57977-1-sj@kernel.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662755351; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OYPzfT0QJ/GdRwXTLcfFBZJCnION2w+GXurqsUeBPog=; b=w3rTD7kzPh7ghoQcTzHgACO7V2nli+av1ZRko1Q3au36G2XBnF76aQm8Gz3BZ3Tpxtt93G t0dydaZz+2MzPwl20RI+3glJyTwN2p4/EeR95PHUN4dnJQ8sRMpC7AQ9MR9gRHMNgII/Xh +07dSaZe08b7uDPYc/7y600kMoAp660= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SKFDbBEJ; spf=pass (imf16.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662755351; a=rsa-sha256; cv=none; b=qjQQLLkShnNbVV/Zoj2VcViGpMDq5w4PWARhUqcf7ql6OjdEQg/jKNIJsoQHIk0EtiPRCL HJQI8dESza0uvLWZBtaSI4zMScUReM833blJdA8m9hggU7+NZsXG6PujT+ydjsVwLVVXz+ wDU08KIFUjYwsPrEw9FHqkp1KHh1z7Q= X-Rspam-User: Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SKFDbBEJ; spf=pass (imf16.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam06 X-Stat-Signature: 96dj66g1iomu8gum897hsm9oajm99f6p X-Rspamd-Queue-Id: 42DC618007F X-HE-Tag: 1662755351-684212 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit b18402726bd1 ("Docs/admin-guide/mm/damon/usage: document DAMON sysfs interface") announced the DAMON debugfs interface deprecation plan, but it is not so aggressively announced. As the deprecation time is coming, this commit makes the announce more easy to be found by adding the note at the beginning of the DAMON debugfs interface usage document. Signed-off-by: SeongJae Park --- Documentation/admin-guide/mm/damon/usage.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst index d52f572a9029..c050b882ddc1 100644 --- a/Documentation/admin-guide/mm/damon/usage.rst +++ b/Documentation/admin-guide/mm/damon/usage.rst @@ -393,6 +393,11 @@ the files as above. Above is only for an example. debugfs Interface ================= +.. note:: + + DAMON debugfs interface will be removed after next LTS kernel is released, so + users should move to the :ref:`sysfs interface `. + DAMON exports eight files, ``attrs``, ``target_ids``, ``init_regions``, ``schemes``, ``monitor_on``, ``kdamond_pid``, ``mk_contexts`` and ``rm_contexts`` under its debugfs directory, ``/damon/``.