From patchwork Tue Apr 7 10:00:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11477849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03768912 for ; Tue, 7 Apr 2020 10:03:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C450C20731 for ; Tue, 7 Apr 2020 10:03:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="lMX6r2J8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C450C20731 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 1A6698E001F; Tue, 7 Apr 2020 06:03:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1561A8E0001; Tue, 7 Apr 2020 06:03:08 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 094F28E001F; Tue, 7 Apr 2020 06:03:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0103.hostedemail.com [216.40.44.103]) by kanga.kvack.org (Postfix) with ESMTP id E54828E0001 for ; Tue, 7 Apr 2020 06:03:07 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A2AEC181AEF31 for ; Tue, 7 Apr 2020 10:03:07 +0000 (UTC) X-FDA: 76680620814.23.pan69_728daeb9c8b14 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=359b079f7=sjpark@amazon.com,,RULES_HIT:30004:30054:30064:30070,0,RBL:207.171.184.29:@amazon.com:.lbl8.mailshell.net-62.18.0.100 66.10.201.10,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: pan69_728daeb9c8b14 X-Filterd-Recvd-Size: 4507 Received: from smtp-fw-9102.amazon.com (smtp-fw-9102.amazon.com [207.171.184.29]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Apr 2020 10:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1586253787; x=1617789787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=C3a0ef6a18hPts2wj/nlFM3bY0Fh11hq6Un7xfBBjdc=; b=lMX6r2J8zfX5R0WCUCw0MkG60+CCNRC7e9Q23O21nLUOp+3eCYVfDeZL mJlSMEqS46rEziBc4DUK6cdYkNWdAVNzmXPPPv9DhcNJinWnuvPq8IdIB +qLd7ZhGsg787XYSld3xh6HwPPb3/cNewnR9pYePAh5ROlV+E4ugwhFt0 s=; 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 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) 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 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); }