Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp876299rda; Sun, 22 Oct 2023 14:08:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZo50fwV625xIzEOE8jifrBX+93I9k7BJzCCx3rKEdM7V6YJExJj0D1gOnz87U88eq2+L0 X-Received: by 2002:a05:6808:1a23:b0:3ae:349:7c03 with SMTP id bk35-20020a0568081a2300b003ae03497c03mr10462612oib.27.1698008900067; Sun, 22 Oct 2023 14:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698008900; cv=none; d=google.com; s=arc-20160816; b=Xk4s66TmozcrOfnZBR/CA/BrrAXrWqA7xhRgmdcOQT7eNf4UAa5q1bQYbUYCEe9uNT x4oKMJlRcmNARuiPjiwaPDGlNPiI+U67jqNQtxBTzfL+J0oAZJ6H2hmIeyy2givl3A9E DDsR/162P9iK+hTvzhN/hHeCbPcMUfi8TKTHmcUYo40jNXaHzniZtq0zUdQOv37RTjL/ IgUQvoDxGVTOI1G5B3cByze6pqbd9rL2C0qbspxRGbrsJ/jeFA28kbWZGZD/LV+gwMSc TeiEvglZQAr8MHBwzM0oWnBfnBM/HXs8PWJJt2/fCwfgqo2SrIUPs3sAcQWJ76ZnU+pO fjmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=OuUWQvtqVqr2NfmDy/zX5WMRE0DzQtB4zn3VhdH+/WM=; fh=KYrqrUZLyrFtzsRGU6oAoSUmY0DAP9CMMvmnxe+fdzY=; b=d0UwbxqWuIVt3Rb7HZquEd5/mkjnf1yKy1DbIBnfPvq0hBuqZKJu4vmG5BAXvfHt+V ZCFTqb5a/Dl7IY0X/kUYm5rObKAh8yVxBAMK/KpkD5BkyjXqBdYmsCrmph9QMkbGZNpW n3+UDK5lckZPivKDyvW96Gblbgve0IjRw5aYsl4jr/S/SWGzVYXJMLOSjt+PM1iH3Km2 OTNpdhi4BrcgbTLSusI/xBwWCcGj1X99Ryl7yTtwaHyd+v/G9oe90XUd3XF9RGTquxYp 9QT4VmYFeCGtgffpKnpO0tsFswzfIs1AROzjZ4CK1Yv65TJ/Ngup5Fwcb2cVFSduyBWz acRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mr2+dXiJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m65-20020a632644000000b00578afb3123bsi5329532pgm.700.2023.10.22.14.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 14:08:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mr2+dXiJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CDC0B805907F; Sun, 22 Oct 2023 14:08:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232648AbjJVVHn (ORCPT + 99 others); Sun, 22 Oct 2023 17:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjJVVHm (ORCPT ); Sun, 22 Oct 2023 17:07:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C28FDD; Sun, 22 Oct 2023 14:07:40 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 22 Oct 2023 14:08:16 -0700 (PDT) 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 -- 2.34.1