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=1796310841; b=p4ioJ9Sh74mpFpE6e+RtCTYSLQdoPs8+ApPGbJH/4wBJOtvVGJr//HUxb82xzofYLQ8v /3TB3+HAmuUSQc4lV8F77aSihYNul66zChUaf603iMaX1dxHB1iqB+evyxlc09Jf9NrwN gnVfq82+Jvi8Rt8Q+EbvgOWaxVpP7wa6zTGM62YOc6JAYols3YWh31dqmsYQwiTQLyZ56 HycX4isk2BF2v/oz4K2hQslJSuljK+DrTced7H4nZ7WUT9aKuT8e06qAJtjIVpEhPfn/k DSqPRHqhrdHg94wT00xH9zzePUE/DzuHxPJ9bdxNqnW8OsHeZqImNr4B0YjkB7L+80g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796310841; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=Al/kgSIpow6ic1x3oFyon4UKQTTHwhBb4kjKkKmKs1c=; b=di0dK3vlGn5mngMJl7wI78ao4RMPPrTGsnK4p1EJ7HyKnIjRbhHW3P0a7sJYI6ENy1jj 6VLqN0nJRsx6wTxNpzYlVDKcroUEUk82JIY1eQRLt1B4GvhuNwpoqNFW1kD48aGS5El18 0kx2LUwkMhWCTrwfUcn/tuugSIWZ9x5R/a8Thy3tgiNMhfexuUJhLWrmzMEMvsA+tspA/ HZlSP+XYZpDu8TY+8EOVHn8h1wOVoJzBO8TNfoqYBTAgsUYYIykG1KZf2rNyauioV6FVB oqHNGkp0IeDDInwELjvwQYrDF8QNC5U5wF7ZA33F1QtFlD8huC0x4ESc5dIernj9mcw== 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=iFf802y9; 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 4BFA8606A32D for ; Thu, 3 Dec 2026 15:14:01 +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=iFf802y9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8364D1F0089B; Thu, 3 Dec 2026 15:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796310840; bh=Al/kgSIpow6ic1x3oFyon4UKQTTHwhBb4kjKkKmKs1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iFf802y9IgW8ZzhbMjiSmStf4Qu0xi9mGgoCiBeG/VBdvjFbXvyFHIqqF5RzotKFX R0ssjI7ZjCrslV5CHauPSWtnbCTVQPmhAv2qTnlc7wfQFGnPELxAw87aPyUH+tFVpw 3NuPqwXpP2EybAbl89szEuODRbVVoLYPwkZP5g3gk7ZSUtbDnHtnTBi5yHJeCq6sqX AOny9Y1hi8nBa++2I7HDzqwPPDjjRBNwlmvuVJbrJrymV7h8yl1qOQGBWDAdj9pynj EtX9v+zAVjEX95b6E13dI2C6fkEe7SawALaSzoyOQVwYQhhpBdm2xQyJDyIfxBRcAx TANQYRHQOSUHg== From: SJ Park To: Andrew Morton Cc: SJ Park , damon@lists.linux.dev, linux-mm@kvack.org, Aveline Noir Subject: [PATCH 1/2] mm/damon/core: expose damon_has_probe_weights() Date: Thu, 3 Dec 2026 07:13:50 -0800 Message-ID: <20261203151352.731319-2-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261203151352.731319-1-sj@kernel.org> References: <20261203151352.731319-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. Reviewed-by: Aveline Noir 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