Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2794390rwb; Mon, 7 Aug 2023 03:46:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvYIKj0HzlPpS/MkNyfHTDzYP5hIiz7AL2XrFPvhygDinBXeG78odnX/3FOYdOmLJgEttn X-Received: by 2002:a05:6402:31f1:b0:522:289d:8dcd with SMTP id dy17-20020a05640231f100b00522289d8dcdmr7344482edb.35.1691405177092; Mon, 07 Aug 2023 03:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691405177; cv=none; d=google.com; s=arc-20160816; b=N/DO6PL9s+XPh54H44DaPn3StqwYJoxXKXkSsWGP5/8MabwRlYvAy2BTAjI59JDPXS fF7ISNzoMfNb/ZIxK50N7VckhrH73ot/s11NSc0NXIoxLnYKAQenwfEyXuXFbnI4mQ/Z PH2RoLjcsnp1T6Gz43/R/JA+T5bUouHlFTGQ01iSoGLLoKCkIeFIZ3rqTUKfu4iTM92p XdpM46QXz7X7jRCthGUv2dYwSRHDOwnG2jgXAfZWMeDZEzIUr8/Txs0DrwPcZBDjop7D XsgW2xXcFifd9aYNae++u/RhOFGVQxGZLBuJ3g6feB12BEQKxzXSA2TIB1Tv5zpqPwbw a67A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=MkUdmOsdanYJRPaOBW+Sf9SKg08UmbFYSf2hDRsm7Ew=; fh=XzvNBcvNmalinfVxSUJHi4lwg3T5CgWMRKH0WbEBZdM=; b=GQHsFpqB6kDUGjPvP+wLhqPrXXtkTtMOAQHq63V0tsNjU0G4F42pOIbM6hrThA+VSm +S/M86uwBAsiuK9SCZ2ENGIa6AybR6Oog1mroviJpnmh8Zm4czB4Pcy8dSaRVB0baQAN eN5MHXkSqngLyS6VJ8lp91o4Xzq1BFYzCL7JjqZeMofpTUfHzWQIOacD903tJ/nbgGKg eKrpYmxkB9m1S7zv4rw8hO60OvrPgSy6gAjXpUdNxkBWE1zrYCp0KFScwboO52xqaMGc ZKbYludZ5HdBjUjwUmAlXtyliGwlzLYS0/8Q5IHpKU21a6bcWgHK30y9VAZOVlkJwCo7 C8aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=J9pgGgRP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b13-20020aa7d48d000000b00523228f6149si4209146edr.100.2023.08.07.03.45.52; Mon, 07 Aug 2023 03:46:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=J9pgGgRP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231357AbjHGJpA (ORCPT + 99 others); Mon, 7 Aug 2023 05:45:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229977AbjHGJo7 (ORCPT ); Mon, 7 Aug 2023 05:44:59 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B54195 for ; Mon, 7 Aug 2023 02:44:58 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bc6bfc4b58so3849595ad.1 for ; Mon, 07 Aug 2023 02:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691401498; x=1692006298; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MkUdmOsdanYJRPaOBW+Sf9SKg08UmbFYSf2hDRsm7Ew=; b=J9pgGgRPpqHlck1+0KnoJkG88FkDuJlHW5sLQ9r8MVmOhil5QYz/fhfhzEOSPMI28R i3clEExQpgGOf/DVuEkNsFeViQfeNSSiDAllWffOjOFiD0fKk/ClwukylBnoZWKJqt1c u+fPX9F0YS+1cchDFZwpBysy8iILSJqaf+Ny8ER/J4XfqYwDb4kyNAfG1UEkY2JubGlD KaEtpKiTaavV1zx4Kz2ghyFotC6weGlY1sk6dW3M6dt14JjsnvrMfQlBTN3uxIlDQAIp nKru/lUhoHZs6qjO/DR1xJc8AhPyQjioBdo5TDLJv5nka35WsXlFqJsSmkc7TCl7Asm6 ZyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691401498; x=1692006298; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MkUdmOsdanYJRPaOBW+Sf9SKg08UmbFYSf2hDRsm7Ew=; b=gLqknskazrWYa06jlssfnOlyYw4GTBBAOUB9T18oTbu9r46297Z2MeGXJ+5zujIMZQ 7FPyMNVA2npKxOSlU8hvScYnPpDRgJoC9Krb6UoiEsOVBa6ixbNwjdo4cZUPlK9gUsqq pnqUCSXRCRIv5c5pRpxRA+KHTvaS6y/Ug6TyuZA+7ijFvT0tmui2NDUWfVtJbV0BKgBc Cl13FAYVUzmPRIKDR96bdrrUV4MQC4kwJAvV2/pONCiBKOWmCMfyKJ0Y7qMgbLs/Me0A PXddjIBoiCSOAVuqnDakx3WDy+TAyHAuR40FeiiYsgfPTBKMVN+pbTz3v956cJeIo3bt N9zA== X-Gm-Message-State: AOJu0YwgTl28Ao8vVtCsBX5dcaZF1Q/hS08i1jnUNY6WtfpS3M2NOsrs jAHGihaGPe/LQ2abrO/4Gqqj7kgacAb123mh X-Received: by 2002:a17:902:e5c2:b0:1bc:5e50:9345 with SMTP id u2-20020a170902e5c200b001bc5e509345mr3893259plf.50.1691401498021; Mon, 07 Aug 2023 02:44:58 -0700 (PDT) Received: from localhost.localdomain ([1.237.29.215]) by smtp.gmail.com with ESMTPSA id ji5-20020a170903324500b001bc445e249asm6424809plb.124.2023.08.07.02.44.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2023 02:44:57 -0700 (PDT) From: Hyeongtak Ji To: sj@kernel.org, akpm@linux-foundation.org Cc: damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Hyeongtak Ji , Hyeongtak Ji Subject: [PATCH] mm/damon: Prevent unnecessary age reset for regions Date: Mon, 7 Aug 2023 18:44:35 +0900 Message-Id: <1691401475-3796-1-git-send-email-hyeongtak.ji@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DAMON resets the age of each region after applying each scheme, regardless of whether the scheme has been successfully applied. This patch adds a simple condition to prevent the age of regions from being reset when schemes have not been actually applied. Signed-off-by: Hyeongtak Ji --- mm/damon/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 91cff7f2997e..4044fcf18ac1 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -908,7 +908,7 @@ static void damos_apply_scheme(struct damon_ctx *c, struct damon_target *t, quota->charge_addr_from = r->ar.end + 1; } } - if (s->action != DAMOS_STAT) + if (s->action != DAMOS_STAT && sz_applied > 0) r->age = 0; update_stat: -- 2.7.4