From patchwork Mon Mar 30 11:50:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 11465373 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 DE97B912 for ; Mon, 30 Mar 2020 11:53:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB70C2072E for ; Mon, 30 Mar 2020 11:53:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="fetqkCZL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB70C2072E 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 F16666B0037; Mon, 30 Mar 2020 07:53:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E9F966B006C; Mon, 30 Mar 2020 07:53:33 -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 D8EF26B006E; Mon, 30 Mar 2020 07:53:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id C1B106B0037 for ; Mon, 30 Mar 2020 07:53:33 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 95B5F4DAB for ; Mon, 30 Mar 2020 11:53:33 +0000 (UTC) X-FDA: 76651868706.21.pen06_1f05d1115921e X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=35199640c=sjpark@amazon.com,,RULES_HIT:30004:30054:30064:30070,0,RBL:207.171.184.25:@amazon.com:.lbl8.mailshell.net-66.10.201.10 62.18.0.100,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:24,LUA_SUMMARY:none X-HE-Tag: pen06_1f05d1115921e X-Filterd-Recvd-Size: 4515 Received: from smtp-fw-9101.amazon.com (smtp-fw-9101.amazon.com [207.171.184.25]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Mon, 30 Mar 2020 11:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585569214; x=1617105214; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=X7XZgTBG3r8ae/hVZRlfEM88z2uthMQbepVKl7zl3ag=; b=fetqkCZLGBPpG8kKNFGIytNHtE9vS9DIZ6osj712Iw/DTfmtJ7o66G+V JsrR/GWs9n+HXCJ6sJkB/6s/Ux5kc8O7OUl5e7GdHBQqgb6p8dB+xnGqC DfpZO2zY2BmgTgPr4iYVtZFnUe1gICDcuian/9E3MtcHQfsk7mnsf06Qp k=; IronPort-SDR: Fju6uQ6d5Mf51ryyZ4YfNFms8Kav+dx2SxD5EnQeZ5qDARrjBDJpAa6drwWwSqqRq4SgUNU25m MmXQxdqtJQeQ== X-IronPort-AV: E=Sophos;i="5.72,324,1580774400"; d="scan'208";a="25842625" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 30 Mar 2020 11:53:31 +0000 Received: from EX13MTAUEA002.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-303d0b0e.us-east-1.amazon.com (Postfix) with ESMTPS id 7F6CDA2BC8; Mon, 30 Mar 2020 11:53:19 +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; Mon, 30 Mar 2020 11:53:18 +0000 Received: from u886c93fd17d25d.ant.amazon.com (10.43.162.134) by EX13D31EUA001.ant.amazon.com (10.43.165.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Mar 2020 11:53:04 +0000 From: SeongJae Park To: CC: SeongJae Park , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC v5 5/7] mm/damon-test: Add kunit test case for regions age accounting Date: Mon, 30 Mar 2020 13:50:40 +0200 Message-ID: <20200330115042.17431-6-sjpark@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200330115042.17431-1-sjpark@amazon.com> References: <20200330115042.17431-1-sjpark@amazon.com> MIME-Version: 1.0 X-Originating-IP: [10.43.162.134] X-ClientProxiedBy: EX13D37UWC003.ant.amazon.com (10.43.162.183) 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 498c637b78ff..133de6c70c37 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); }