From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA832C35DF9 for ; Tue, 25 Feb 2020 10:25:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8637C20714 for ; Tue, 25 Feb 2020 10:25:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="llAXAobl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8637C20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BF9E6B0005; Tue, 25 Feb 2020 05:25:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 397876B0008; Tue, 25 Feb 2020 05:25:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AE156B000A; Tue, 25 Feb 2020 05:25:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0117.hostedemail.com [216.40.44.117]) by kanga.kvack.org (Postfix) with ESMTP id 140936B0005 for ; Tue, 25 Feb 2020 05:25:55 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BA6952496 for ; Tue, 25 Feb 2020 10:25:54 +0000 (UTC) X-FDA: 76528268628.03.skin49_338b0514e533c X-HE-Tag: skin49_338b0514e533c X-Filterd-Recvd-Size: 4378 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Feb 2020 10:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1582626354; x=1614162354; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=SBNXt18fiSDkKKFTHL/6fBU1JbEP1Jnn1oHT/2Qkjhc=; b=llAXAoblaH989jWHXuhP8RENMXwTjEbgCasvoBG/uku6AClmCKsE/ZIa y4xbP/NCqjyBF0u1spAKV+lXccRTZSaiWg9gpWseX+WnYMROGko5BwCHs +IoenAv3hn5BuAa9ILW1gIdk49lxyCxVJIJUdNh1wwtBU5zOk38a16OMY 8=; IronPort-SDR: c1MTE6zIDsERP/BMd3ciZjJLwc1BK/AFz+nddmSExjM4R59h+QVfYXDT8uBjP+/NwrlmNNO5iq 2rJjWWTD1niQ== X-IronPort-AV: E=Sophos;i="5.70,483,1574121600"; d="scan'208";a="27313402" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-c7c08562.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 25 Feb 2020 10:25:51 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-c7c08562.us-east-1.amazon.com (Postfix) with ESMTPS id BCFF124622A; Tue, 25 Feb 2020 10:25:41 +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.1236.3; Tue, 25 Feb 2020 10:25:40 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.53) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 25 Feb 2020 10:25:29 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v3 5/7] mm/damon-test: Add kunit test case for regions age accounting Date: Tue, 25 Feb 2020 11:22:58 +0100 Message-ID: <20200225102300.23895-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200225102300.23895-1-sjpark@amazon.com> References: <20200225102300.23895-1-sjpark@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.53] X-ClientProxiedBy: EX13D30UWC001.ant.amazon.com (10.43.162.128) To EX13D31EUA001.ant.amazon.com (10.43.165.15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- mm/damon-test.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mm/damon-test.h b/mm/damon-test.h index c7dc21325c77..2ba757357211 100644 --- a/mm/damon-test.h +++ b/mm/damon-test.h @@ -540,6 +540,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); @@ -556,6 +558,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