From patchwork Tue Jun 18 18:18:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13702822 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 200F0C27C4F for ; Tue, 18 Jun 2024 18:18:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B802C8D0047; Tue, 18 Jun 2024 14:18:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B11E8D004A; Tue, 18 Jun 2024 14:18:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A7C88D003B; Tue, 18 Jun 2024 14:18:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8B42C8D0041 for ; Tue, 18 Jun 2024 14:18:26 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4359F120A62 for ; Tue, 18 Jun 2024 18:18:26 +0000 (UTC) X-FDA: 82244819412.29.DF819B4 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf26.hostedemail.com (Postfix) with ESMTP id A0BB614001D for ; Tue, 18 Jun 2024 18:18:24 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=b83Rt0oM; spf=pass (imf26.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718734700; a=rsa-sha256; cv=none; b=bhOxOiCy8bjpelTi/7cQo9SgeCcfXNuTDaviBW29ekGmPJ/k4u2AaEAaratMSMZNhZIGT5 YGTWLR5nxkLHreqTwVDx5RRsGQPzeWDGW5eOHsC0niGwlnqYRpJxVBGfM3U90cOplAvXTa QegwOf40GS+RFr1Nii9nN000/ntExV4= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=b83Rt0oM; spf=pass (imf26.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=1718734700; 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=EKp4rTjFjoPyyrAOBTdsALhJHsEWne+AGSwLWZmchD4=; b=HBAN8bfRw/r+T7h2Iwq1Hwi2/Ht6BI7WB93fMiRgrP1gh+ah05WNxKPWGW/Z5cNEl/3hJu cq1CVF9n8STdirSi6mlwXdeeIxJeYzbv5TV5kwQnan4yUMlq7rtyAaaKeppJErWMkvMrdP M3uTuYY1C9Tzsi1tlmeDmy4d2o8rM1M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4DE4B619EC; Tue, 18 Jun 2024 18:18:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B564AC4AF1C; Tue, 18 Jun 2024 18:18:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718734704; bh=EHvHHvs3IdQ5P9rJaPK4ESC9R2II3qWxcAR6kWa1t4Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b83Rt0oMqPtrzFHwkktThAbwt6RLmjgTiYcJl5Yy8yP9GJeb/W67nnfp5KZK0arUv AILftpGiE3WMsdcmNVeO06uiWCOP57jzQFLd1M8NPK1GdpHyeeBWFks1meqa/uR74z DWfr3k0KW/cwRj2FJZ4zBkjFtSID93TaQ4C7+cS9bb0DBl9MUr+I84JLe5+2BrtIRJ BUqf6UfT/EeGXEDHkhVbNrnNcvbOZNlJIgR/RwJHs/r28rZ1dBIEY6OkC+j0xFOk89 gykTKPRNkIWYUZK8UdpT7GsbE6qwRUCV9YHJ614stO3SWX0cnJ/oDWEJL45ZS2dn1m 2zQtXOPOaSZGg== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/12] mm/damon/lru_sort: remove unnecessary online tuning handling code Date: Tue, 18 Jun 2024 11:18:09 -0700 Message-Id: <20240618181809.82078-13-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-Stat-Signature: iimhg47zqck55ak5hdbxfmbo3gwn5unw X-Rspamd-Queue-Id: A0BB614001D X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1718734704-251057 X-HE-Meta: U2FsdGVkX18DhhLd6MVLX2Eqnj1LhedvGAxarueqdThTGCKG2f5IdnNuC5HoX/JQTWn5VGX5DR0IUh99XFU/dACIBBlQ1NvyMDLN5ztp1m+YUOYirwpq41P9M4sbmtSsZHkB3+GaWQ0Z/yzulj5GeeN9KxHzn53MOWNgS5M9HUz3BcV1Ed7FjWSvonvrVhH7QcKn2zFJCpPMiQW4BDh+N2MHZnYW4+QLeeQd9ttyulxU7VT6D+O3mBUYusNXaKOdsUkk9k+RrVCq8PibLu9F5lFnLT3ikd4AyRzHAth0Jik2E8bEBeNngISR6pOxWyIXdkZaa/MUkEKCVB6BRs7IArxJgnSwBhXchDRNZSSD4HyH6dQbzlMo1Npo+QBm1/GDogNVYU/XsxrU2vS1gI6bmpVTrPR09o+fsb4cTNAB36Vxl4Tdl/dJlcJDJZihQhcKc6tg5PEcw+ciPGNtEwmHIYSVhbQzd7qSNaw4n+BHpGRS6dRDkrC6OPSRjCUnwkhE8i77P8AyEQMJ3kJrafDxCjm4Li0Qbmm9CPFJhKpR8oBO7ydwD7UuD34u2rMMKd0N9j6rbc4gG55dgx1KzLrxINA8AmUvAerXR4SkDqjBTFnswIolPDQMD2MSivvWzFlWl/GMPFr94zRSwv+/pmFklJNUgX8uexuYwr+y+ExHnSjv6Rph0/X9M2MdMo0dKeHLGbgERvRNfMsXObaLyTTFmGUJOxcUNnXH77Ql2oHJyiOv26Ftyl3zf5TqVLwglZnxqHg36Q3C129ECwfgLEJVcKVyCMJBZt3pPcBxOOEJbtOq2qH1ui+Du8ePqOtLTEq9eLn513bKbFJQNi+o3VhyFnVO3Oq3auWnMKuXogOMSX9+hUEdYpa41LXR/vaIyL7j+3Q89DtOzH+Ma1Oy9ZFa6tG12Y506trLTyfOOc/wbpZJaohvKhQjHcEOyXFiJ0v6OrBNHJMd1BQzPEc2FFw SKBxNjx8 mDLUrLlbdS2T2fexXEaL/MdAvCX86kriO/G1ZgggaVmXy9VWWnKa0z3U/cYBv1csh68iIGk3ftUzhBQzLOYLf0XXjr2dnyYc42gxBAmZhumW7ss4jc2JB7cjaSNrrALyRdlybUdbCKDgvLon15vLJZWZheNMVwbnfjoXJ507jRlNDVf97D46qMirLgST6mH+fx+jik71rKUeni2YK+KlKfMQQdOzeTxIfxa8Eo7xSYXoN8w86Sr7lr1U7lx4TKQghsPvuHoMfeTx6k5zxtg4L2zTn5LsEDu5c8ySn 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_LRU_SORT contains code for handling of online DAMON parameters update edge cases. It is no more necessary since damon_commit_ctx() takes care of the cases. Remove the unnecessary code. Signed-off-by: SeongJae Park --- mm/damon/lru_sort.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c index f83542973946..4af8fd4a390b 100644 --- a/mm/damon/lru_sort.c +++ b/mm/damon/lru_sort.c @@ -186,23 +186,11 @@ static struct damos *damon_lru_sort_new_cold_scheme(unsigned int cold_thres) return damon_lru_sort_new_scheme(&pattern, DAMOS_LRU_DEPRIO); } -static void damon_lru_sort_copy_quota_status(struct damos_quota *dst, - struct damos_quota *src) -{ - dst->total_charged_sz = src->total_charged_sz; - dst->total_charged_ns = src->total_charged_ns; - dst->charged_sz = src->charged_sz; - dst->charged_from = src->charged_from; - dst->charge_target_from = src->charge_target_from; - dst->charge_addr_from = src->charge_addr_from; -} - static int damon_lru_sort_apply_parameters(void) { struct damon_ctx *param_ctx; struct damon_target *param_target; - struct damos *scheme, *hot_scheme, *cold_scheme; - struct damos *old_hot_scheme = NULL, *old_cold_scheme = NULL; + struct damos *hot_scheme, *cold_scheme; unsigned int hot_thres, cold_thres; int err; @@ -215,22 +203,11 @@ static int damon_lru_sort_apply_parameters(void) goto out; err = -ENOMEM; - damon_for_each_scheme(scheme, ctx) { - if (!old_hot_scheme) { - old_hot_scheme = scheme; - continue; - } - old_cold_scheme = scheme; - } - hot_thres = damon_max_nr_accesses(&damon_lru_sort_mon_attrs) * hot_thres_access_freq / 1000; hot_scheme = damon_lru_sort_new_hot_scheme(hot_thres); if (!hot_scheme) goto out; - if (old_hot_scheme) - damon_lru_sort_copy_quota_status(&hot_scheme->quota, - &old_hot_scheme->quota); cold_thres = cold_min_age / damon_lru_sort_mon_attrs.aggr_interval; cold_scheme = damon_lru_sort_new_cold_scheme(cold_thres); @@ -238,9 +215,6 @@ static int damon_lru_sort_apply_parameters(void) damon_destroy_scheme(hot_scheme); goto out; } - if (old_cold_scheme) - damon_lru_sort_copy_quota_status(&cold_scheme->quota, - &old_cold_scheme->quota); damon_set_schemes(param_ctx, &hot_scheme, 1); damon_add_scheme(param_ctx, cold_scheme);