From patchwork Wed Dec 1 15:04:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12650157 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 3C7A6C433F5 for ; Wed, 1 Dec 2021 15:11:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57BA06B0087; Wed, 1 Dec 2021 10:08:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 52B5A6B0088; Wed, 1 Dec 2021 10:08:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F2F56B0089; Wed, 1 Dec 2021 10:08:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id 2D57C6B0087 for ; Wed, 1 Dec 2021 10:08:17 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DEE4218131217 for ; Wed, 1 Dec 2021 15:08:06 +0000 (UTC) X-FDA: 78869555772.18.BF3A7F9 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id D972F6009E14 for ; Wed, 1 Dec 2021 15:05:06 +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 ams.source.kernel.org (Postfix) with ESMTPS id 9E94DB82014; Wed, 1 Dec 2021 15:05:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5FACC58327; Wed, 1 Dec 2021 15:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638371105; bh=ZLNKsQlFSLqYMsBCfb792+tzS72UfrLFubOGm2kx3Lw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pj7KV7zpySualdRJt4DuoXFbR0fal4UOQ6kG2NVd9hSzWzHfLomHVhgfrvswswnsG t6ZfSC6Ak87/YTuQrFpJoYmdlLRc40NdTzACd42zzmsH4BEJqcTAFH7ITOf6ZKtUSS xEIVNeqpqWZe9zXDTNVihpVXQQsTXhUW+L5P8XKZQBp5b9Bc/rBeu0m09kY1mj9h/E Inp7g6vLvHSiD+wjLWnprxWV3jOgdBnAlb3C+p4k0tyBNhsSmNZKPvbOB29YcL1ZyP sne6CTWbmrBreJvXBWRcJ3Gxs3NSCR8SyI5BpJXEDJhm3uKkjlVfeIiiTzbQlAy6DS /39oY+HQ0BGCQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: shuah@kernel.org, brendanhiggins@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 08/11] selftests/damon: Test DAMON enabling with empty target_ids case Date: Wed, 1 Dec 2021 15:04:37 +0000 Message-Id: <20211201150440.1088-9-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201150440.1088-1-sj@kernel.org> References: <20211201150440.1088-1-sj@kernel.org> X-Stat-Signature: mzxxcohh1pe1sqpnjn3aewfs139qrftt X-Rspamd-Queue-Id: D972F6009E14 X-Rspamd-Server: rspam07 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Pj7KV7zp; spf=pass (imf10.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1638371106-696644 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 debugfs didn't check empty targets when starting monitoring, and the issue is fixed with commit b5ca3e83ddb0 ("mm/damon/dbgfs: add adaptive_targets list check before enable monitor_on"). To avoid future regression, this commit adds a test case for that in DAMON selftests. Signed-off-by: SeongJae Park --- tools/testing/selftests/damon/debugfs_attrs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/testing/selftests/damon/debugfs_attrs.sh b/tools/testing/selftests/damon/debugfs_attrs.sh index fc80380c59f0..d0916373f310 100644 --- a/tools/testing/selftests/damon/debugfs_attrs.sh +++ b/tools/testing/selftests/damon/debugfs_attrs.sh @@ -94,4 +94,13 @@ test_write_succ "$file" "" "$orig_content" "empty input" test_content "$file" "$orig_content" "" "empty input written" echo "$orig_content" > "$file" +# Test empty targets case +# ======================= + +orig_target_ids=$(cat "$DBGFS/target_ids") +echo "" > "$DBGFS/target_ids" +orig_monitor_on=$(cat "$DBGFS/monitor_on") +test_write_fail "$DBGFS/monitor_on" "on" "orig_monitor_on" "empty target ids" +echo "$orig_target_ids" > "$DBGFS/target_ids" + echo "PASS"