From mboxrd@z Thu Jan 1 00:00:00 1970 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 C7E3CC7EE39 for ; Sun, 29 Jun 2025 20:14:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B99276B0098; Sun, 29 Jun 2025 16:14:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B22976B0099; Sun, 29 Jun 2025 16:14:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 974116B009A; Sun, 29 Jun 2025 16:14:51 -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 879046B0098 for ; Sun, 29 Jun 2025 16:14:51 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 21CB416025B for ; Sun, 29 Jun 2025 20:14:51 +0000 (UTC) X-FDA: 83609541582.19.FD0BE82 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 87F5AC0009 for ; Sun, 29 Jun 2025 20:14:49 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=th3ve3rG; 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=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751228089; 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=EVZMDzHvXpzu1AQIZnH58/VF6gGeTAK27FXdd5XGonk=; b=h89mYYDeHnw0VWuaCrHaf2TCLUXLK5FDwcHTmO598g9pkECZ7c9lQLcPWkb3ESLz9hCRku FHvBlnk3JHTfuTdfH+/QkFxmgTOIXmGSHcNAhR7GDWNwH0RdwzU/kNpDMpIsiWhbGh4TIr ls+/yh6Cl8zD/0w8/Nuqh6b4QQxVBEE= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=th3ve3rG; 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=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1751228089; a=rsa-sha256; cv=none; b=MU6exg1rOu34/Xfdc+PuXgspEqd6XRkOk+1ci15M8s3AKHMUx6WV/6sCQenSNXU12Sg9Vg qhKBp3Idyqp8GLSyLkafSp4tcSZ+VBgwU+qeT1WKaRP3N/1wUi7lMk2qHhgipLP3+AovJo iWDatzB30uhaeTmz1EJybOmoobJOEv8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C9F475C584D; Sun, 29 Jun 2025 20:14:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71BF5C4CEEB; Sun, 29 Jun 2025 20:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751228088; bh=WPdxO+e8ILol8xOVqVupBv8sHR3wPOu1sMz1xt3HWIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=th3ve3rGsg71OhvNGnagGF2Jf6YZzJOTamWxjviSTICoVOZ0I31Z02ityymlMSnbc IqVYAHRn1PeWkuYx2S+WgZ6bwNfv9VAPcpLcWDgqu/lYGS5FYAtpPk9VtzDY80xEZX USoM89llEEnEG4DcJtZVV03901ObkOcaAlg/tuMLrmJhmTyA5VI4H4f8WyPcn3P0ef 7F6pvuzotOUHqyLC8Q9GnbegMBSz0cmKlcuJ8WsLxKy6AgiM3wkR4vqTErDoea6Td6 OAMmgDQIr+fsg0hvykFrtvdr8TpP95lZSuBfc2VUyR9h2tl/u22aEY5r7SR2uIAcmt alNXieidk3mgg== From: SeongJae Park To: Cc: SeongJae Park , Andrew Morton , damon@lists.linux.dev, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 2/6] mm/damon/core: add eliglble_report() ops callback Date: Sun, 29 Jun 2025 13:14:39 -0700 Message-Id: <20250629201443.52569-3-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250629201443.52569-1-sj@kernel.org> References: <20250629201443.52569-1-sj@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 87F5AC0009 X-Stat-Signature: fi4uthhxxiwdkpue4a5nia5erca3toe4 X-HE-Tag: 1751228089-477057 X-HE-Meta: U2FsdGVkX1+GcH+Ss5ZlkrZmtJFA0l79jJQuGhdO4I9Gp2d8pVgstfkPgk8xFqnYw7md7aRGHOpxoKdITIYYQwXZYX3fIa4QUmhuL3MDovXu8O87hh5unrTsKTuzlh8Fw6w75D0tXZ/ADuXQW06sgiY8oB0Ck0D8yEPaoPKolbmWiStdKL9THGirwNTiK+ANJYzaTh1msf2oPX2Tf502noPxb2rpSXem8PMIfVX3lCx/QQVqaigF/gCFjnwJgQditKFe72ReMqJXlt/2FQW8CbAzMq3HKUg+FxFvR0s5BB2sAciXZ3Rl9HbSAV1jERdVGjc/j0+s8JXGw/ZebybgHGkjL4Npj+77LB7HvWiuzLGAXbQGbk3NZxZCuBv9DqgmjDD3cMeAvyjvsG41vjRKlbU2K9ujM2kIK3C1yPSbc2jp+/AYruFKoWluVSdkKTtL77qPUE8ZfUmzZq0hT1MP2b2Idd9eWbFzLjUxBAVN33OIf3oYo2oPUk1EFlCEqPq//nVfCB8KXjEHTDafPmYF/kjB7EYkxT2ScigLhy4QFV5RlzMHWtegwEjUGl0EIZ6r1fnjNzsU0iy+7lHuNdEhhBxbGKVjs8KKTeSejESOTGl6/q3WE+7+kmlQqinKjMtemviHgIeDLwbiKqrdqXwwnRFsVgkmSEx34LLHYW9echcPqnHAr+wAAJAybZUX/9MJYtY082lUEZohPGY2Ji9kp51K95xtfinLwH/g86hb8W9TJyGsPs/tTlVQcvA76BuuvGYYgCNP55UYwgIX3Rd8/rKCDW3mJ8734mdKOvzpuz32vh+gjyu1AOQiDE6M42VvgXTlQWWA4g9oLdUk1Vgyc1CgvRaw6DZk6lHAQ5BXqJxnBoIBAoOFpuUdEbYYj/dBRjWgLvxd5Kqi/vM86l/jjo5NtSKpss8f7ORrXChCFvSuO+AaCUVKQdAXZl5zuImoWs69pov3yHXd+QfJ2/5 fmyE23+E XQH5lwxxeTPz5cB1bCfGS5EDNfyPXhv9sLWE2cGNns2MWj/dsqAfywSOYxXdBNIA2y9/39Rc+gdHXVryjyWzKB7n1bJUUM9sgGaniSmPPqcpJqCVkphk/GgRyZuqXfPPdHom7Wa4zparzw2Cy5wbM59R7QmaKm3SvqxT7prpKJzc91+v7O2unBYs5ODO2L9oYBMmvcE8xBoMfNUYi6S5NSsoYfXdL2bpDHZQgsb0bRGjAAlk= 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: Not every reported access information will be eligible for all DAMON ops and target. For example, virtual address access report will be not eligible for 'padr' ops, or monitoring targets for a process that different from the process for the repor. If it is for monitoring accesses from specific CPU or write, reports from other CPUs or reads should be ignored. Add operations set callback for this report eligibility checking. Signed-off-by: SeongJae Park --- include/linux/damon.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/damon.h b/include/linux/damon.h index a2198909c903..9ec40ce7dde0 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -592,6 +592,7 @@ enum damon_ops_id { * @update: Update operations-related data structures. * @prepare_access_checks: Prepare next access check of target regions. * @check_accesses: Check the accesses to target regions. + * @eligible_report: Verify an access report for a target. * @get_scheme_score: Get the score of a region for a scheme. * @apply_scheme: Apply a DAMON-based operation scheme. * @target_valid: Determine if the target is valid. @@ -618,6 +619,8 @@ enum damon_ops_id { * last preparation and update the number of observed accesses of each region. * It should also return max number of observed accesses that made as a result * of its update. The value will be used for regions adjustment threshold. + * @eligible_report should check if the given access report is eligible to be + * used by this operations set for the given target. * @get_scheme_score should return the priority score of a region for a scheme * as an integer in [0, &DAMOS_MAX_SCORE]. * @apply_scheme is called from @kdamond when a region for user provided @@ -635,6 +638,8 @@ struct damon_operations { void (*update)(struct damon_ctx *context); void (*prepare_access_checks)(struct damon_ctx *context); unsigned int (*check_accesses)(struct damon_ctx *context); + bool (*eligible_report)(struct damon_access_report *report, + struct damon_target *t); int (*get_scheme_score)(struct damon_ctx *context, struct damon_target *t, struct damon_region *r, struct damos *scheme); -- 2.39.5