From patchwork Tue Feb 15 18:46:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12747510 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 EBDF7C433F5 for ; Tue, 15 Feb 2022 18:48:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82C4F6B0078; Tue, 15 Feb 2022 13:48:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DC546B007B; Tue, 15 Feb 2022 13:48:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CB3E6B007D; Tue, 15 Feb 2022 13:48:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0145.hostedemail.com [216.40.44.145]) by kanga.kvack.org (Postfix) with ESMTP id 5EF086B0078 for ; Tue, 15 Feb 2022 13:48:54 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1D26A8F6F7 for ; Tue, 15 Feb 2022 18:48:54 +0000 (UTC) X-FDA: 79145900988.17.2742BD0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 8837AA0003 for ; Tue, 15 Feb 2022 18:46:43 +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 E86B861711; Tue, 15 Feb 2022 18:46:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53470C340EC; Tue, 15 Feb 2022 18:46:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644950802; bh=uGH7d6y/OHdOl0x2ve29e4TlqSB6UdInuFYiQWpPpCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6s0DqO5B0nteyv1plXpOpGu+XiGmasMs02/UBZJAyHpK72Nn6gusSGHV/G/PC+il gSsB9B2AdtHfHtYaGNZCtFAqeN3Alx+58r10fzBjtxGSn3Fpgizr1dEGF7lkE7WohV N9zHgAOpAgby4M1+tapxLjfvv6Z3x8ePvLHYmZ8xEsH7aiKZgLq7VTcj08+Z2NBX7d OX8z4xiZk1oHRWOtkEX8Fop3p2bUpJhRPrfpS8yoFbr/6JTSfY6faWodgWjBI1br8+ XxlTe/IGFevkzeC41SH1wrx0hLrnHlGdrGNuqc8wJBoVgVq+SBzHlPR59hSsfYTqsu oWuKpLoTCaT5g== 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 7/8] mm/damon/dbgfs-test: Fix is_target_id() change Date: Tue, 15 Feb 2022 18:46:02 +0000 Message-Id: <20220215184603.1479-8-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: 8837AA0003 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=X6s0DqO5; spf=pass (imf15.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: w85aq9bzqzmck5rdq7tj941ratfod5c4 X-Rspamd-Server: rspam03 X-HE-Tag: 1644950803-498974 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: DAMON kunit tests for DAMON debugfs interface fails because it still assumes setting empty monitoring operations makes DAMON debugfs interface believe the target of the context don't have pid. This commit fixes the kunit test fails by explicitly setting the context's monitoring operations with the operations for the physical address space, which let debugfs knows the target will not have pid. Signed-off-by: SeongJae Park --- mm/damon/dbgfs-test.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/damon/dbgfs-test.h b/mm/damon/dbgfs-test.h index 8f7f32595055..0bb0d532b159 100644 --- a/mm/damon/dbgfs-test.h +++ b/mm/damon/dbgfs-test.h @@ -74,7 +74,7 @@ static void damon_dbgfs_test_set_targets(struct kunit *test) char buf[64]; /* Make DAMON consider target has no pid */ - ctx->ops = (struct damon_operations){}; + damon_select_ops(ctx, DAMON_OPS_PADDR); dbgfs_set_targets(ctx, 0, NULL); sprint_target_ids(ctx, buf, 64); @@ -111,6 +111,8 @@ static void damon_dbgfs_test_set_init_regions(struct kunit *test) int i, rc; char buf[256]; + damon_select_ops(ctx, DAMON_OPS_PADDR); + dbgfs_set_targets(ctx, 3, NULL); /* Put valid inputs and check the results */