From patchwork Tue Jun 18 18:18:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13702819 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 91353C2BA18 for ; Tue, 18 Jun 2024 18:18:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A4128D0036; Tue, 18 Jun 2024 14:18:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 032D08D004C; Tue, 18 Jun 2024 14:18:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76E7E8D003B; Tue, 18 Jun 2024 14:18:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5584B8D0040 for ; Tue, 18 Jun 2024 14:18:24 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id CE1711C18A5 for ; Tue, 18 Jun 2024 18:18:23 +0000 (UTC) X-FDA: 82244819286.09.75A7A57 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 31E252000E for ; Tue, 18 Jun 2024 18:18:22 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fu9AAeUW; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 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=1718734695; 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:in-reply-to:references:references:dkim-signature; bh=KrirIhj6Cn9Ghf6p0hNvN8hK8cro02Zm5Tq1L8aMSBI=; b=j0i+3MP4P2m+oBvywjysvOwQTLmvd6+hIDFC53JUa/VwYhp4UZYhvKo1iV3vFTLPm8+qxK YVl9EKX1WoVMQ4zBP+zgQSEixhTXBy+ZIDmyigKXU+BHe+LXMI5K0KPNe0oclKtOxZhDE5 OyDqUafhPTAE1Qnc9hL1VU86te9oJFI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718734695; a=rsa-sha256; cv=none; b=p8n2he8x2MA/+udaeJB2KRX9+fofJniv8RaJWOUn2aTkFOAF2q8eY5LVijHk3AR0CecFDa B0lSlobuymtCFQFHuenDpS3gYK4XgVFRC1KCRg0u2g7B70MUZIJIYdDLQwwCeJ8tXUaIcM 3Y6adk98CZetmV41pkwscBMhdWIMzBg= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fu9AAeUW; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 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 dfw.source.kernel.org (Postfix) with ESMTP id 35D3161A85; Tue, 18 Jun 2024 18:18:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E5D2C4AF49; Tue, 18 Jun 2024 18:18:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718734701; bh=FhX0FlOnMgUOXgLd59wQh9U7osp32SgwH12eXj0ho8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fu9AAeUWwTeRvtt2JM6jMIciTRKYP/+kxem/o9sGjge4tI6cDVL9JuDRmdkXWUjvO FE0m4jQ759sVN2rvKx3+TwR/0pBlT1i0cBvmuOsDRkaBljXk5rK6aORrGPyH/jRBwu w+tD6OmLtv0CxJZcBJEI8q23Hh0DzzfsAWJbYxHNGvdGD4cR/8fqCgVi18TGcmO7lM p7Cj3vOwXsVrCzzwVZ3ClXe840/Iw6Od1CEYAvLM3iO4n4hfaLUu2saw/99s43fa6K bQYGpdBDRJgSRCZZ4eW3VO1v6IlDmMlVhhUQwpkyuD1WEhld44789a3JPdjxezvpjL tiLJAL/I+k2wQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/12] mm/damon/sysfs-schemes: remove unnecessary online tuning handling code Date: Tue, 18 Jun 2024 11:18:04 -0700 Message-Id: <20240618181809.82078-8-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240618181809.82078-1-sj@kernel.org> References: <20240618181809.82078-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 31E252000E X-Stat-Signature: pnyrfua155kaigdgti8sqs45ofqi9a8k X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1718734702-130364 X-HE-Meta: U2FsdGVkX1856xCzJS4rrr8gTjdmkZlwG/eWuXaUPkNn04w1iFs1xOt5F5hLSU+sVpQUrHsNSTl963AJN2JKpd1HCoAIZdGVTnwfWY+aH8J1luvXkEyrdQcK2FLUV9zjZzicHgIw6bCouC3CMR7z1tqmR+dP6vLmq983f7mnu6khQXVqDbG1vrK4Q65Ve/6Djt2bOLhVv/GueQ7RuvbnufUdGUt+vWQ7Tp4rtdxVGwwChLC+t+hHdwO4Or/qoMMSlc4U+zaW2fbLAk6hPw9+UCTvMdPeCNw7Ug7LXP1jF0bK9/l+W9WF7+kJVjQNRHx8w32WN557XkGESqkBPC4Oiw8L3DNPAQRI3neQh3fAZDhHTFY0VkoH8PWidSlvkUkeoYAixHTBMv0zlYtiWp8OqJKWhJPm8kUgZwLGmppzlKEIihR2uBWa55HXqqtesPBRproAvXO0+bESz7Ses+fk9IQRDrwNuiOucG/BkdVLIASv4SkLCC2rvrhBOjahSMTpdVM/H/vaoV3HWmgpIudDODvVnK8JPoGZcd0TympmsNshNSigvVbmQ8oj0f69pqTg+gzRes1095fd1hkgYKIevAaLppIF+LLhvr6tKnIzA8Cb0XvFvSP3vaQIuFdwrLOs7c3TVZghF5BSPTVh9zXbDVuhn+MRnK//9P+QTZph7sUheU9wV09BRFvRahqxwDKrh/3P9mB/a2ycsiFUFSLJPuBlxn4x/TkGDvEeRGuUHeV7CmrqKksrPaqk6oetyrttSTnGWR1rzgx3Q9X35k5UBReDLnJflKpTgwVc4uIXArIojHQfHeQCuKq5aZTxAm5x06u/36zFpApBZF0JKuHIFIg8AcC30Mh0jnJsPnBJmyY0f82DlCSpU868c8dYOITzIKuN3rKe0O8Qa5KW6SfXhDExAxGs5pXg6JXfrD8k+kd7kaLWnHTKB4Q9exOBo2daiKbFI12Hx1EIfeHpDA/ 0LgFqogN 3DdW/qb/Dwa+XDewrCQXZKrPNC2lncyhATzyTBEBZgq2eSxxhZx98BEridNe8cIaj6Aa5Ue1UJicbf3QIbbn9aWe6uKjjRRvZfYoRlR0CDypuTYklnC45y9Q0UTka32+Mbee8M60iyG7lAD59rEOuOLTRfCjY0UskeEhHVwl4ldAv/Eg4dDLTIbqV422gQkjA8/r3xXRqdxKvKu+fBgXs1xO7J0pe0iBzQuKUMJGVTLf6mWxG5xJiG6RbSfz6buqM56ICfwmyUmPRHgU= 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/sysfs-schemes.c contains code for handling of online DAMON parameters update edge cases. The logics are no more necessary since damon_commit_ctx() and damon_commit_quota_goals() takes care of the cases. Remove the unnecessary code. Signed-off-by: SeongJae Park --- mm/damon/sysfs-schemes.c | 68 ++-------------------------------------- 1 file changed, 3 insertions(+), 65 deletions(-) diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 1bccf2619e11..77c0265dff5c 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1912,10 +1912,6 @@ static int damon_sysfs_set_scheme_filters(struct damos *scheme, struct damon_sysfs_scheme_filters *sysfs_filters) { int i; - struct damos_filter *filter, *next; - - damos_for_each_filter_safe(filter, next, scheme) - damos_destroy_filter(filter); for (i = 0; i < sysfs_filters->nr; i++) { struct damon_sysfs_scheme_filter *sysfs_filter = @@ -1955,12 +1951,9 @@ static int damos_sysfs_set_quota_score( struct damos_sysfs_quota_goals *sysfs_goals, struct damos_quota *quota) { - struct damos_quota_goal *goal, *next; + struct damos_quota_goal *goal; int i; - damos_for_each_quota_goal_safe(goal, next, quota) - damos_destroy_quota_goal(goal); - for (i = 0; i < sysfs_goals->nr; i++) { struct damos_sysfs_quota_goal *sysfs_goal = sysfs_goals->goals_arr[i]; @@ -2091,67 +2084,12 @@ static struct damos *damon_sysfs_mk_scheme( return scheme; } -static void damon_sysfs_update_scheme(struct damos *scheme, - struct damon_sysfs_scheme *sysfs_scheme) -{ - struct damon_sysfs_access_pattern *access_pattern = - sysfs_scheme->access_pattern; - struct damon_sysfs_quotas *sysfs_quotas = sysfs_scheme->quotas; - struct damon_sysfs_weights *sysfs_weights = sysfs_quotas->weights; - struct damon_sysfs_watermarks *sysfs_wmarks = sysfs_scheme->watermarks; - int err; - - scheme->pattern.min_sz_region = access_pattern->sz->min; - scheme->pattern.max_sz_region = access_pattern->sz->max; - scheme->pattern.min_nr_accesses = access_pattern->nr_accesses->min; - scheme->pattern.max_nr_accesses = access_pattern->nr_accesses->max; - scheme->pattern.min_age_region = access_pattern->age->min; - scheme->pattern.max_age_region = access_pattern->age->max; - - scheme->action = sysfs_scheme->action; - scheme->apply_interval_us = sysfs_scheme->apply_interval_us; - scheme->target_nid = sysfs_scheme->target_nid; - - scheme->quota.ms = sysfs_quotas->ms; - scheme->quota.sz = sysfs_quotas->sz; - scheme->quota.reset_interval = sysfs_quotas->reset_interval_ms; - scheme->quota.weight_sz = sysfs_weights->sz; - scheme->quota.weight_nr_accesses = sysfs_weights->nr_accesses; - scheme->quota.weight_age = sysfs_weights->age; - - err = damos_sysfs_set_quota_score(sysfs_quotas->goals, &scheme->quota); - if (err) { - damon_destroy_scheme(scheme); - return; - } - - scheme->wmarks.metric = sysfs_wmarks->metric; - scheme->wmarks.interval = sysfs_wmarks->interval_us; - scheme->wmarks.high = sysfs_wmarks->high; - scheme->wmarks.mid = sysfs_wmarks->mid; - scheme->wmarks.low = sysfs_wmarks->low; - - err = damon_sysfs_set_scheme_filters(scheme, sysfs_scheme->filters); - if (err) - damon_destroy_scheme(scheme); -} - int damon_sysfs_set_schemes(struct damon_ctx *ctx, struct damon_sysfs_schemes *sysfs_schemes) { - struct damos *scheme, *next; - int i = 0; - - damon_for_each_scheme_safe(scheme, next, ctx) { - if (i < sysfs_schemes->nr) - damon_sysfs_update_scheme(scheme, - sysfs_schemes->schemes_arr[i]); - else - damon_destroy_scheme(scheme); - i++; - } + int i; - for (; i < sysfs_schemes->nr; i++) { + for (i = 0; i < sysfs_schemes->nr; i++) { struct damos *scheme, *next; scheme = damon_sysfs_mk_scheme(sysfs_schemes->schemes_arr[i]);