From patchwork Wed Nov 13 16:26:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13873996 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 A3BFCD462D3 for ; Wed, 13 Nov 2024 16:26:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B1F96B0096; Wed, 13 Nov 2024 11:26:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 361A26B009A; Wed, 13 Nov 2024 11:26:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 229736B009D; Wed, 13 Nov 2024 11:26:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 033686B0096 for ; Wed, 13 Nov 2024 11:26:31 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B3AFA140BBE for ; Wed, 13 Nov 2024 16:26:31 +0000 (UTC) X-FDA: 82781597976.27.CBE9051 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 42D8514001F for ; Wed, 13 Nov 2024 16:26:00 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KmP7y63B; spf=pass (imf09.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731515015; 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:references:dkim-signature; bh=9QnupxFYOk+IWzV9kZvzXbFm/7qnZgfwE/QTF46AuiI=; b=XYZdV2IMExjOxSp1R6ozwrqamgcdxqedmJXYqQJlOTyc/OLsy+xGXfz8KF4gQZRbPQejXS Q3hkSkDS9qBuNh4CoI66m+WjaVwRX/G9z8abPq7anxfXqb75mYZ3i8o7CIU2HTYuVyDbbw Fe9IY3a3ModTlEnZgxQ+K20gFC29osE= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KmP7y63B; spf=pass (imf09.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731515015; a=rsa-sha256; cv=none; b=jE6+dpD69KzOZnTmRz2z0XV62BvFG4pyphbjzOhd4yd65j0K9afxVyt6HKe3Zfnp8xIyNl 5GlhObjvdbsWnf+Fqt7hG2T436i1LkhYipMlk5LXPeXT0hklNZNBwGz8c8LvU8VDh5sDz2 nrUHFXTSiXdFJeaG/zTos9CT93m17EA= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CF0375C5787; Wed, 13 Nov 2024 16:25:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD42EC4CEC3; Wed, 13 Nov 2024 16:26:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731515188; bh=lu4afOeyA3gjn2+gU9Vq22h9ysqBc+RxwLwDEiwVRQI=; h=From:To:Cc:Subject:Date:From; b=KmP7y63BBznDTA920Sv39mej0SzXYo58nzeNuX5D91qXDVQMFMBxwGDutuRbgmirL h+8z5TLquoo7MP23Qzh+auw4PNdltxbTzITq1nG+i5rQ1WqxkKsnatuYTWCOyoFShj RUWvnfn7Sx7ggIgYgBtA9wQIpY3TGdWyUYJaI9lt+oQNIdxOVCRcOVrNXVti/JY1hn uBiPv3zl4VLHXe6dbExpECMKZXHuA+4v+fz/PTQKejc5gCa6agDRox4ZrACT2Jz6D+ ER/FYyAzZkM4/W3WdDC4wykyrp5FDNIelTydM/efBMjfXZaYejVaNe7bRjTTV/u3js IP230N8fyu8Xw== From: SeongJae Park To: Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [RFC PATCH 0/5] mm/damon: add sample modules under samples/damon/ Date: Wed, 13 Nov 2024 08:26:19 -0800 Message-Id: <20241113162624.48973-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 42D8514001F X-Stat-Signature: j8azowewzjnk918pgmscx4cmsqaihipf X-Rspam-User: X-HE-Tag: 1731515160-635270 X-HE-Meta: U2FsdGVkX18FZVoCBOt6R4MxAv5kUtuOTFqJu/iVHw24Z23zndSMfnGUCJTlR4oG72eAuDKtHQSGdCZbRW53GNUMe9PROU4I5wKdkb+Z8MtlhRoTlFGf/jD/yJi1dZpC0jiNrLHQW0FBhIiENBhRNpoG9ugKx3C1XzULLOmNUIZZ4eOma9XA9CBj+nuqLSIbhc6sMVSjZbCPFeTNX55aGsx523WVAyqfBr4gYyZjUJPCXqw7nheKyd+PMVHd9PKiA3iFPZWlF42OHYmOaraNDFuSt3V6YhBQfw5A1PjlxQzcpINWTLF7m8rUe3NxjjFkDuguAqVPUgagHKr99mBWV/cPYnzS6AFbBlEhWObLIqMwmGaMi7U3qRgZHPzE9fGiP2KuTC3RkAGtWifhSm0HaVNfzus8DWzAIRJt+L7egJu+Kv2K18LusRmKpgZFhnsJferhqj3kouzMArzkgEyAC17GrTa1bCKBznZH9BXygdmr0F8HGpYoWm07QddTGLo02e5OLV2nDV9iL0oDkOp3EC1TDNoV43mdKgeiUM03jCEl7nRfuG9UApuCa+Ogh7ZKptnSf2vMPOq0EajPB54kXxQqtCI6JRe7nLzfxeFMUuINE61tUHARIH34+u8+x2H+NnRpTVk+Wqy8Lb6xy1stbgR07CIMh4PVLFgzaL+7gZEU8GjfvDWDlTfs5j3QVKh/jgpcj8sA+ICtVAHVoUz0e+nJ7a9WHV6x6eBRfAXduUCZr+5W5/6zznaMxRWtHTy7fAYXkVhX0uKEoxkaUQr/9WY4Z7sv9Eaajwwf2KFOE5lenm7ewWn1azrk7lvL3YiIWX8msq5NN78MNRx0acnqE9x/rw4c5QpDtqQ2re5uu6g5NNJjrJ2CaOEBZ8i7YAbc31LDfXj3pOjcBF7Z6jh4ZAdS8RcOJMieBydEAuKoMTSGb/ltdrsmCrmv3O9DkRHU+Wj9ZEFRNRrcFTFma7l J8FlEvot YapUdhA46GP5pjw9tVCXUXHAuK+bGKdHTMhfAWpD2cG9EgPNG5T8YWP8IhYKWFKMfPPPZuHfUZXRbAJsmlontwpY0UeFJPffxAxZ03HQje3ftL8CC28YMlDw6PfoyqdPzHd90D2KmCRH/tK9jh5L0nzzGW5YG+ZtwlC7dEUN3osGAPJJ26Nr8JXhgaxN7QyGCyZhi+WKkw1UyWPk4upv2cTYc7WnK/3HEtNGzgFTPBoaq/FMiimjWT4m0vigKLOGywsazVjJZrTJSDg8= 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: List-Subscribe: List-Unsubscribe: DAMON is a kernel framework that provides API for other subsystems or modules in the kernel space. The API functions have their own kernel-doc comments, and DAMON modules including DAMON_SYSFS, DAMON_RECLAIM, and DAMON_LRU_SORT can be used as a refernce usages. However, kernel-doc is not very easy for beginner, and the existing DAMON modules for real usage are bit complicated. Add sample DAMON modules showing basic usage of DAMON kernel API. Note that some of the code for similar purpose that I used at kernel summit 2021 DAMON live coding session[1] is reused here. [1] https://linuxplumbersconf.org/event/11/contributions/984/ SeongJae Park (5): samples: introduce a skeleton of a sample DAMON module for working set size estimation samples/damon/wsse: implement DAMON starting and stopping samples/damon/wsse: implement working set size estimation and logging samples/damon: introduce a skeleton of a smaple DAMON module for proactive reclamation samples/damon/prcl: implement schemes setup MAINTAINERS | 1 + samples/Kconfig | 2 + samples/Makefile | 2 + samples/damon/Kconfig | 30 +++++++++ samples/damon/Makefile | 4 ++ samples/damon/prcl.c | 138 +++++++++++++++++++++++++++++++++++++++++ samples/damon/wsse.c | 120 +++++++++++++++++++++++++++++++++++ 7 files changed, 297 insertions(+) create mode 100644 samples/damon/Kconfig create mode 100644 samples/damon/Makefile create mode 100644 samples/damon/prcl.c create mode 100644 samples/damon/wsse.c base-commit: 981cf179b2760af4215419c67a801ec5d028a546