Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2652811ybk; Tue, 12 May 2020 04:59:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJdhw08XUZji3zy44dHPO+9nWlT9x4RVvf5w4HIy0vDXgvY88q8QFq8hTSE5DEpo8bLpxmF X-Received: by 2002:aa7:c606:: with SMTP id h6mr17810113edq.265.1589284771486; Tue, 12 May 2020 04:59:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589284771; cv=none; d=google.com; s=arc-20160816; b=s1WdCzUj4qT6gq7/7XhLtxYmYbOg5DJEsOPgidyIGAsWnuIl0MH6Le9YHfA7eXgVsK urWq0X9+pulCWhGr3Lk1GHBhGpEBOJgK5sGiQ+iHqkLkUXfgX02MS63mJrRroMZfa0Iw WQnDoWmU5KttgXKU/s9kjs0/Vqn+1/n1N9MtTAMts+i9YIgj6PRb1EupmYXcQ4u5F1hV MU1QVm979Kk4ilKFkLAww8UyvvzD8hKiSCSx/QA2mEIQ4mMJfurJSa/kY2sfNHIdgCN+ zyZTV2HOovJnW7mzxBYUYhX9xGNi3YCo7qD9hVp6jXwFHIuwyBxz4zwkqBQjKzvdPo2u JGlQ== 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=TuErZGYEF/r+cILDRcbHLjrkMjcNpTWU7RttOJ6Gqis=; b=jzFHTwovl/RhZuzWBgxez9S6hKQtEHtIQE5YLBoh4RyX6EIjCJIWdg+FgkV09wkmVc RquwGciG148Dqpdyp+80+2Yqpi0TzxAab354oeuNSC/m2V3Ns/muGZbvWUPCBe2/ZWwA 35B1JrqNHSODqVajX1qiZSM+/INIFsm/oO2kKrU5NI1skOzBQNbgJGfsoSJHWqsAy90C reTgfu101SQMmlGKkayH4PcUa4Tlh6jqVJdY+zCXNaSUovHAruV1NEwkzVJUdTyWB88U B0VpBjsewKaBh+oV9GPMjNDPE5NzpKZBEuFOP6bcHn3UzAcRiws1gOAm1Ldnycf3crOf jfZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=mBs0GJsN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id jo2si897359ejb.197.2020.05.12.04.59.07; Tue, 12 May 2020 04:59:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=mBs0GJsN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729767AbgELL5R (ORCPT + 99 others); Tue, 12 May 2020 07:57:17 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:63192 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgELL5R (ORCPT ); Tue, 12 May 2020 07:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1589284637; x=1620820637; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=TuErZGYEF/r+cILDRcbHLjrkMjcNpTWU7RttOJ6Gqis=; b=mBs0GJsNyuzO/StSCI01xvHXeUhFVw4n+11n9+uxxnpLkZPMKdR+SsgS 27nyISLACZM7CDuqzoVPzd7MGPggeLmYZghlKFwX0tfDwfwKh1i38YO57 MTZOu9UaPOF29FE7YY9bPThNZYv8XKhoGYDYjQlK46y89dp5RvrlRDp/F Q=; IronPort-SDR: VWl3qAAAXMla1WDe1JTw39mfWCZTOKYjyvjS9Ed/vVzmlphe9r23FiDhX2eydYmwDFUa0I5jXn TC315Tp7TifQ== X-IronPort-AV: E=Sophos;i="5.73,383,1583193600"; d="scan'208";a="29889184" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2c-168cbb73.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 12 May 2020 11:57:13 +0000 Received: from EX13MTAUEA002.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2c-168cbb73.us-west-2.amazon.com (Postfix) with ESMTPS id 3AF73A2125; Tue, 12 May 2020 11:57:10 +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, 12 May 2020 11:57:09 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.160.100) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 12 May 2020 11:56:54 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v8 5/8] mm/damon-test: Add kunit test case for regions age accounting Date: Tue, 12 May 2020 13:53:40 +0200 Message-ID: <20200512115343.27699-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200512115343.27699-1-sjpark@amazon.com> References: <20200512115343.27699-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.160.100] X-ClientProxiedBy: EX13D17UWB003.ant.amazon.com (10.43.161.42) 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 851c2062a480..c7a7f3b9b57f 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -551,6 +551,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); @@ -567,6 +569,9 @@ static void damon_test_merge_regions_of(struct kunit *test) r = __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