From patchwork Wed Sep 7 08:26:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 12968613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C40C2C38145 for ; Wed, 7 Sep 2022 08:22:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 048606B0072; Wed, 7 Sep 2022 04:22:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F3ADB6B0073; Wed, 7 Sep 2022 04:22:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2A326B0074; Wed, 7 Sep 2022 04:22:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D04A86B0072 for ; Wed, 7 Sep 2022 04:22:27 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id A350F1C5D3D for ; Wed, 7 Sep 2022 08:22:27 +0000 (UTC) X-FDA: 79884597534.26.4A4100D Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf13.hostedemail.com (Postfix) with ESMTP id A156D20077 for ; Wed, 7 Sep 2022 08:22:26 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MMwDW1YlyzHnmF; Wed, 7 Sep 2022 16:20:27 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 7 Sep 2022 16:22:21 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 7 Sep 2022 16:22:21 +0800 From: Kefeng Wang To: Andrew Morton , CC: Mike Rapoport , David Hildenbrand , Oscar Salvador , , "Vlastimil Babka" , Kefeng Wang Subject: [PATCH v2 4/3] memblock tests: add new pageblock related macro Date: Wed, 7 Sep 2022 16:26:43 +0800 Message-ID: <20220907082643.186979-1-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 Reply-To: <20220907060844.126891-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662538947; a=rsa-sha256; cv=none; b=GPgMFeiujILkzYPLMKKSSgE67JVd4ruimHpxFhef5TD6pA0WXYmfjKcHbJKAEy6EkGlyq5 zAr0UBwKDZvbXTsDMlLLBcRnQKkBVODiwf4xZHLXje12RFbOXqBR6FgvwMQFoJdDIt1HOZ ElGP8jtvxOpfn5bNbgqOS0ihQNZsSSc= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662538947; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=UlMbw9RZfpoog9x9U6HzuaGBxpxo23Dvd0KTISUEr2o=; b=m8UIsy7lLOsGLpF5na1uNRH+HfnbofbygOn9KyVytWdOw76uVMpO084GvrHqYHRvQYrY/F iX2S3evvy4Y8FHWdaZ/jHjahaoxGcdFGmFlDmFsrigbw6l0BavZspFYAQaN59zJy8Al9PH z5ayxMSKcbVo9ev7BfuS8UP3L+W9G9Y= X-Stat-Signature: utsymxcqcmppkmxq4g75naq1kmweshfo X-Rspamd-Queue-Id: A156D20077 Authentication-Results: imf13.hostedemail.com; dkim=none; spf=pass (imf13.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam01 X-Rspam-User: X-HE-Tag: 1662538946-185942 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: Add new pageblock_start_pfn() and pageblock_align() macro which are needed by memblock tests. Signed-off-by: Kefeng Wang --- tools/testing/memblock/linux/mmzone.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/memblock/linux/mmzone.h b/tools/testing/memblock/linux/mmzone.h index 7c2eb5c9bb54..e65f89b12f1c 100644 --- a/tools/testing/memblock/linux/mmzone.h +++ b/tools/testing/memblock/linux/mmzone.h @@ -22,6 +22,8 @@ enum zone_type { #define pageblock_order (MAX_ORDER - 1) #define pageblock_nr_pages BIT(pageblock_order) +#define pageblock_align(pfn) ALIGN((pfn), pageblock_nr_pages) +#define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages) struct zone { atomic_long_t managed_pages;