From patchwork Tue Oct 11 06:21:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Shaoqin" X-Patchwork-Id: 13003664 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 7A751C433F5 for ; Tue, 11 Oct 2022 06:21:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B950A6B0072; Tue, 11 Oct 2022 02:21:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B44AA6B0073; Tue, 11 Oct 2022 02:21:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0CBA6B0074; Tue, 11 Oct 2022 02:21:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8FC186B0072 for ; Tue, 11 Oct 2022 02:21:12 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5F8761C2D45 for ; Tue, 11 Oct 2022 06:21:12 +0000 (UTC) X-FDA: 80007671184.19.E23ACE9 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf15.hostedemail.com (Postfix) with ESMTP id C4B81A0022 for ; Tue, 11 Oct 2022 06:21:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665469271; x=1697005271; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TpLKzHcoPWVF/VzhAYmzp5p7rI6irdkZ0/MM0DfUOUY=; b=QDiOW7lXS31oGuR5VwSPgfouUK+eMKyH1yjjPP/jRRXzgP7wic6if+XJ VxAAZrXMCJOJnIsBgEP1xVfdjB+Ar7t/5D68XasSNpDUfyAGH3zplP0Ia ggOVQ9l4zXFhRCvUU0zQZACdNIBFyLmYqx7QCzh+KAgvvz2FqaAo8T6xy CVwtPSHomqeRtaIwLLKCeOnU4MiS1awBklnmEdmYYzO5s7IuhPjLqbmLP HmYDw/ZthW/fdISNm6cur9OaG+2SG4hEukDIL+Vok8Idg7w43XHEPPcEI Y0yRq0zaMAkBV5vPn783228lKVJVmgKr+4o2/EGYq/NMPvErhH9nkGWwz A==; X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="302029814" X-IronPort-AV: E=Sophos;i="5.95,175,1661842800"; d="scan'208";a="302029814" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2022 23:21:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10496"; a="577321945" X-IronPort-AV: E=Sophos;i="5.95,175,1661842800"; d="scan'208";a="577321945" Received: from q.bj.intel.com ([10.238.154.102]) by orsmga003.jf.intel.com with ESMTP; 10 Oct 2022 23:21:07 -0700 From: shaoqin.huang@intel.com To: rppt@kernel.org Cc: Shaoqin Huang , David Hildenbrand , Karolina Drobnik , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Rebecca Mckeever Subject: [PATCH v4 0/3] Add tests trying to memblock_add() or memblock_reserve() 129th region Date: Tue, 11 Oct 2022 14:21:19 +0800 Message-Id: <20221011062128.49359-1-shaoqin.huang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665469272; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=zeoQBGV3pKUudBmtDVYVPoWN13DvC42SOlkrtb5LDtA=; b=DJJVZ3znjCFW+PGsqwxIacq8CQtV7USuFdnnW6hFe4wf1urpKGq3iimRNn6gsYEsh9AjnJ wg5pHbYKdmk6Pwx7qkfJwbriu3Ravyya/OkKrA1KsyGwtGVj35uomaqfemcW03omvu8Xw8 uck9TV6QxWpgeKQ1GvR+tu5ECbz5GsM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=QDiOW7lX; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of shaoqin.huang@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665469272; a=rsa-sha256; cv=none; b=I+eH7Au8CMliBG3qqIqyhk6ShxkAnlsjA897VNXerOBkQAiTTeBnoFNyJFKUNf3De3IxG9 56hK9/bTjMuhO1maEXcUmEORzzh/CaVfpMNlAvO3rypZHSuVMBvNkvblRduE2vdYIJ0S7O T4chwsbVSTXrxLk80BU271VPcinxnfY= X-Stat-Signature: 4pexw9re5c78mc34het14opktppms7n5 X-Rspamd-Server: rspam09 X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=QDiOW7lX; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf15.hostedemail.com: domain of shaoqin.huang@intel.com designates 192.55.52.93 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com X-Rspamd-Queue-Id: C4B81A0022 X-HE-Tag: 1665469271-915955 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: Shaoqin Huang These tests is aimed for testing the memblock_double_array() can work normal. It will using the dummy_physical_memory_init() to add the valid memory region into the memblock.memory, and this memory region will be choosed when memblock_double_array() to allocate the new memory region to double the regions. Thus the new memory.regions or reserved.regions will occupy the valid memory region, and the memory.max and reserved.max also being doubled. Check all of these changed stuff, to make sure it actually success. Changelog: ---------- v4: - Increase the MEM_SIZE to SZ_32K. And makes the calculation process in memblock_add_many_check() more simpler. v3: - Avoid to allocated multiple memory region from dummy_physical_memory_base(), split the memory into different part instead. - Some comments improvement. v2: - Modify the get_memory_block_base() to dummy_physical_memory_base(). - memory_add() the memory which is allocated from dummy_physical_memory_init() instead of some faked memory. - Add more comments to illustrate the test process. - Add a function dummy_physical_memory_cleanup_many() to free multiple memory which is allocated from dummy_physical_memory_init(). Shaoqin Huang (3): memblock test: Add test to memblock_add() 129th region memblock test: Add test to memblock_reserve() 129th region memblock test: Update TODO list tools/testing/memblock/TODO | 11 +- tools/testing/memblock/tests/basic_api.c | 184 +++++++++++++++++++++++ tools/testing/memblock/tests/common.c | 7 +- tools/testing/memblock/tests/common.h | 6 +- 4 files changed, 196 insertions(+), 12 deletions(-)