From patchwork Tue Oct 25 17:36:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1132134wru; Tue, 25 Oct 2022 10:38:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6Ky+XlSdPcROh7FVUbr24QlF6KRYT0/Wd6bGL57xbx4mC5Hm4QkHVi6PKnhBuBZ14JvUko X-Received: by 2002:a17:902:ce0d:b0:178:bd1e:e8da with SMTP id k13-20020a170902ce0d00b00178bd1ee8damr39988997plg.103.1666719485558; Tue, 25 Oct 2022 10:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666719485; cv=none; d=google.com; s=arc-20160816; b=SgwMaOqZ7F1ZvCq4UKA9gCkkzKGyemF6uOWbwy0h+6reNyWRxQcUsb8DbNbkctWAKK zcxwiM6SAarGtBCANkw4aq2Z9luNSQFwq0TUUzciE5HdZ20W2/IbaO8MBYzs7lbrOs3T d0bYSA1gOaT72DY3ZZpqPsWvYPQWhyWWnukHKyzzilLA7Wt7y/grWT8rzn/pz+KYVUXX MwX90FyGBg9q21ZqDUJzc+wy3JfMv0nOxRdB0e/fsdsvoGY1yJAgo/NsDNmrSvgZTUR9 8gjz6+upZLj7y5Ka2LoDu/PLOoS+seuwuyXaYst5bUPOcnk0Y1B2aXkZkUuw89bUUsiG k52A== 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=4q5kp4rzWcEoTMfVr5HwbJsqJM5ur/giaRa2ZJtzTic=; b=MBBNRbzGAUyVVjNkclM4Md2EtX5G5JlZl6bbS0gCCGaqsNaCXBMegpRlQRDJo7moog max2YiLfuKYOTgQUgJjEZ+vIkTSfn0zl0LikIcaDj0S47cRcWQ1ejhhYGdgaarNuqZI5 fcK4KuDGBhFfZ7JkeVnd99q6fPNziYjxK3mLtk1hki842FexfsL7lc7RxGa8gTc9ixAp wR6dAgGTYUjST7G4K3Unntj0er21aUL0DlrKmrr+FWyjytPbz0KMbC8LFsuaqaJT3I87 IvqpDSQqm1onOaW/8Pvn0TApi/0g2PliQoEu0x2gknpFC9m8xR4yTY5FwHDuJTL8Vkf3 BWGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lazaNRn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020aa79589000000b00540c66456b7si3552782pfj.153.2022.10.25.10.37.52; Tue, 25 Oct 2022 10:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lazaNRn8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231476AbiJYRhA (ORCPT + 99 others); Tue, 25 Oct 2022 13:37:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231241AbiJYRg6 (ORCPT ); Tue, 25 Oct 2022 13:36:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C048ADF47; Tue, 25 Oct 2022 10:36:57 -0700 (PDT) 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 77811B81E06; Tue, 25 Oct 2022 17:36:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86ECCC433C1; Tue, 25 Oct 2022 17:36:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666719415; bh=HOB4aTLZQqyg6IBEsmWZTH1iutjsiAnfu+qigl+jZVQ=; h=From:To:Cc:Subject:Date:From; b=lazaNRn8EkkviKiw34mfcZGNhFWKifzw2xYqZxaJYj1c0h6Eljo+ghLlQlkk2LYm6 zpnt0+ppKGm3PMZG7/J76c2/qRfdJjk26XRkm4Hvxonpk5q/3h+NY+VA0mNXjAaShJ +l+pIXxnUwFeTN5VSS2syen9t2NkfhJ9WcHWWlP3CSnrRY+xG0mOHLIrxV4E2bRDsM SJoL7w/7aPxw1nIH6C/JVs+QtMiJiA+peoUiwjsjcRPk+hP7qtAzh0WZO81O4fXoAl SJUr6tcSb7cGeKfyCpB25v+Dj6s6X9CsFj1yrVy234GoBdlGRqIN86pHiedxJIbYpY gG4F7sxBS4eJg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/4] mm/damon/reclaim,lru_sort: enable/disable synchronously Date: Tue, 25 Oct 2022 17:36:46 +0000 Message-Id: <20221025173650.90624-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747682051314121529?= X-GMAIL-MSGID: =?utf-8?q?1747682051314121529?= Writing a value to DAMON_RECLAIM and DAMON_LRU_SORT's 'enabled' parameters turns on or off DAMON in an ansychronous way. This means the parameter cannot be used to read the current status of them. 'kdamond_pid' parameter should be used instead for the purpose. The documentation is easy to be read as it works in a synchronous way, so it is a little bit confusing. It also makes the user space tooling dirty. There's no real reason to have the asynchronous behavior, though. Simply make the parameter works synchronously, rather than updating the document. The first and second patches changes the behavior of the 'enabled' parameter for DAMON_RECLAIM and adds a selftest for the changed behavior, respectively. Following two patches make the same changes for DAMON_LRU_SORT. SeongJae Park (4): mm/damon/reclaim: enable and disable synchronously selftests/damon: add tests for DAMON_RECLAIM's enabled parameter mm/damon/lru_sort: enable and disable synchronously selftests/damon: add tests for DAMON_LRU_SORT's enabled parameter mm/damon/lru_sort.c | 51 ++++++++++------------ mm/damon/reclaim.c | 53 ++++++++++------------- tools/testing/selftests/damon/Makefile | 1 + tools/testing/selftests/damon/lru_sort.sh | 41 ++++++++++++++++++ tools/testing/selftests/damon/reclaim.sh | 42 ++++++++++++++++++ 5 files changed, 129 insertions(+), 59 deletions(-) create mode 100755 tools/testing/selftests/damon/lru_sort.sh create mode 100755 tools/testing/selftests/damon/reclaim.sh