Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp586377pxb; Tue, 15 Feb 2022 22:58:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0GF+KUVLvpEm7+FboR8yELA4BNrF3QP2vHxs2GdBznzth2uIUeajOxbrhr5LyM9ZB7/xZ X-Received: by 2002:a17:90b:3607:b0:1b8:efe5:9008 with SMTP id ml7-20020a17090b360700b001b8efe59008mr172815pjb.163.1644994719797; Tue, 15 Feb 2022 22:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644994719; cv=none; d=google.com; s=arc-20160816; b=BgATvLbjyyKLsXOXDRRQktY6ypLM2XXUlmCE/mVBsHa8u+5dbUBpswtk1+S8pcTbJE X1bkOZNWVNRHEAyU9aqxC2M8ERtkuRGkIqpvX+hTC/vPmP/I1BNCOIoYnxptsDtXSUW6 kLn1BLx7HDJKfmrE70OQNqMlkzd8In30c/DU8qoviqRWNtj09oqbHUBYeau7KZRkCBFQ ol9vyJ5Iz/LuC4hhPz5kgc0jxX5wW1m5OsGyL5mgYqfoQEbjqvfhSCTNDGoDjSCdjElJ FUIIToV32xK3VlaBRVDMg1TN1Vq6M54TSjD2TD+fiiKQEHpZwnj3pzpom0vLe+ipt9pv M5mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=nm7VwYn0HWIaARN1mUeXBSv7jOuXlqmQAlTxrDcUPQU=; b=zOmhnDMoDfQ74rN/z6/E0+9SLtlE6CWlROjk1DWDeink7rBK8tnxAIzGXHI9JSqysZ Fr8UC2H0Zgz3QEoSljzaA6x3/ZJIEgv5I5Zeb+fZcevEGDmF3OHxmRakmBcHHHgrkK+z uoE20h+sGsTtYMKl/JCi+n7hliCLRRrQfHTC2Rv22lcYRZWpdLjUAdaPkQWmO6a+UxFK 9DNegZeeOhYmw5qyId8vt6vpZ7Bfx7pihZW/oMJrXJgpQZ8IJsSA/i0+kTsEkFxLX2nI W9KKKoY1seW3USPelY3NLYQDlnI6aieaot7EWP7Q0oDcLhez+27h9KEmHaYsIJsz6qZ5 mluQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a3Asl/Q0"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h184si4472773pge.208.2022.02.15.22.58.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:58:39 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a3Asl/Q0"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4841F23810A; Tue, 15 Feb 2022 22:40:44 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243254AbiBOSrP (ORCPT + 99 others); Tue, 15 Feb 2022 13:47:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243205AbiBOSqz (ORCPT ); Tue, 15 Feb 2022 13:46:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE67B2BB0D for ; Tue, 15 Feb 2022 10:46:44 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 808A7B81BE4 for ; Tue, 15 Feb 2022 18:46:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7D63C340F2; Tue, 15 Feb 2022 18:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644950802; bh=XXGeNtrspMb0Dwxmyk26Ohtm/O4a1cfPDFdOFE7eyIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a3Asl/Q0jZHzZ8Fx18aS9Edo012+2tW8XzSsF+ko6ooB0CUZ014JYnq8gv3cZY7ho ywxRC5EIwUEzNjahfZ5A7JXMOTEX1e/qYX7RQNx+lPvfBWHuK/n/ne7TIYCWNhSplS fAei8gKcZhNrT6fYpgw/EuJya/XutP92YBGFVZQulobaWum0Qv8ydZGAPttHIbOusg i13hw9VVXETh0QI6IEWmbw09HRwlYJFUXqXqXrHxcqLwGjUweJ0h4zhaM6EdfdmM1C askxjC7YovIT/JDpyh0X1GLsXEqlscTjfRFmDmef49vmI2U09TBJJHIjju28rqt3MP XvIQjnVzLjaNw== 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 6/8] mm/damon/dbgfs: Use operations id for knowing if the target has pid Date: Tue, 15 Feb 2022 18:46:01 +0000 Message-Id: <20220215184603.1479-7-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-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DAMON debugfs interface depends on monitoring operations for virtual address spaces because it knows if the target has pid or not by seeing if the context is configured to use one of the virtual address space monitoring operation functions. We can replace that check with 'enum damon_ops_id' now, to make it independent. This commit makes the change. Signed-off-by: SeongJae Park --- mm/damon/dbgfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c index 8bf9e38b60f4..05b574cbcea8 100644 --- a/mm/damon/dbgfs.c +++ b/mm/damon/dbgfs.c @@ -277,7 +277,7 @@ static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf, static inline bool target_has_pid(const struct damon_ctx *ctx) { - return ctx->ops.target_valid == damon_va_target_valid; + return ctx->ops.id == DAMON_OPS_VADDR; } static ssize_t sprint_target_ids(struct damon_ctx *ctx, char *buf, ssize_t len) @@ -741,8 +741,8 @@ static struct damon_ctx *dbgfs_new_ctx(void) if (!ctx) return NULL; - if (damon_select_ops(ctx, DAMON_OPS_VADDR) && damon_select_ops(ctx, - DAMON_OPS_PADDR)) { + if (damon_select_ops(ctx, DAMON_OPS_VADDR) && + damon_select_ops(ctx, DAMON_OPS_PADDR)) { damon_destroy_ctx(ctx); return NULL; } -- 2.17.1