From patchwork Tue Sep 13 06:41:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Shaoqin" X-Patchwork-Id: 12974467 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 CF93DC54EE9 for ; Tue, 13 Sep 2022 06:42:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52A376B0072; Tue, 13 Sep 2022 02:42:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D9B08D0002; Tue, 13 Sep 2022 02:42:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A1AD8D0001; Tue, 13 Sep 2022 02:42:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 2B0266B0072 for ; Tue, 13 Sep 2022 02:42:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 08148ABAC7 for ; Tue, 13 Sep 2022 06:42:19 +0000 (UTC) X-FDA: 79906117998.29.F3263A4 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf21.hostedemail.com (Postfix) with ESMTP id 7967F1C00AE for ; Tue, 13 Sep 2022 06:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663051338; x=1694587338; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=QwXKFHrSvUaOG3T1uuNRHZ6TdyYNDc9HukCFi5JLdbY=; b=c+hvF97e6jkhlwXNvIFAF3Q68hrFDTSYkBARGqg8PFgX+09s0uHZL0UL 07G/D6X7+yRRxuzarEpDGS5cUYLm2U+Oi3nyRfRgOMnIFarPemvHcSPdE X8WPW+VnZ1jcp6ON7j02krK4Wl04NpOGoaQEY05mU5ZQBQNc1CJYZryeH JjC34SuSjwr1o9/gtH5pXLQ5e25B7I7WGY2OajeIqvJpJMgq5JZ9xhZD0 fb9oTQSc+TDFqa4NvSgfPYyaiXTf6brRD58apx5VORCBjKsDTviLeuJO+ 8zdQQmh0bwLsaMgqo7zdkCNA8N1dcfB7abUd1f3ZVMq+CRI7Ogwbu28fz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="298851467" X-IronPort-AV: E=Sophos;i="5.93,312,1654585200"; d="scan'208";a="298851467" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 23:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,312,1654585200"; d="scan'208";a="678428674" Received: from q.bj.intel.com ([10.238.154.102]) by fmsmga008.fm.intel.com with ESMTP; 12 Sep 2022 23:41:43 -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 v3 0/3] Add tests trying to memblock_add() or memblock_reserve() 129th region Date: Tue, 13 Sep 2022 14:41:29 +0800 Message-Id: <20220913064138.407601-1-shaoqin.huang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663051338; a=rsa-sha256; cv=none; b=4DmZqWQSR7rfIjiZr9BoJVroSdhx4gJBxLhUDW4EXe5OoT46FQhvRUurJMxxfxh0jEf/4X wKqgqc9Nx5I0xUlZgv0BSpoYjkSdirYiiBGUsiGcFjgWmOyUx5Xr3Zz7Qg2RGUIPmqxeem pooi4lxATSRfT3Qj6MbAGv0YXQX+Z/Q= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=c+hvF97e; spf=pass (imf21.hostedemail.com: domain of shaoqin.huang@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663051338; 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=vy+4xP5pYM01nuxz/91eOmnUsuDrW+Rh3YIy03MAoCc=; b=JDePcohtSDoNYnPS3a5vCLbjt7iTokzgKvrtJx3LAeFjMYXd3+/3czCfQ+QFjGeeAOF1Mg vXQLypvPBMsRReiXYUlU7+i0fHcyPCetG9GUSCNeuEQnnmcy18BX0o1W7H7EbAOhU1tgMc hWLoREr+DGV3z0BBjjxnM18+dlOiluc= X-Stat-Signature: 79ai6q5bmsbho4qn49jn3adb75oi5q7x X-Rspamd-Queue-Id: 7967F1C00AE Authentication-Results: imf21.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=c+hvF97e; spf=pass (imf21.hostedemail.com: domain of shaoqin.huang@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1663051338-617868 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: ---------- 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 | 186 +++++++++++++++++++++++ tools/testing/memblock/tests/common.c | 7 +- tools/testing/memblock/tests/common.h | 3 + 4 files changed, 196 insertions(+), 11 deletions(-)