Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2019921rwb; Sun, 18 Sep 2022 20:18:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pZfgb+3/6LB+iMheOAQplC4go2UabueM2yCZrt3bjXjChZsaADIwtpa6/2TcjP9DGwGXd X-Received: by 2002:a17:907:a05:b0:77b:b538:6476 with SMTP id bb5-20020a1709070a0500b0077bb5386476mr11683900ejc.324.1663557509425; Sun, 18 Sep 2022 20:18:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663557509; cv=none; d=google.com; s=arc-20160816; b=nA3sDi9k4wZf4Ac2Wi0QBVMHUZ2ry1qCgck1sDbNjitZiAi/nbGlue+HGRiWehJ8ES C30LH1ksoWqIQsCs+o7d/ANpvN5Z1y6KYNAiWmF7PAtyOQMFGYdWQ7s98kafHhIpMPv/ 7XaJHaS/v1QM9ZIc6lRVdoeIdoli2O9Hvi21x5WmppKOblE8+gTgxN9/4aqMP6RHVLi0 3b0KGCEIxtluRRYTvJ5K55K9wTTe/0z47p7P6e5t229rUl2nXQpVQP5rzYx9YxmJYufO +kTSvcst7Pfvnhc5yFt/Is58ZDvzpnQ1DLz73fyo1+Sl9I+z41av9IkG9wVmArQWScTO tlrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zeoQBGV3pKUudBmtDVYVPoWN13DvC42SOlkrtb5LDtA=; b=yKwiGmkPfMrbEWScMws7eeFECvldqU8HsfdhIAHmHTMyoUYaln9w4I7kTAmhctddLQ 9PV7Pum12I4Wd0BOE67aRdxmBGIiAOLHR7ci6VCvq841XVb+K0rMN5UZgmWkfI06kNUT 4o248MOHy+D+Q87OD0tb/7lSh/kc4zvDkLGXgNe5ALyOoAPYD+8Ef5U4o+n0fd21U5Xi dJ1uDF76riohxUP9tv3BOxRPXO7yO68hPJgi1sZD0r8k6RaAKz+sUTNSZS/H+MR4mUDx w9HdUIGJScrB4Lz1w257aXn8EFonNloD6lxUCHE52wpHj2xQ/uiH36GJceH9/oPDsQsW 85Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nOHxQaoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a170906538900b007419cc73107si20458676ejo.757.2022.09.18.20.18.05; Sun, 18 Sep 2022 20:18:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nOHxQaoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbiISCtX (ORCPT + 99 others); Sun, 18 Sep 2022 22:49:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbiISCtQ (ORCPT ); Sun, 18 Sep 2022 22:49:16 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E563A19C25 for ; Sun, 18 Sep 2022 19:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663555753; x=1695091753; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=TpLKzHcoPWVF/VzhAYmzp5p7rI6irdkZ0/MM0DfUOUY=; b=nOHxQaoIUNtVKzmi3HtQpVmAMtXUfMPpgxrNwc38KiMGWH1EDoWOFP15 /Ita435TilJUYd86JRAJZSvraRTdY3a1hDqoyZ2xTmdisn2nvuGRyHakk J9WFKP+MPL8EKYzN+1AxOx30Uq6sMAMlrlXpjpG7U9n8KFbsAzD782p85 i0PWkZhh/MXYIrNBCoW6HXchLsWQtQcK25kWag7Z2CAtxoypT/6WmyybI HueJJt5lYM6lIetL8/rGJNuiOZE8KEI7lLa6UWL+KGOYZAWykJQFSUZI0 tP5llP2fxirgYXrsy8uQwMeOnXFJK0Qi8O6KVQtIpscnW5Qo56lqqBCny w==; X-IronPort-AV: E=McAfee;i="6500,9779,10474"; a="299283404" X-IronPort-AV: E=Sophos;i="5.93,325,1654585200"; d="scan'208";a="299283404" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2022 19:49:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,325,1654585200"; d="scan'208";a="947035156" Received: from q.bj.intel.com ([10.238.154.102]) by fmsmga005.fm.intel.com with ESMTP; 18 Sep 2022 19:49:05 -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: Mon, 19 Sep 2022 10:47:36 +0800 Message-Id: <20220919024745.153395-1-shaoqin.huang@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.34.1