From patchwork Sun Nov 19 17:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 166859 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp1750485vqn; Sun, 19 Nov 2023 09:16:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGU5Bcjz0O+rxof2gXBxLySDEp0B1hOuX9Gdubjrpi+LImu2EtwqXrJUnouvOY+9nTxKGDD X-Received: by 2002:a17:903:2352:b0:1ce:8ed:2378 with SMTP id c18-20020a170903235200b001ce08ed2378mr4478573plh.1.1700414160380; Sun, 19 Nov 2023 09:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700414160; cv=none; d=google.com; s=arc-20160816; b=vzCCO51ZYlR+VE0yDm53q5yb3wRwI/0ykn2Uv9E6am+aDbQiHwjzxkflTP59eFrl5f ygAhsS28FAdema+KFeCdQ+q97juowB/G03PPjxymzZzAeLmuWH6EWBT2WUfoW0CXS7g9 dYAOmhWEmAV6gJyRpj0BjLkvDSKT4yFqkYOlaJtWbzcFGpY6bEiIrktdVSbjRQYhgXX7 AfIRww177b3xQQFB5lO4s0ybzea53oaL7Hmo0vCZ76i6fWUvc/TSSVULUUYtA0doXp7C Xn8HgbHZBv8cVBxr0TSaKwm9gE3Ydq89j881Ya9pEcgLCDxY5Y6l7PmYQAPzRFVjWHk8 lvmQ== 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 Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d7-20020a170902cec700b001ce67644c86si4442145plg.567.2023.11.19.09.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 09:16:00 -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 6A63C8083B08; Sun, 19 Nov 2023 09:15:39 -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 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:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783013478613416270 X-GMAIL-MSGID: 1783013478613416270 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); }