From patchwork Sun Oct 22 21:07:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13432088 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 859EAC25B41 for ; Sun, 22 Oct 2023 21:07:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0511C6B0083; Sun, 22 Oct 2023 17:07:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1BA26B0085; Sun, 22 Oct 2023 17:07:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D95EB6B0087; Sun, 22 Oct 2023 17:07:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C24786B0083 for ; Sun, 22 Oct 2023 17:07:46 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8A43D160488 for ; Sun, 22 Oct 2023 21:07:46 +0000 (UTC) X-FDA: 81374334132.23.E29175D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf06.hostedemail.com (Postfix) with ESMTP id 9712B180009 for ; Sun, 22 Oct 2023 21:07:44 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Mr2+dXiJ; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698008865; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=OuUWQvtqVqr2NfmDy/zX5WMRE0DzQtB4zn3VhdH+/WM=; b=jpV3zGY8b7ZXNFfKfsF3p2xVSLnAf05ekKnUccbLOy/FEsM5HKW1A2hpTiO9znajUpO8pF PZDKh86HVdRxDuvstXqUAvuoqaj1jA4dU/T+N2CUYQg08ZsfxO4pMfS2QSBS6GPTwTvwt6 m+jzwTp/26YEsEt2b6kk916Amek0DOw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698008865; a=rsa-sha256; cv=none; b=uXjYSsoZNvH276QjxmLePGtLgrw3ukjdkRQ45EMWWtkKlu6NHiTMxq+Mx/z4BIMPCvYe9z 9BbMXrCKDDxsewcKotkXVjmGiUHCDUGQYK4G+N1yp5Jq/ZegWNgManCTgmHYHt//9rukyo d4AYESAV1jNJ9SL7Nm0Zpkx44bZvuQ4= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=Mr2+dXiJ; spf=pass (imf06.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 33226CE1C8D; Sun, 22 Oct 2023 21:07:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A11FC433C8; Sun, 22 Oct 2023 21:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698008860; bh=5ZgrkUlzCX47pRqWIhyU/veHGqYnGCkei+KNQLGqf1A=; h=From:To:Cc:Subject:Date:From; b=Mr2+dXiJPkTQamZC9s42dpr+F9W0/gxa5/gu5u+m66R8FYIBTu1+AJbCM7duHuFnV 3wskyjxpue0Cbn0GZW2V/05/NCIVgiaAzmfVSD1FpZae9HpvNdmj4rSL1u6iD383OY HAOGHljzTiXsfZ3c9WqoZKRhR20LSG6+PmC/dkp01D3CnjTnnJCpGa4WdmjDFWfaHe uQcj1QvuBJ+k/kSaQmTV7H/F/W8CDV20wOCgNSog60fqpbeY8lgJ3oKq82Sznwbgo2 iXDj0VOAx9IfaMuGqZhgao0fXWepdy2vr6wDH0s6hp5q37mgSiAxNbTu/8jyOkpS/n tKvX3/xb3NJrQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Brendan Higgins , damon@lists.linux.dev, linux-mm@kvack.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] mm/damon/sysfs: fix unexpected targets adding bug Date: Sun, 22 Oct 2023 21:07:32 +0000 Message-Id: <20231022210735.46409-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 9712B180009 X-Rspam-User: X-Stat-Signature: 58q1w8qa5etpwugrz73tbu5fwozwykrt X-Rspamd-Server: rspam03 X-HE-Tag: 1698008864-406943 X-HE-Meta: U2FsdGVkX18VeXXQyi4H/d6/4vS9ucNZNrMl7MWJ41049wvYHei5Dn7+K83ZAEvU47cp+kqsUZvBu7x066SSZVH0r8sUPPadhekXM/5Tx3nzxSbAh4gJbxyWib0eqObfRkW8y3vg6ihrqFUegR0EeDhZlbZIFj/Ojvg+moTOQ8LuIj9Zgjwcn+qQo9TzpndcvHxlBUhqv3+DtpeN4NwZE2ZJK4ZV/rgs5la3CNPDmX+6vBcI3yLqgwyVvaWcucD4u+lI0LeNZ8TqZi260zBdOX5+tgdx9V7lJ5bFpi5zLK/pw72Kr8uRzdcMfac1D76ieO64AWMBzFKOotaRTfi4HMcglyG5IC4LKnv5R8rKErnWuBn2FHHU9/93YyhFG3D744nuXiOkul0fNY1F55OYGYquehMCDKnH6TvEka9ils9AY+YIZe1EdxZ37YSkOIioNnwofOZ2yTd/sDq580gwYDRRv+XCDvQGAqz7jvN3GazO47YrLDoT3uMREgG4745geaiNOHCqo8S21tmGdirCdiDyQXncyyC11N+G+nTSrzsw430UiIzMPbb99+tkrJSKVHfMRwmOAq84LENyBZ4KLh17+1EARwACD9IJUL9WZkgus5OaQ58KA987pX/1HiHjgx/aB/SvRUAiOVd7zf9RPcssXxPjecsrfJgicxJn+WLzpPPaVLltorkVA8+NtnYGHqVLO+mrURxgDKTuR5YccCfhYhKP+maWI1QqtZcaop0b4YO/rer6s0xIFJL67NLqAtDMIP0R7K9khffPgCo9iuFqgfjxgwqS5n+iuSh8AGATdk8Dc3bBUrA5gIHJkZpPS4vksrWFkCl0vNaqx7Swc/YhtASI+VUma17i7T4QcjaodztMKnxZqfXYzOKIl240NdXRVIoOgYWnqNH9oP+sxlysl+WSJn2pP6kzseI3xTRxvprV6UrURLu6ae8xCA/v0GO6H/e93oxuG6hepRc KfqS2i82 OWo3O9D4QiCer9/haGMq57CK3QvWjNQqIM2i2XKIoLpMmAu0N3iW5GJn4OZmGxLWodtLupf/jd4DEtvM/dI4jYw5KnmIM8BfSdTiVwz7y6UMN21BDiRhlW417ILS8Ht1mm5NdsV11l0wg3qQdzcmsKjQLw0GYOEsWjhTPRZY6h4PTQjo= 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: List-Subscribe: List-Unsubscribe: The sysfs code for online targets updating can result in adding more than expected monigoring targets to the context. It can result in unexpected amount of memory consumption and monitoring overhead. This patchset fixes the issue (patch 1), and add a kunit test for avoiding similar bug of future (patch 2). SeongJae Park (2): mm/damon/sysfs: remove requested targets when online-commit inputs mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets() mm/damon/Kconfig | 12 ++++++ mm/damon/sysfs-test.h | 86 +++++++++++++++++++++++++++++++++++++++++++ mm/damon/sysfs.c | 52 ++++++-------------------- 3 files changed, 109 insertions(+), 41 deletions(-) create mode 100644 mm/damon/sysfs-test.h base-commit: 9a969da6ffb9609f5fa8d0b7fdc6859c37a10335