From patchwork Tue Jun 18 18:17:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13702814 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 15919C27C4F for ; Tue, 18 Jun 2024 18:18:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A61FB8D0001; Tue, 18 Jun 2024 14:18:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F55C8D0038; Tue, 18 Jun 2024 14:18:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 009478D0001; Tue, 18 Jun 2024 14:18:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CEDCB8D0036 for ; Tue, 18 Jun 2024 14:18:22 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 714F414032E for ; Tue, 18 Jun 2024 18:18:22 +0000 (UTC) X-FDA: 82244819244.03.9D20278 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf10.hostedemail.com (Postfix) with ESMTP id 7A2C9C0002 for ; Tue, 18 Jun 2024 18:18:20 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="G/kVjevF"; spf=pass (imf10.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=1718734697; 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=j17wPlZVduOAV+nbqhL79NuGZt+rvacKFSCMZo1NJNw=; b=rqQ46SMP5rvG+ePl+Hm01icg7Eu4ifdSTP7GPIvV0NEnZnWQesTEpl6EuvRPbtGUOFvllD szskzzKLNRt5YGcJQDPVuJKAAv0wM5lQnXE49RFABUHBWU58VWkaqqxNmGt2TI6YK8w6wQ +e6pEeAIfrxZf14jfxWUpaiIC/PihlM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="G/kVjevF"; spf=pass (imf10.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718734697; a=rsa-sha256; cv=none; b=sOiPSoLLM8ZRxbcL/2yogMuqXzdW2IY7hsM1CcmkZ5Eyq/FYMU/y8IClaJvvOU9nbDwFmN fYM2JSi7h9u87D8Pqj1iG3vnjDSRz0lRn5911+mrW0Qn1CFDwjuJqGs7CcvQJ07kCQPS5Q peo2+dCW0EZrXVLgNUanlUrKDbru1X8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6B322CE1BE6; Tue, 18 Jun 2024 18:18:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D2F8C3277B; Tue, 18 Jun 2024 18:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718734696; bh=sEMSFeBRxlT+xOyI3fcvS3gyAxDb+FQHzwkV0mfmWeY=; h=From:To:Cc:Subject:Date:From; b=G/kVjevFEFQgXplD/GLlcAfRy0ReFQ2H6vdu7tby3Yph5gm5av1ySjHMa/PYQJjw2 4oEk7yQYVXobPz8oTfkCNEFkGW6lUNCoj1+tzTyoP/E0wMjaM6kZS+VlYaBo+H3m4U VxLYnGQwHl7kYY3Ql+ZYwtzG/rtOJPq9SuE/Y8/AezcDkbp/SGRAZDKSRkf5WuB/zb xcDQwOUitZ4uM9DcsptxAXZQEQGNr1MUh4YTf26iRsAAWHukJLZy3KRA4DS864vVEg Vbcjman/4VQbT7RKZpnaSooBn8ZdHgoXL7e5j1wcAqMVXAtZOsXa0qjtOoy/3YTQHc o/F6QArRw1Z8A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 00/12] mm/damon: introduce DAMON parameters online commit function Date: Tue, 18 Jun 2024 11:17:57 -0700 Message-Id: <20240618181809.82078-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 7A2C9C0002 X-Stat-Signature: 6gspuhu1w49g99mpggcptjtwqxdti57i X-HE-Tag: 1718734700-290767 X-HE-Meta: U2FsdGVkX19HY4chpno4OizJ7/SkTnK4n6NbrzKzb9UwFseAkHeG/GgWX8oZdGDpPjhqOzgwc0kaXnFQ9vLSL8GF11sZ3s5St6T19yLmQh8bLiTBheVJS5HWRkYtzwT9kOQCdpPlJLyEt1OnZv3u/FxNw6kNciOw+xxYhUTCkJWfk08uMttVXRnsniEFcQnx4+6KwSwpKm3lE+SM+YJMEzaa8E7wM+rbdXCVGsBibEDMpfi6KLCa5IvwCoFd64fA02gSbAhUyRlNMTNlzNdhwUiqdn7vUli8ZLO1A/KeLOVHUCIbaGFI/CRvS3L7oAadsln4C8r6ADoWVUz9MVqhdmBVMa6kAuLgMFvfnHNm3B4oXN+DVJ0vmJOZBwWfbS8E5jdMv6SSLhb1RBokugGbBhvpRLCzI/zJ4J1bESaMCnTy7Dq+2OHfOqDP4P27yX8C16bD1sIcEoaiiYRhEvq28zdjJdSnubd2zq4rXwgXiq9I+60Me8p6KaX/om6jpaDaAHffrSrtQBBl558odKyN0vqfuGO7a5rzSgdY3Qsw35ucEq5mwQsdK1Rw0YOdy2J5XkL/jcI5IfUpnwNEGNxyFd1Gf/XvYTHtQqUdOhBu4/f2mCMF+1+21caBywEnyGX+wYTdfxWyV7+m08NlmJ6vMHj3aoEettrfwBenwalCyiOldH2J0bpWthS6L91ENbu07+Eyui5oJrzVs2VVfO+EqyN5NpJ0sMf1pLTc3lmIc+hIl9AKeCdDep5Lx/OsPg5Ufbm14L7vXTZ5eKAi/hoeVEgR11SnK3LLRFDpuKiDT+4m7R1R7Pli9+Vr/hYD3NtCbq/T/3tOgbdXEsgUef2FMeR/KBLbNlKqTGUK5ybNFVh26l+t29oEONuw63EgF+pFtSQ/hog/IgtalxGw7QsIY1EpHVkpUr9Z68oDRCudBm7VaKIyuhLEa8WjSZ6fOisA5/SHHaEi8TPtp6ybS1p nAUR8r7/ XwLyeXZ0YgDNQI/AD0+kHFjO5x3d5tBTAyvL75nHmltFrSod8g0w5ObE7RJ1OZhRF51WWZnUejLP+agvGbPYK89yLmlInCWxopcGJk7asBXoh/bzojQd68pfX/Rdxj8GWVHlGdhEVBINPo0hsMzJHPbQlivPzbq/IvWwdonyWhRAByWQ= 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: DAMON context struct (damon_ctx) contains user requests (parameters), internal status, and operation results. For flexible usages, DAMON API users are encouraged to manually manipulate the struct. That works well for simple use cases. However, it has turned out that it is not that simple at least for online parameters udpate. It is easy to forget properly maintaining internal status and operation results. Also, such manual manipulation for online tuning is implemented multiple times on DAMON API users including DAMON sysfs interface, DAMON_RECLAIM and DAMON_LRU_SORT. As a result, we have multiple sources of bugs for same problem. Actually we found and fixed a few bugs from online parameter updating of DAMON API users. Implement a function for online DAMON parameters update in core layer, and replace DAMON API users' manual manipulation code for the use case. The core layer function could still have bugs, but this change reduces the source of bugs for the problem to one place. SeongJae Park (12): mm/damon/core: implement DAMOS quota goals online commit function mm/damon/core: implement DAMON context commit function mm/damon/sysfs: use damon_commit_ctx() mm/damon/sysfs-schemes: use damos_commit_quota_goals() mm/damon/sysfs: remove unnecessary online tuning handling code mm/damon/sysfs: rename damon_sysfs_set_targets() to ...add_targets() mm/damon/sysfs-schemes: remove unnecessary online tuning handling code mm/damon/sysfs-schemes: rename *_set_{schemes,scheme_filters,quota_score,schemes}() mm/damon/reclaim: use damon_commit_ctx() mm/damon/reclaim: remove unnecessary code for online tuning mm/damon/lru_sort: use damon_commit_ctx() mm/damon/lru_sort: remove unnecessary online tuning handling code include/linux/damon.h | 2 + mm/damon/core.c | 333 +++++++++++++++++++++++++++++++++++++++ mm/damon/lru_sort.c | 53 +++---- mm/damon/reclaim.c | 62 +++----- mm/damon/sysfs-common.h | 2 +- mm/damon/sysfs-schemes.c | 94 +++-------- mm/damon/sysfs-test.h | 10 +- mm/damon/sysfs.c | 81 +++------- 8 files changed, 425 insertions(+), 212 deletions(-) base-commit: a7b6f23b7fa3f5d1f3ae64034a4aff12fb8c1df0