Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1765409rdb; Sun, 19 Nov 2023 09:16:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzDLYGecuXw7UjeH1AW9sQDqMhjwfL5eEozMT2O+UPErHAMBwv5xKMBcfFGSYdWvdtd10i X-Received: by 2002:a05:6a20:244d:b0:187:9ff3:98ac with SMTP id t13-20020a056a20244d00b001879ff398acmr3773811pzc.4.1700414162093; Sun, 19 Nov 2023 09:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700414162; cv=none; d=google.com; s=arc-20160816; b=qGIm5PVwZfLUrNcBF35npa0gjFY+WdYQSB3pAiYUUW0zRrPppi8PjqnVBxp5MvgtfO hWM/xMEgiPrN78EkWp+fghdxe7OsbQLWWpv9PfwkT7wTjhTzn5+EW0r/jsdXG/hXlNEx CfIWdWL7k5AAxKNAK8704hFBeujdPbZJ+W8FhPW/Kj8llfB+/mItqklDVxu4QV4CQNA8 +G6AhS6p1d3EmIC+WhV8EZPRxV2B/027bf0jvqKCj01+lPTrEocDv0FFzyMIUMZ/gZgB GLKEzqupj9r8UNg8S8AuDKEWUOs7Sb3Yisha5zRI9KXVfCIdriSIMO3DRu4s1YFj9eT0 F8rQ== 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=k3qlEKrpUKlu9+VRA9cFAtNOmR60PMxaKlmk8cYBIEQ=; fh=BzdeVYqZhG5iuwuKJRNLP969rvCput73lx0iwx2zu7A=; b=0dO31zI4K226bZ4G+ALjitp2kWqk8F3YTlAdDX2Abh2cLyWBmdw/UnZIjGmA8yvt9w ABh/G2aRb7q0rkW13HcfjLFQ2H0upzMJaofy1TNnvvIKzyGWKyC2Qwu17hWz7UZaBAoD gDVJasXYKIZXAWt0BRZoO7x8xawLEq47nJRHWnDDmKDLDF5wIVI3N2IZ4MYTNrZkcZBH XzMK0G9ZLvEtN4k8KSZ8Rz8a1/3rcCzKk3RF0O5tZ4SowPUhF9XO0FzVglZ8ahrxC2lm uyZgDo9ezNs53jYaNTMP2rndX9ggyUvchE7K9JGRKBr/kwyi21eCNyLwW2Fo0jWsX1RK o6Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XkfEizFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h10-20020a056a00230a00b006cb88391bdcsi1193486pfh.210.2023.11.19.09.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 09:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XkfEizFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 037AD809EC99; Sun, 19 Nov 2023 09:15:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231479AbjKSRPh (ORCPT + 99 others); Sun, 19 Nov 2023 12:15:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230027AbjKSRPf (ORCPT ); Sun, 19 Nov 2023 12:15:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB4FBF2 for ; Sun, 19 Nov 2023 09:15:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06C42C433C8; Sun, 19 Nov 2023 17:15:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700414131; bh=wGhN7a1c1/p9kfRbyE8itY6KQu9wn5cOAaIJeGVmnnc=; h=From:To:Cc:Subject:Date:From; b=XkfEizFwjv4s2yyAh/IAdR4Ce6ANjOrHPS6OuUGobhk63MS2x68e7h7vDvp478EgL raG02fy8zS6Zg8iVPZ2/GmQeoINkjLj9ER0t634jT0bMnPTVJlIGwZEuAhRG9bRdGp LGqm7giPcvncWcu7qPOQbfn4BAZzlqiiIw4JVn4sJh9HLYuVRRcvUKgpXRLATg3bE3 Z3/oPm1KhExae4SvDwzPARf/8tZLK4fi6QW6K38QS/kF5fUs0mYxWbzOVIuNMUGEM3 Jk6MSHWzyA/E66pjT5jbU5I17CbKbEz4aou4ik1VANNJ4G2tAZhC+9o2fL+3tA+Dlu j0XgF6IfYEe/w== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mm/damon/core: copy nr_accesses when splitting region Date: Sun, 19 Nov 2023 17:15:28 +0000 Message-Id: <20231119171529.66863-1-sj@kernel.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 19 Nov 2023 09:15:48 -0800 (PST) Regions split function ('damon_split_region_at()') is called at the beginning of an aggregation interval, and when DAMOS applying the actions and charging quota. Because 'nr_accesses' fields of all regions are reset at the beginning of each aggregation interval, and DAMOS was applying the action at the end of each aggregation interval, there was no need to copy the 'nr_accesses' field to the split-out region. However, commit 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") made DAMOS applies action on its own timing interval. Hence, 'nr_accesses' should also copied to split-out regions, but the commit didn't. Fix it by copying it. Fixes: 42f994b71404 ("mm/damon/core: implement scheme-specific apply interval") Signed-off-by: SeongJae Park --- Cc-ing stable@ is not needed, since the commit that introduced the issue has merged in v6.7 merge window. mm/damon/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/damon/core.c b/mm/damon/core.c index 6262d55904e7..ce1562783e7e 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1225,6 +1225,7 @@ static void damon_split_region_at(struct damon_target *t, new->age = r->age; new->last_nr_accesses = r->last_nr_accesses; new->nr_accesses_bp = r->nr_accesses_bp; + new->nr_accesses = r->nr_accesses; damon_insert_region(new, r, damon_next_region(r), t); } -- 2.34.1