From patchwork Mon Sep 18 07:47:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13389075 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 54862CD37B0 for ; Mon, 18 Sep 2023 07:48:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 881BB6B02A5; Mon, 18 Sep 2023 03:48:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 832006B02A6; Mon, 18 Sep 2023 03:48:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D2906B02A8; Mon, 18 Sep 2023 03:48:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 5F0E36B02A5 for ; Mon, 18 Sep 2023 03:48:51 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 212AC140BEB for ; Mon, 18 Sep 2023 07:48:51 +0000 (UTC) X-FDA: 81248941662.27.2A7491A Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf26.hostedemail.com (Postfix) with ESMTP id 3FA77140004 for ; Mon, 18 Sep 2023 07:48:47 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf26.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695023329; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cDF9VZz6PRkEnlooLIfOgQsCCTw40kEWHQZ70T/KLOc=; b=JnKCAqWaiQsZOWKD86K2l6O8e+rMCHKGeRVt3ZbF9xb+uhF+4ZJ9iHVhti1rPwYqUHfhYe Y6sCKBGLrcw1tiJPQIgObY1LANYW/mZHW2xLFWpfWd9wpsjiS/bQKBbHCJzUaorg9b2b4N 6g6rHLfh6IZBf6fI1JxYemsozEHKVpY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf26.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695023329; a=rsa-sha256; cv=none; b=TXzSe3CNwsy6Ejv/Ofo9yRqQfXKsFG6+Er3cCtU06Cy7+KCNLujeVz/FNo8x9NFMiB6mqi 4L2sidb1YMAsNx/T5crCRvTE+bPAPqZxoGRvJKrkQvHlUzaDEI0wW1/UPp3ySvGsEUDRDu EoBB2Eg+xvbhPh65hZhfkCdVioMZgRs= Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RpxdV6RbqztS88; Mon, 18 Sep 2023 15:44:30 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 18 Sep 2023 15:48:42 +0800 From: Jinjie Ruan To: , , , , , , , , CC: Subject: [PATCH v2 1/2] mm/damon/core-test: Fix memory leak in damon_new_region() Date: Mon, 18 Sep 2023 15:47:58 +0800 Message-ID: <20230918074759.3895339-2-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230918074759.3895339-1-ruanjinjie@huawei.com> References: <20230918074759.3895339-1-ruanjinjie@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3FA77140004 X-Stat-Signature: 9bgdczjpafej5f1fh34ayk7cyrmmhi5t X-Rspam-User: X-HE-Tag: 1695023327-562387 X-HE-Meta: U2FsdGVkX198vbxp2ZSePSKtv+Iq7Q410AvWjkmfgT6ohcaDd9Ep3TLm/83ZMRIGZlsVf5ra5WOBWXxbS+Wymlw2kImkSK64C5I+uNJg2ZuIXSrYdFvupjqFDZ8Ttc7RiiB8BQUnL17z/7poMHwE/oDOR8TrGT00+sZnzV1auEdhLFfxcV3FAEkboZckKADcaUg1+exUWlHZpwktsHkFzG+9S+HOxPnce7HWs7Kw9SZtT1xNNcYv3zC5pLCbqj9sdFE+9P0qjndlBzAkgUX0vf7lOko1Q/rUAc6B7QZR4k42EH6azBFNGYGf+pXPC4EhO0TVoRE+C6c6XQbZ+oJQ1N0Tpjy8o+AF+KuKCAVb5wuZe9vRO5Uke29aAKzXBHhu0hL83V7nP+dpUSefSOkHgEECTYGc6K15AQc5pOGjXh7anglklQlMWc+HMlh6yLg/JGRd+x6UoOpKjnM35B/hGqpKVy6/X8JJymrgjkOnQO9vu2e6WnTewVbtPeAEF1Pf7pX5Zg1YHEZQFSVM75CViNKsHp1lI9+VX1RbvtEeYn/kHYI4WR5PfQqt2ME2jQVnQJ/8teLWuT99u230Cr2+A8aWDY0WCFcrPhaKgsn90b4/oqLr+EWQbI+clFB3UWrtP16jW90QtF9N9zhtJsHa5DHhG/yVYZesSF0PqJwI2U6Dannh9Ao3ZZ/goDJyaPebosrDQe+FTRZuW0ZFNmOaz6TN2ynFddTWfhp2jsu0tBF9LY/GIXgbjo9yRxik95ObbPt3NHTGsQRnTgw1YobnHWLmD2jAzftmXa3c9XHtzt9bF9A5omXlpRXXaCx2elJrGItnsJnuT1eNf6vTMmoEFOgJFVHLcZqYKYAaAbRLU4Ps1de5vy3UkQFZHl6UM5LtkGAOI3dTiJqW4iWcl7vEATj1SxzcBpbbqyt9yeHnH/0pHZZ4SGmSF9daonNVHl6e9xpQIN6JX0f5aeIQ83M XaPMAt8d 9v7UUJfXl1r7KtwCv+V8Uf/bhZlVefXdQHfKNk4nmZ8h1XiCf1vz9rpreUKlCqWy5fzT1x+jr7movVuCS4YyAWqoNTE2XyhmoASaC1DyO3ceF0nGnDjL+IH8D4X5ZkhEiP53Vof5X9k6U8/UOUmmCwmxPOkQ0ZkmNeRyrMoffjMOzOF1YJAKfv7vBeEGjbdOKGcjp 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: When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_region which is allocated by kmem_cache_alloc() in damon_new_region() in damon_test_regions() and damon_test_update_monitoring_result() are not freed. So use damon_free_region() to free it. After applying this patch, the following memory leak is never detected. unreferenced object 0xffff2b49c3edc000 (size 56): comm "kunit_try_catch", pid 338, jiffies 4294895280 (age 557.084s) hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 49 2b ff ff ............I+.. backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<00000000b528f67c>] kmem_cache_alloc+0x168/0x284 [<000000008603f022>] damon_new_region+0x28/0x54 [<00000000a3b8c64e>] damon_test_regions+0x38/0x270 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 unreferenced object 0xffff2b49c5b20000 (size 56): comm "kunit_try_catch", pid 354, jiffies 4294895304 (age 556.988s) hex dump (first 32 bytes): 03 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 96 00 00 00 49 2b ff ff ............I+.. backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<00000000b528f67c>] kmem_cache_alloc+0x168/0x284 [<000000008603f022>] damon_new_region+0x28/0x54 [<00000000ca019f80>] damon_test_update_monitoring_result+0x18/0x34 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 Fixes: 17ccae8bb5c9 ("mm/damon: add kunit tests") Fixes: f4c978b6594b ("mm/damon/core-test: add a test for damon_update_monitoring_results()") Signed-off-by: Jinjie Ruan Reviewed-by: SeongJae Park --- v2: - Replace the damon_del_region() with damon_destroy_region() rather than calling damon_free_region(). - Update the commit message. --- mm/damon/core-test.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 79f1f12e0dd5..3959be35b901 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -30,7 +30,7 @@ static void damon_test_regions(struct kunit *test) damon_add_region(r, t); KUNIT_EXPECT_EQ(test, 1u, damon_nr_regions(t)); - damon_del_region(r, t); + damon_destroy_region(r, t); KUNIT_EXPECT_EQ(test, 0u, damon_nr_regions(t)); damon_free_target(t); @@ -321,6 +321,8 @@ static void damon_test_update_monitoring_result(struct kunit *test) damon_update_monitoring_result(r, &old_attrs, &new_attrs); KUNIT_EXPECT_EQ(test, r->nr_accesses, 150); KUNIT_EXPECT_EQ(test, r->age, 20); + + damon_free_region(r); } static void damon_test_set_attrs(struct kunit *test) From patchwork Mon Sep 18 07:47:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinjie Ruan X-Patchwork-Id: 13389076 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 7FD44CD37B0 for ; Mon, 18 Sep 2023 07:48:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 17FB06B02A9; Mon, 18 Sep 2023 03:48:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1066F6B02AB; Mon, 18 Sep 2023 03:48:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F11D96B02AA; Mon, 18 Sep 2023 03:48:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id DC1B96B02A6 for ; Mon, 18 Sep 2023 03:48:54 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B23CF1A034A for ; Mon, 18 Sep 2023 07:48:54 +0000 (UTC) X-FDA: 81248941788.03.94FF27D Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf17.hostedemail.com (Postfix) with ESMTP id 614D840020 for ; Mon, 18 Sep 2023 07:48:50 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695023333; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pR16u9YSxxcuK6qoS689DOIWQQZebVrEutP1giBVzpg=; b=XmybCExYp2JMCaBGSCQw9lDmOl4OxmcS69Be/i9jR+6NrViZs1y4z0I8i4uDPmX2XlqdQH Hz2yrKErrRdZpmeZKAZw3Xz1C/X0i6JGEpETS1s3IrPrEGeYM8owF1A4zMwLaoW17xJigT /oRftVUTb7ey44UvPXKKTZFkOj3RW0E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695023333; a=rsa-sha256; cv=none; b=IyXIVVNwYiT1BRE+5/Es3X3hb2TAcvjx9zGYJlAN0HCp+F33WTt3QqLISBAb49JJ2jEUbk u74SWsW13oN3BrfvzrSKjgcuRzcH1iudGsXz0qj08teWcI0K/Ll/FYU6eU94baFz975BTy 7+Wg0S/9lnc//cRiX764u+uMR+2JvwM= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; spf=pass (imf17.hostedemail.com: domain of ruanjinjie@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=ruanjinjie@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com Received: from kwepemi500008.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Rpxh04pc7zrShj; Mon, 18 Sep 2023 15:46:40 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 18 Sep 2023 15:48:43 +0800 From: Jinjie Ruan To: , , , , , , , , CC: Subject: [PATCH v2 2/2] mm/damon/core-test: Fix memory leak in damon_new_ctx() Date: Mon, 18 Sep 2023 15:47:59 +0800 Message-ID: <20230918074759.3895339-3-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230918074759.3895339-1-ruanjinjie@huawei.com> References: <20230918074759.3895339-1-ruanjinjie@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500008.china.huawei.com (7.221.188.139) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 614D840020 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: ki3gjq8czzgy1oqizpckzof9hmghn5u7 X-HE-Tag: 1695023330-54247 X-HE-Meta: U2FsdGVkX19sw6KExYn70T7ooPXy4NzVFsnQi4a5WzvUaEBMdddlZCqgetffa7rW/92HDQPQxO4EpCKAdRaJVoqa/mcaDbSB8T6g5VGIcpKdfQloPn/xa9xMQqvlM/9wxLT53xRntCwaF5AcZboLxa7wcZzRLKCPLCoRjMpfx/glXGNmflE0+uCtQm3NE2C3rKiNG0ob3LhPwCD0q/Fu+d7PB/wq3iXz9RaHrlbnB9sGYXMnjJZMwMKeMm6A52dxK1LKhFSMNz3z6mVFWe0q/tyqVKgGodZg9q8haPOGqxwWGHkijaCtr7ANKZ3Wab9yHgc4VBE0ykRwohvtwz+cXMMevERVezp2XfogO37orF7bJUeZt8x5VwTcNAAdoRubOIL5Wwuh9UNID5r/NDZHhImyg5Mb9vHl09xi/n1z8FSfZzMVRvbXPoY7VQB00M6HF1un5O6J7GM3vRRBR/r6a36HYcQiXPb+5/MVHC2cT0Xac82Si03dmGk5fJvKazFly6piM7fh/At/XV677XFcVkaC2Ty4MPWWHJk8g2a+bDaP6WnbWxSevDwizRCnyPJxSyzLusloQPl9jWUHbH5lXqhDNNjgq5A7DksvkwwVGPUnTPmM9Woniplhx/DmLgCBpByVz2xm3thCtYy830ai/wiVSM81pip90CVuhb0HLtB1Ub3wgasNokryJcTicFSokYqXzAyQrRw1f+Yc87CfxcjQV2il0Bl+LVkHj+33xb2bqj3jWotl+Jo7RB9kQVehGYF4UGKuABZFUHQxEmzcsVHSkTBhQMJZxlRKr8/NiPp2cXegq2dR2sjskhzfALG0sw0wrpzzOE4TXEQqNfcThgeCXovM+ZdzTfXIAw5v8eLDE7Etl9SK41lkXNAGFn36nXMJHS0rOLMKzzlYC482LrklRya4it8VUPBeEwYRI8/zXDXYyrKEy6CttTq9mIDX/epsuQe/PrNivr33u4U YtTnLH7Y AAkK19Zzl6i1xqhfjhL8/3mdvKy6ZYAmnj6kjOkCPyisyzMMTYj2A+tFzabKGE96bnUvZ4gfC7zJLdfpxzxBUZB2/rk8LZAK4ImaE9DL1PAnaNKBdZaLhrEa3FCkaWSdUDcG8H9rxzPrpKcG29EE6vGXo7lYjY2XXLX2Ppa2JXqJEktzgNdF61l5FoWTyTyKXzaimKf3CVDoVMP5njk/3Wa3zXw== 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: When CONFIG_DAMON_KUNIT_TEST=y and making CONFIG_DEBUG_KMEMLEAK=y and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. The damon_ctx which is allocated by kzalloc() in damon_new_ctx() in damon_test_ops_registration() and damon_test_set_attrs() are not freed. So use damon_destroy_ctx() to free it. After applying this patch, the following memory leak is never detected unreferenced object 0xffff2b49c6968800 (size 512): comm "kunit_try_catch", pid 350, jiffies 4294895294 (age 557.028s) hex dump (first 32 bytes): 88 13 00 00 00 00 00 00 a0 86 01 00 00 00 00 00 ................ 00 87 93 03 00 00 00 00 0a 00 00 00 00 00 00 00 ................ backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<0000000073acab3b>] __kmem_cache_alloc_node+0x174/0x290 [<00000000b5f89cef>] kmalloc_trace+0x40/0x164 [<00000000eb19e83f>] damon_new_ctx+0x28/0xb4 [<00000000daf6227b>] damon_test_ops_registration+0x34/0x328 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 unreferenced object 0xffff2b49c1a9cc00 (size 512): comm "kunit_try_catch", pid 356, jiffies 4294895306 (age 557.000s) hex dump (first 32 bytes): 88 13 00 00 00 00 00 00 a0 86 01 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 0a 00 00 00 00 00 00 00 ................ backtrace: [<0000000088e71769>] slab_post_alloc_hook+0xb8/0x368 [<0000000073acab3b>] __kmem_cache_alloc_node+0x174/0x290 [<00000000b5f89cef>] kmalloc_trace+0x40/0x164 [<00000000eb19e83f>] damon_new_ctx+0x28/0xb4 [<00000000058495c4>] damon_test_set_attrs+0x30/0x1a8 [<00000000559c4801>] kunit_try_run_case+0x50/0xac [<000000003932ed49>] kunit_generic_run_threadfn_adapter+0x20/0x2c [<000000003c3e9211>] kthread+0x124/0x130 [<0000000028f85bdd>] ret_from_fork+0x10/0x20 Fixes: d1836a3b2a9a ("mm/damon/core-test: initialise context before test in damon_test_set_attrs()") Fixes: 4f540f5ab4f2 ("mm/damon/core-test: add a kunit test case for ops registration") Signed-off-by: Jinjie Ruan Reviewed-by: Feng Tang Reviewed-by: SeongJae Park --- v2: - Add Reviewed-by. - Rebased on mm-unstable. - Update the commit message. --- mm/damon/core-test.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h index 3959be35b901..649adf91ebc5 100644 --- a/mm/damon/core-test.h +++ b/mm/damon/core-test.h @@ -269,6 +269,8 @@ static void damon_test_ops_registration(struct kunit *test) /* Check double-registration failure again */ KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), -EINVAL); + + damon_destroy_ctx(c); } static void damon_test_set_regions(struct kunit *test) @@ -346,6 +348,8 @@ static void damon_test_set_attrs(struct kunit *test) invalid_attrs = valid_attrs; invalid_attrs.aggr_interval = 4999; KUNIT_EXPECT_EQ(test, damon_set_attrs(c, &invalid_attrs), -EINVAL); + + damon_destroy_ctx(c); } static void damon_test_moving_sum(struct kunit *test)