From patchwork Fri Feb 2 19:19:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13543325 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 52A57C4828F for ; Fri, 2 Feb 2024 19:20:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C22BD6B007B; Fri, 2 Feb 2024 14:20:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD2F16B007D; Fri, 2 Feb 2024 14:20:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC1DA6B0080; Fri, 2 Feb 2024 14:20:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9CF5C6B007B for ; Fri, 2 Feb 2024 14:20:03 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 37653A26B5 for ; Fri, 2 Feb 2024 19:20:03 +0000 (UTC) X-FDA: 81747829086.02.7618453 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id A863E40003 for ; Fri, 2 Feb 2024 19:20:01 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fWWnRyOf; spf=pass (imf12.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=1706901601; a=rsa-sha256; cv=none; b=DGb25L9J7Qna5Q29i5AiyAAUUFsbL40pn3jFBj0cNSTQWkIs293v0qMrk6jG0JpsQTFb3b +s676+oEut0xOwlRi3o5z1uZHvru4PGTDeYwJuntc72AHxjn/9lGeAogUy2EO3j79CzXzt VUIV/Xdp88dy5QXvZGeZR2nGr+zH4rU= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fWWnRyOf; spf=pass (imf12.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=1706901601; 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=1uACqC+cFdcEnN5VRNHcoyIRX2QzIDbWYdV37Z6AbDQ=; b=qWzpgxZgog2aUcX0nWi28TmtYKX9sexUFwMEB/4/VsmI4xTqVs+Ak8xJ5ZZC+acDROc0Pl AgGmBg+jlKRbQ0/skrK6KJk5OAWdVIKW4C5cziqH0Z/PhYjtG32LZqzdW3IaRtaIHLkXST hPeJ4f5BBP105dCVaciLnKe7zM78mNk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CD4DF625A6; Fri, 2 Feb 2024 19:20:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12E5EC433F1; Fri, 2 Feb 2024 19:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706901600; bh=CbXReCX3ZlwbbZZ2LtMRe+PpRclG31Ljw0m0O0lK4fo=; h=From:To:Cc:Subject:Date:From; b=fWWnRyOfm4mJOX4/eZm+IhaEuLd1JuKdV+JW9Cqe8Z9GKZLpYjLR+5gi8kaWErJYW 3K2uTX+OuwDimwPLsJKDLMCcYTyK/9WaPRneECK2oHFpiWGS/psfiQHarTduW11vtq NJcFDB8Uird8U3HpiEpeO5H6m/aTS3hYKe5RoB4a9jLR2IBN27hS+e7QbL6zt8twBD Sxh2/kDFpF9026EJNrEwzxCygItSwYJ46LVz+a3FXjBJeloGejiKvT3ELuY3LSEfoZ VRqeGWicI+QLrMmr76xm0QYXyNbPgmJP8NmrhBMeJkFpZnhdPdnkahKMIR3hcQOn+b vAsjtwJfaQG3A== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH ] mm/damon/sysfs-schemes: fix wrong DAMOS tried regions update timeout setup Date: Fri, 2 Feb 2024 11:19:56 -0800 Message-Id: <20240202191956.88791-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: A863E40003 X-Stat-Signature: 6939atpo9xhbsp4wcyanmm7ycdmwstd1 X-Rspam-User: X-HE-Tag: 1706901601-449862 X-HE-Meta: U2FsdGVkX19KtEL2ORB7/stiod3XniSItaF2U+FEPCKB9xXmbl+YNdE5/iMfP88aWvtfweRurweije7YyjNu+b5IBoVBRG/SLQLCQRhW6gGcJdG7rGqD/LpiT+l21yKbkNeuQwRRkttWp5deOy52uXmObTjinbbs7sS/WWVa1Qubxz4g8gV9izmB0Cpfg2hdDG9Rm7XR/xNkuqSPszlpk2MLYSGJ50EwF4Fj6EXzF84tdsVuwwX6NmSV+8l2x3IY970D2ARyaXlVc1WGBZQU1I1zzohLHJCKo7rs1hVQAr1Vaz7oJt/Mjc29Cu5y+Fkwuwt3KKPLZou5tkERo7FOcvCl2N/Vk8p6p5hvvMHBZMUlIZnKuMN999t4FKedP1ZUdyHLDf2h9qWhHSTG8K6b2VV+pMBL65HiK8+r8BUBuyCA5HHIuZRu4HsxU0GLPBo+R4pe7HZ1K9fz3zSv8MN9E9U4aZU335IiLWJybYfCVeNng/7gaCZ/SHAZC9wmiysDjE8twC1mym5ua/U4v9J6+8Tc+tp4Y6/KimvoKR33zz1iJpeNcmMRiAhF86gGviWJ7TrB+vQBtat7t7P1uOJYqTccCckDDUYXPFFRxm1eLtWtDXR/gFJwBFjqMxSBo8BH0BTgFSS/GO0XT9irafImCEML99KMUNqkpz/nTLjOxWmsrTSEfTrOiKm3c8fuF4lBpZA/7WrRma4dTARyngZK2dZ0BWEzzMcJIHZ1O8R9Zg0Ocm7hvy1uFHtnah2qkKfXBCM5F0FNFVaoRJ3In7Bvv1abw/gd3ro6TOtsemDeWF9oqynV2w8Q72c/1+vDJfAwCB0DWihv3jC9FBaWnzbVvHf46f5IW8V54olC0/hWsnCrqjfgP6ev6yKVePjZEqzDCUsfOnLPNomdLipSJqfX/C8baTP4AgEiuKedALjAyFLo6z0AnxL9vBnDPXLNMgN8u4TSoCNNGCd9fdOF0g4 svuX8sBw eGH+17eJ6/+GcBe4r5a3o/DKdtIeJRCm0a9RISBnW9FxcKPhEAktW0XBEtYFjxGnbeo065UqdoXpAmIUDDNMCdy5aztsK8+/L4AE1h1fbd6PvWMVdl58eXDuhOj1x2ErjPXP5KRe2pmCkNcyE+PyOY0VF5v0DTdssyAjdP4jrJ9nTarmFJBdeAPShXDhuP6Z7ZrkzPsr5kYxpF+THb6qWENiOuCau0iUiZZcD13+0P8WN5Wo= 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 interface's update_schemes_tried_regions command has a timeout of two apply intervals of the DAMOS scheme. Having zero value DAMOS scheme apply interval means it will use the aggregation interval as the value. However, the timeout setup logic is mistakenly using the sampling interval insted of the aggregartion interval for the case. This could cause earlier-than-expected timeout of the command. Fix it. Fixes: 7d6fa31a2fd7 ("mm/damon/sysfs-schemes: add timeout for update_schemes_tried_regions") Cc: # 6.7.x Signed-off-by: SeongJae Park --- mm/damon/sysfs-schemes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 8dbaac6e5c2d..dd2fb5127009 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -2194,7 +2194,7 @@ static void damos_tried_regions_init_upd_status( sysfs_regions->upd_timeout_jiffies = jiffies + 2 * usecs_to_jiffies(scheme->apply_interval_us ? scheme->apply_interval_us : - ctx->attrs.sample_interval); + ctx->attrs.aggr_interval); } }