From patchwork Tue Mar 22 21:48:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12789287 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 6417DC433F5 for ; Tue, 22 Mar 2022 21:48:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE7F56B01FB; Tue, 22 Mar 2022 17:48:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CAD956B01FC; Tue, 22 Mar 2022 17:48:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B73B66B01FE; Tue, 22 Mar 2022 17:48:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0244.hostedemail.com [216.40.44.244]) by kanga.kvack.org (Postfix) with ESMTP id 9AF366B01FB for ; Tue, 22 Mar 2022 17:48:57 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5446118289DE1 for ; Tue, 22 Mar 2022 21:48:57 +0000 (UTC) X-FDA: 79273362714.30.4BF6440 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf31.hostedemail.com (Postfix) with ESMTP id F109D20010 for ; Tue, 22 Mar 2022 21:48:56 +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 753F96149C; Tue, 22 Mar 2022 21:48:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD3A7C340EC; Tue, 22 Mar 2022 21:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1647985735; bh=SkZx00q+H6WrsqNnmJVvB41rO8MrGlg/DGNSTgWKqr4=; h=Date:To:From:In-Reply-To:Subject:From; b=JNjE5yN9q6vkWbdtDCRLpiVfJOVzGXT/4TmYtaeqhrPvIK0+IkLO8T6d2P9qIQPNm 0I3xC3FFGvpROwMl1BsgKidWpd2WQ2GnWsECuVkYq7Ehxba1sA9hmFydeF8tRiDRf6 eaVO6pyPpilqYVqjpqBoHhWyENG5Ssy1yHmMRsO8= Date: Tue, 22 Mar 2022 14:48:55 -0700 To: xhao@linux.alibaba.com,rientjes@google.com,sj@kernel.org,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220322143803.04a5e59a07e48284f196a2f9@linux-foundation.org> Subject: [patch 205/227] mm/damon/reclaim: use damon_select_ops() instead of damon_{v,p}a_set_operations() Message-Id: <20220322214855.CD3A7C340EC@smtp.kernel.org> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F109D20010 X-Stat-Signature: yqs7yp5x4n7d9bjou6xsisx96q6t1irm Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=JNjE5yN9; dmarc=none; spf=pass (imf31.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-HE-Tag: 1647985736-992838 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: From: SeongJae Park Subject: mm/damon/reclaim: use damon_select_ops() instead of damon_{v,p}a_set_operations() 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. Link: https://lkml.kernel.org/r/20220215184603.1479-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: David Rientjes Cc: Xin Hao Signed-off-by: Andrew Morton --- mm/damon/reclaim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/mm/damon/reclaim.c~mm-damon-reclaim-use-damon_select_ops-instead-of-damon_vpa_set_operations +++ a/mm/damon/reclaim.c @@ -384,7 +384,9 @@ static int __init damon_reclaim_init(voi 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();