From patchwork Fri Sep 2 02:39:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Shaoqin" X-Patchwork-Id: 12963574 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 2A82DECAAD3 for ; Fri, 2 Sep 2022 02:40:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2085800A6; Thu, 1 Sep 2022 22:40:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9CFBD8008D; Thu, 1 Sep 2022 22:40:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 897C7800A6; Thu, 1 Sep 2022 22:40:27 -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 79E888008D for ; Thu, 1 Sep 2022 22:40:27 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 40F4B1409A8 for ; Fri, 2 Sep 2022 02:40:27 +0000 (UTC) X-FDA: 79865591694.30.878B919 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf13.hostedemail.com (Postfix) with ESMTP id 350A620032 for ; Fri, 2 Sep 2022 02:40:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662086425; x=1693622425; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=impd6WjP2thIEehJI5+uZ5bcDT4a9RhBaFzwyQItnEg=; b=KnkXm7kbujZc7oiGOgGWOMjpDBE+0EjW2vSVEqh9tOdbaDYvks6dBljs c69iswhB8i+ZM8IVoyQrVttOpZKTzivaEZmahQCa70OeJvKHcPLSgSiUb AbrSUUxXJk/poU4HnghsJ+xsoPYYPuJH0s/JEd5HNEYDVA61qvc4PAvsg scOL5Sn8T59Zm1ysPSnnjPRKSP9hNmF5SGgOTLDW1HGuH2vTkribtmVb/ 7dKUprk9IbGTKJQuvq+l6XW9R9nKr0bSlcDy9lGs6P46psT4UZTRpxZXF pZQoqRV5d8V63GxcBugbpjoJf1pao5dGZ6hY0QkWALCNKytmB5s09X9mh Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="282862926" X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="282862926" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Sep 2022 19:40:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,281,1654585200"; d="scan'208";a="589841424" Received: from q.bj.intel.com ([10.238.154.102]) by orsmga006.jf.intel.com with ESMTP; 01 Sep 2022 19:40:21 -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 v2 0/3] Add tests trying to memblock_add() or memblock_reserve() 129th region Date: Fri, 2 Sep 2022 10:39:58 +0800 Message-Id: <20220902024007.58041-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=1662086426; 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=+C8DbvA0JYgmskp5I5Vp9roQEkEvtzfEO20ucKITZRY=; b=79hpp6YpWYqSHBPFGYtFkyrSPzMX8Or67NjSjutS62v0zn3tfKqRMj9g+5gnjLgaw/nlaB EEt/5JixKMRvS97rys51J3UY06gIir+e/C4FRA4Ia06uM1KX2KCSy7eaPJX7K8exMbiMAp C7NANE2ajxtY4haNVpFea9UQMee6hf4= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=KnkXm7kb; spf=pass (imf13.hostedemail.com: domain of shaoqin.huang@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662086426; a=rsa-sha256; cv=none; b=aKbwbKt9f48zUohUAQGLCAtLphdO6YmJbeMaBCqXm8cK8o0tgY+LX8Yv1VV9ZS07PuQUKO ofAx4LklA61lo4npVDipxOxD8rNcETgPZKcIJ0KASKn7zUKZO+3PBHWpQIRe5+xsh2OdfD UTu1m0zuHCNZdJezYQu5FJL/wygUYlY= X-Stat-Signature: k4ytfe5cmy13e4j7urndw64mhcfg658a X-Rspamd-Queue-Id: 350A620032 Authentication-Results: imf13.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=KnkXm7kb; spf=pass (imf13.hostedemail.com: domain of shaoqin.huang@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=shaoqin.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam05 X-Rspam-User: X-HE-Tag: 1662086424-558344 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: ---------- 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 | 187 +++++++++++++++++++++++ tools/testing/memblock/tests/common.c | 15 +- tools/testing/memblock/tests/common.h | 4 + 4 files changed, 206 insertions(+), 11 deletions(-)