From patchwork Tue Feb 15 18:45:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12747503 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 9852DC4332F for ; Tue, 15 Feb 2022 18:46:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76D666B007E; Tue, 15 Feb 2022 13:46:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71CBA6B0080; Tue, 15 Feb 2022 13:46:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 460596B0081; Tue, 15 Feb 2022 13:46:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 3806D6B007E for ; Tue, 15 Feb 2022 13:46:42 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 08FB420C91 for ; Tue, 15 Feb 2022 18:46:42 +0000 (UTC) X-FDA: 79145895444.04.3E5233D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf11.hostedemail.com (Postfix) with ESMTP id 8D84E40004 for ; Tue, 15 Feb 2022 18:46:41 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F12B361703; Tue, 15 Feb 2022 18:46:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D2E7C340F3; Tue, 15 Feb 2022 18:46:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644950800; bh=eZhIL14gOWoVEWGsNwFN8NXBLL2iSBk+B/sSAvRm98Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r+7gmoPNoRh8qs/0p5o66zLMtSjxWSdqe62i1kIqnfJj09Z5OgfEwi11Q1sh9o147 JeDCg2rlzXJXQli1U3qL5jzmVBDX0zdcUwKG8sWTgFGx4TXxPHPWf7lzjyLD/G8u8C cyV83LDVqtffhMZJLzbZTD9Q4HNqkGUqaS9X0Jzxt+Fl8WrJLwEvNHurz3Rq8OEzr2 Q2WxA6SWAlGkqYhAa3nm21HwqXCwGLKzrt41zQBJ4VjshykkchB4RoyMxfLc8CcN/B tyVD1UbA2FPLGOfyxDipTPehlnr8HFunLgJtxbJYWXDRlanbaeGtn4VsSq1jk4P8eV dkoytfn3Bbjhg== From: SeongJae Park To: akpm@linux-foundation.org Cc: xhao@linux.alibaba.com, rientjes@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 4/8] mm/damon/reclaim: Use damon_select_ops() instead of damon_{v,p}a_set_operations() Date: Tue, 15 Feb 2022 18:45:59 +0000 Message-Id: <20220215184603.1479-5-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220215184603.1479-1-sj@kernel.org> References: <20220215184603.1479-1-sj@kernel.org> X-Rspamd-Queue-Id: 8D84E40004 X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=r+7gmoPN; spf=pass (imf11.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 X-Stat-Signature: bne74g7tdefe9ak1hds5j8mw5q177rz3 X-Rspamd-Server: rspam03 X-HE-Tag: 1644950801-879166 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: This commit makes DAMON_RECLAIM to select the registered monitoring operations for the physical address space instead of setting it on its own. This allows DAMON_RECLAIM be independent of DAMON_PADDR, but leave the dependency as is, because it's the only one monitoring operations it use, and therefore it makes no sense to build DAMON_RECLAIM without DAMON_PADDR. Signed-off-by: SeongJae Park --- mm/damon/reclaim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index 3c93095c793c..b53d9c22fad1 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -384,7 +384,9 @@ static int __init damon_reclaim_init(void) if (!ctx) return -ENOMEM; - damon_pa_set_operations(ctx); + if (damon_select_ops(ctx, DAMON_OPS_PADDR)) + return -EINVAL; + ctx->callback.after_aggregation = damon_reclaim_after_aggregation; target = damon_new_target();