From patchwork Tue Dec 5 02:28:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13479309 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 E4A0BC4167B for ; Tue, 5 Dec 2023 02:29:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 188756B007D; Mon, 4 Dec 2023 21:29:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 138A66B007E; Mon, 4 Dec 2023 21:29:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 027C96B0080; Mon, 4 Dec 2023 21:29:05 -0500 (EST) 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 E82BC6B007D for ; Mon, 4 Dec 2023 21:29:05 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id ADE80140410 for ; Tue, 5 Dec 2023 02:29:05 +0000 (UTC) X-FDA: 81531182250.11.B5E8AB4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 2B619C000E for ; Tue, 5 Dec 2023 02:29:03 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=czDr4W1j; spf=pass (imf22.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701743344; a=rsa-sha256; cv=none; b=ipFcBUj2zQfaC69ecW+Z5gt0/jZxCMeJ21qZmg5tHArFsYggpp9UrtgL0msAYtNjazemc/ xjsMUZN4eF9MqcVpIJz6Df5vgSGSN6qaUECUZQzpzK10k7bEbdai1rhdWVYLPI8jc2MRVI G8He3ji2dZFLsbDImqOxxFi4YbbLIbw= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=czDr4W1j; spf=pass (imf22.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=1701743344; 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=PrQZKAOIrUCwkEWGi/daGN8QmbcyYwfvjJm7NHr6iDY=; b=BQUvzlcx4l8iX/2gdvCJpmjdHmZ7tJVVw8JQWXGV6/aeiCqlliwpBJeMM76ZMSTAfSGT9g D6FDp/GLIJDStco6NZ2nD/p/5cuN8YRuwH6bLP3bI1leaKGTUJQNoD7LHFMSiKLhR21w0L a/SjzU9o0fqS6mTJgK8gdDbeu/DrDqg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 40B6361477; Tue, 5 Dec 2023 02:29:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E64EC433C8; Tue, 5 Dec 2023 02:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701743342; bh=WXN01WmS/1XYD2UM5/KTAA43TQV3rGLcmc9JJYlY+Zs=; h=From:To:Cc:Subject:Date:From; b=czDr4W1jJnUWy8kd3v9RRDgKXCXocS82Li0EGVZit+a+g8qXwzJK/05JuPU5p59uI mNL2MrdBevaxzcFe9SUk0wJieUBy2sg1eSkmpmOIA0Qc2ZRfkWt35h1cPGlJ69yRzW Sx9+/Cj13S5asDVBKZxroJPRmcx9LxxB2cUxHQvTPTgS3xFmZYnoGexnc7epPeac1S iThTWc/g1gGXleTQnCfBmYbFlU8i2+W1zghE1o3i30AaHfFXLgAEqusK8USGTudlis 8/qlW4IkjWwilJQPhgrS73lm7aOE5DVGzPtJDrSMrCKjSD/X5JpHTufF3EgT47HfKN V0zZDLnwstUVw== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/3] mm/damon: export DAMON symbols and add sample loadable modules Date: Tue, 5 Dec 2023 02:28:55 +0000 Message-Id: <20231205022858.1540-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2B619C000E X-Stat-Signature: wqxrmsacgshgetfx8p8d9uwuaua6hm17 X-Rspam-User: X-HE-Tag: 1701743343-95109 X-HE-Meta: U2FsdGVkX18nO8l9s0J8Jz0pDa0kQ/5mHccRVqsEPV+nfR+U4XwLeWK8Q7bNyPLN9x9AfqxIv3AG8Lg0f7v2e20pdYHCGFOJiPYfuGJFKXSqHIgmOcH0OFFxDoLIYqR1J8RCx5HfaxXlIeXEd0UpH/pQBY4eJuW3Nv2SVqq96PpDLiY7iHoFsiGuhh5t8htCYBRwcWCHf6HTrm63pGc4UHcJASRBwVu2fS6bGOficWb8jINEGi2+5PMGwrWlEC8UUZee2LzHFk+FN2p2a4Y6J0Xyc7aVTbcUcqb9S9JaB8SlIoVT0MBX0pAyczGOBCHrkKG4ZECVjYIL/tVdP2uwoPJQ0QKF9dPYBd7n9zUJFMSq+TaKgI40n0IPqHPPcF75M/dXppKDk3eF5+H/gpCUa3JYrlQF6yc/y5Kr4zT5NxRtOoT3gD8RpOvBkvYKWwxTrQECrHqba6AW0iGni0XSI/BP05HkIwWz1zBkOwY7TfsHkvXkHGowLWBV1MFsObSFk6BBgdj5SeRPg8Bbz8ejbeIhFpjqY/J4GoVjNxH4wncQK76L0AlPBFrfSP3UEqGyQWuqSXAaHn19cNKbjuJWl+fDx7YxU2UB9aUSaFEf/aAEY6S36QptU3muRSwFm57m2VacTu4kTW58tk/VkJpy1UXvq6X5/FY4+SNhYqTkFB6X7SYr5JA8+ysJkfzTLXYYd5EBoPKs8C404Ja1j1TPc5n5Nw8+1PZzCPVec332ogzNcl1mc52spg3oAD5uiz8k58KHb4R44iBL01LdA5oXJDaKFt/bkRhPws4iRc/TjtocDM7zHpxnO7a3LCqX338rQhFHwB4THs2sm3kJsoZbVZbl1Orp3f4NFBytxEu30AFcqwirhK83UxSYhPuqbH79qLUZ6Rh6GNz57jlo2FS26J35eb+5yHAsBPR2s4gytqG2/e+CUSy3/9GgPUB3uFtptZLqcCKkTnUjjhRaPa3 BjgVshL4 TPXZBVArgfgUo3vp64BDGLzxPfwXD9E1PSTtG4XUkNLEeEblvnNZ4u0h44DU+aT1ipz2LJztwTDaM+VRkbTlC+ZSyNYHrJFSxA9BCUV9wE/xiS9FxCZxZQh1wc4jxzCSL4e88tcIDkmzyC8EFVTCRMoxvCbyvLkbHeyQ/iSDz6XPGk6cBKijT3BKiKnY9J0KIaXj+splWEPwiLO2m3WTiXuO/e4fuY5Wca1NdlJRZn8AKOrRB1DuXRw/yxQhZn1ZIf1CZeCzuOXWCAyp0FM4AiMaKSJ2Fnl7cZ3X0j3thAFGSufU= 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: Changes from RFC (https://lore.kernel.org/damon/20231121053604.60798-1-sj@kernel.org/) - Wordsmith commit message - Use GPL v2 for Makefile - Separate patch for each sample module DAMON cannot be used from loadable modules since it is not exporting its symbols. This makes use of DAMON unnecessarily tedious. For example, basic usage of DAMON was presented at kernel summit 2021[1] by writing simple loadable DAMON application modules in live. Because the time was limited (10 minutes) and the coding was to be done step by step, it had to make a downstream commit that exports DAMON symbols. There were users asking why the source code is now not working. It was mainly due to the absence of the symbols export patch on their tree, but also due to the updated DAMON programming interfaces. There were also multiple users requesting support of loadable modules for easier deployment. There's no reason to avoid exporting DAMON symbols. However, it would be better to have concrete use cases of the symbols in the tree together, for better maintenance of the interface and the use cases. The kernels summit 2021's live-coded modules could be used for the purpose. Expose DAMON API modules for supporting the minimum modules and add the kernel summit 2021's modules that updated for latest DAMON API under the samples directory. The sample modules will be keep updated. For exporting more symbols, requesters would be required to merge their modules using the symbols in the tree together, or updsate the sample modules to use the newly-exporting symbols in still simple but reasonable ways. [1] https://linuxplumbersconf.org/event/11/contributions/984/ Signed-off-by: SeongJae Park SeongJae Park (3): mm/damon/core: export symbols for supporting loadable modules samples: add working set size estimation DAMON sample module samples: add proactive reclamation DAMON sample module MAINTAINERS | 1 + mm/damon/core.c | 10 +++ samples/Kconfig | 2 + samples/Makefile | 2 + samples/damon/Kconfig | 30 +++++++++ samples/damon/Makefile | 3 + samples/damon/damon_sample_prcl.c | 102 ++++++++++++++++++++++++++++++ samples/damon/damon_sample_wsse.c | 85 +++++++++++++++++++++++++ 8 files changed, 235 insertions(+) create mode 100644 samples/damon/Kconfig create mode 100644 samples/damon/Makefile create mode 100644 samples/damon/damon_sample_prcl.c create mode 100644 samples/damon/damon_sample_wsse.c base-commit: 7fcebba4a540e4508b923f00a3e9c5e4710f147f