Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4212517ybb; Tue, 7 Apr 2020 03:03:58 -0700 (PDT) X-Google-Smtp-Source: APiQypKAJslFCmpr1kxpqfQrDSbvC1BXWqq1J9RCSk5wgsf5pP5R7z9VzWFVYu4vns9YBc+eiWMq X-Received: by 2002:a9d:4ee:: with SMTP id 101mr843765otm.301.1586253838426; Tue, 07 Apr 2020 03:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586253838; cv=none; d=google.com; s=arc-20160816; b=HTodHLJCBGHf3QGzg1C+EfX9zdYfEOHIHRZHwePt48OOb+nbmSh0NdrfWNJYMZySMz fw6BFdbeCzX/I1B2ml43DIamOnGtbA23URLoBDwvcxa4F8FHuSZ+DRRps+rf0Qw6DPMn eX1SJ5I0tPSScZtQV39aPBxbNvnFJpjNPlQ2Eq2k6sNl/yBD2Z50hgjd/KhBHh0Gvb7d dj7AHxyVhfCrPSg1aCxw0COEn2fddMQ4Zvi3lqJ0KqPdL5C9E3M6zqxTaJ/3zYn+TNQC 9R/QMpXfw7f8EHJEpOQRrVlB7SRJBuAjfz0i6QJCAgLHACCJHL4Dy8lLd1ybk/hptZSs T2Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=C3a0ef6a18hPts2wj/nlFM3bY0Fh11hq6Un7xfBBjdc=; b=z0ew0a+OMW7CjRCY52kTEQ8JpSglBntFciphdxTOh6QZ/BObJsSX26Fr2eUk0XSTKa 2hsc6SWq+9tVgktA/dBXjaLGHHePk86cMxgPgcWApFyXcQTHAEgyPv18dgydovQDi42n 5XflT5aTHoS3kL5jodkXPX5JedPGW9orvssZJzmpLzsMCrL3S1FP66whkl2IkxG2URM6 xORS7aAUukSgq4WssLD/FFqZj0AYvX2muM2dA573i8l4xfjtIJ8cgzJUyOKn4mGFX9HG KU3Ps/WLuDFzKy5wew6laxi/djMyqyc12cMSQucynroN95A9GD7e7EkDJ0pDkAUKEiY0 7P/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ZKVDUsc5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z17si920638oth.282.2020.04.07.03.03.46; Tue, 07 Apr 2020 03:03:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=ZKVDUsc5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728278AbgDGKDI (ORCPT + 99 others); Tue, 7 Apr 2020 06:03:08 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:20136 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726562AbgDGKDI (ORCPT ); Tue, 7 Apr 2020 06:03:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1586253786; x=1617789786; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=C3a0ef6a18hPts2wj/nlFM3bY0Fh11hq6Un7xfBBjdc=; b=ZKVDUsc5RAbCnsfGiZQqNFbfcIxh+14uf/FH4qfmQoFxHz32dtnO9uPX zHD6D0VGdTUIsaeGziK6MtmzP7/6/b/QdCyaCXa7BCfmlO07Qr0LUCsqf e5bb0xEZK9oFw1riPFkmnBIqWvRmgP82jH9H0VSQ1qK4tOPFkUohYn/Wb w=; IronPort-SDR: +yp07F8D8M4d2yM2xdEW8abMijFYro2/BxtDuw7K+CY+YzQ253f/2mp6Lg9vMj78dEYUe1ZI5h fnJNBt9RjRYw== X-IronPort-AV: E=Sophos;i="5.72,353,1580774400"; d="scan'208";a="35693334" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 07 Apr 2020 10:03:04 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan3.pdx.amazon.com [10.170.41.166]) by email-inbound-relay-2a-90c42d1d.us-west-2.amazon.com (Postfix) with ESMTPS id 966DFA1F80; Tue, 7 Apr 2020 10:03:00 +0000 (UTC) Received: from EX13D31EUA001.ant.amazon.com (10.43.165.15) by EX13MTAUEA002.ant.amazon.com (10.43.61.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Apr 2020 10:03:00 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.171) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 7 Apr 2020 10:02:46 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v6 5/7] mm/damon-test: Add kunit test case for regions age accounting Date: Tue, 7 Apr 2020 12:00:04 +0200 Message-ID: <20200407100007.3894-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407100007.3894-1-sjpark@amazon.com> References: <20200407100007.3894-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.171] X-ClientProxiedBy: EX13D34UWA002.ant.amazon.com (10.43.160.245) To EX13D31EUA001.ant.amazon.com (10.43.165.15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park After merges of regions, each region should know their last shape in proper way to measure the changes from the last modification and reset the age if the changes are significant. This commit adds kunit test cases checking whether the regions are knowing their last shape properly after merges of regions. Signed-off-by: SeongJae Park Reviewed-by: Brendan Higgins --- mm/damon-test.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/damon-test.h b/mm/damon-test.h index 2b6b1fee928d..af6a1e84b8eb 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -538,6 +538,8 @@ static void damon_test_merge_regions_of(struct kunit *test) unsigned long saddrs[] = {0, 114, 130, 156, 170}; unsigned long eaddrs[] = {112, 130, 156, 170, 230}; + unsigned long lsa[] = {0, 114, 130, 156, 184}; + unsigned long lea[] = {100, 122, 156, 170, 230}; int i; t = damon_new_task(42); @@ -554,6 +556,9 @@ static void damon_test_merge_regions_of(struct kunit *test) r = damon_nth_region_of(t, i); KUNIT_EXPECT_EQ(test, r->vm_start, saddrs[i]); KUNIT_EXPECT_EQ(test, r->vm_end, eaddrs[i]); + KUNIT_EXPECT_EQ(test, r->last_vm_start, lsa[i]); + KUNIT_EXPECT_EQ(test, r->last_vm_end, lea[i]); + } damon_free_task(t); } -- 2.17.1