From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796178521; b=peF9rrTnTembi4iL33bYNrgqIjzmzIxWZDrEkILr7h24RshMeVVzJzQnPaxaPke/H8zK VImINzisf7FBs8Eh8oQUpwS7aUvofHav3/vjmhreGC0e/wmln/j9LxM6bUrRdPPWeIboR ivDld94xr2pjPFyjstX01FAR40iOosPdTeja995Xbc6A5kFsZQMYu26TvOlcBtKzJyZkY i4wnooYLIky4kY1YB7MKBfO/YPgwc5LagIV0EB5Z4r3yE42u9oWTXM1bNTuJv52huJNbU QXn0UOXAlCxozjk4KBFdElZkS72y0aMjgZx0vJloP2t2WXQmeZCL2HvFA6PN7RYbiqg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796178521; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=gnbvDo/tYjqT4zhKAQUTyTr5WH/AIeh1LJ0vFBDhpk8=; b=A/M7f05iRoeUgOwyr/VUPbaM8aDCnYbmjFIYm4Jll+tnAbGd+c8ISX3HAMUFdp63S4LT +n6CRQzFFxuc7NJJezXHxYhf3tXJxvBkQyjqT+qbXSg/ci55JUjAx2VtA3bPBfXq1NZAQ U81EBaDOYsgYLTBdiNamKvcSSSGjiOjnQDFcBf/+vtF8PUrdJn9Hl8q/eOHdsDUQU2ogN qKHWxU3oxfX/leGnfAjcMNAautqgggZl/WSgIksgXezehOG9C1ntpxrrU100QXvpypVKh OP5FmmiL4Uysp+SGPMPt2msKXuCmCR3wM1BKSISFzzMV0jCoFYOzm8mPhynnQTawPgg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DCXCP8uj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B81A8606A689 for ; Wed, 2 Dec 2026 02:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DCXCP8uj Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA29D1F00896; Wed, 2 Dec 2026 02:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796178521; bh=gnbvDo/tYjqT4zhKAQUTyTr5WH/AIeh1LJ0vFBDhpk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DCXCP8ujnQaEdpS71YGBgqWkR+vY0Ek5n4POfZ7TFIqdf6K+e+GItPWMwwOMT4i1+ ImSz16hJnnXpDiqS/3o1Zs+Msd/emJBUF6MaBVPpqRxmByFupKaZ9r1zapPEiHI/G1 GGo3aHbpoLkoQJszVWE0axWcr8FDlc+EFe3fwZkUH/EmjUCYR+EfXXB+/lQohcZjpQ 9DUY10GawWrKSaA0nsThiEpBUaHlVQ3+9OMr+3qOTMCFdShZq5u1Td3QFHQV9kvhQu PAA0yAZRjkZ+IqHAdOiiyHtWH4abj52qwrjBddBIJe4lbkto8cfWazXLgl0VDGj/uW cm+ZXlc+7qUTA== From: SJ Park To: Cc: SJ Park , Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org Subject: [RFC PATCH v3 1/2] mm/damon/core: expose damon_has_probe_weights() Date: Tue, 1 Dec 2026 18:28:30 -0800 Message-ID: <20261202022833.93546-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261202022833.93546-1-sj@kernel.org> References: <20261202022833.93546-1-sj@kernel.org> X-Mailing-List: damon@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a DAMON context is configured with data attribute probe weights, it runs in attributes only monitoring mode. In the mode, the traditional page idleness based access monitoring is turned off. Users could manually do effectively the same thing in more flexible ways. They can use a set_pgidle probe prep and a pgidle_unset probe filter, with flexible setup of additional probes. In this case, hence, the API callers should use the probe_hits instead of the traditional access frequency counter (nr_acceses). Some callers such as DAMOS quota region prioritization score logic would need to be aware of the mode. There is, however, no core API for determining the mode status. Expose damon_has_probe_weights(), which is effectively working for the purpose, to DAMON core API callers. Signed-off-by: SJ Park --- include/linux/damon.h | 1 + mm/damon/core.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 45c82f536da5..99f57add0106 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -1195,6 +1195,7 @@ bool damon_initialized(void); int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive); void damon_stop(struct damon_ctx **ctxs, int nr_ctxs); bool damon_is_running(struct damon_ctx *ctx); +bool damon_has_probe_weights(struct damon_ctx *ctx); int damon_kdamond_pid(struct damon_ctx *ctx); int damon_call(struct damon_ctx *ctx, struct damon_call_control *control); diff --git a/mm/damon/core.c b/mm/damon/core.c index 2766ebec0150..47295ac44408 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -271,7 +271,7 @@ static struct damon_probe *damon_nth_probe(int n, struct damon_ctx *ctx) return NULL; } -static bool damon_has_probe_weights(struct damon_ctx *c) +bool damon_has_probe_weights(struct damon_ctx *c) { struct damon_probe *p; -- 2.47.3