From mboxrd@z Thu Jan 1 00:00:00 1970 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 BE2A0C433EF for ; Wed, 9 Mar 2022 15:10:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF3188D0003; Wed, 9 Mar 2022 10:10:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA2058D0001; Wed, 9 Mar 2022 10:10:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C902D8D0003; Wed, 9 Mar 2022 10:10:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id B662C8D0001 for ; Wed, 9 Mar 2022 10:10:56 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 8C46424DEA for ; Wed, 9 Mar 2022 15:10:56 +0000 (UTC) X-FDA: 79225185312.08.5912450 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id 0A7E740017 for ; Wed, 9 Mar 2022 15:10:55 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0CFF2B81EF7; Wed, 9 Mar 2022 15:10:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31437C340E8; Wed, 9 Mar 2022 15:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646838652; bh=P2x4+Ep7O5rS0M2KrtqxlQ9I5htAqM8Deh5DCXksjwU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jCPE9eLnYiohiFAKw8Zwg1qWKkUALo0MqDBqAorJzlDiaI4z0gXHlU3dVEo0fIGM8 cfY8e9bKcD6+ama1Yce3X5TcvdBVXnxC6UtfD1kfnDp/oLzjgWOdHD+RpdoUiC2QtQ Xwp5IRApWgQThZdzEYT0aXR/58P/VeqsrqE4GO7ef7lfe4TGP/tZ1JOnl1cTME2BBT Elhz24BtPeNvcVovfbnAn/JWAh8STPRLa1SIpvZQljnGcIYlb8ZSX8UitM3BmGbL1Q oitt2yzYHv4pxt+Bpw8OlA7mXlWdKn2T/94X0ufbNNTu3XN4GwhXkrHnAmCBpgl401 xatSbL4MDIKrg== Date: Wed, 9 Mar 2022 17:10:45 +0200 From: Mike Rapoport To: Karolina Drobnik Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/9] Add tests for memblock allocation functions Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 0A7E740017 X-Stat-Signature: 8houst8a5adwaqcdr6qza9ne1fturumm Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=jCPE9eLn; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org X-HE-Tag: 1646838655-480866 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: On Mon, Mar 07, 2022 at 08:17:39PM +0200, Mike Rapoport wrote: > Hi Karolina, > > On Mon, Feb 28, 2022 at 03:46:42PM +0100, Karolina Drobnik wrote: > > Patches are on top of memblock/for-next. > > > > This series adds test coverage for memblock allocation functions that return > > virtual addresses: > > * memblock_alloc > > * memblock_alloc_try_nid > > * memblock_alloc_from > > > > These tests are a part of memblock simulator, a user space test suite that uses > > the actual memblock code[1]. All the tests are run as one, monolithic test, that > > exercises both basic operations and allocation functions of memblock. > > > > To simplify implementation of the memory allocation tests, reset_memblock() was > > split into two functions - reset_memblock_attributes() and > > reset_memblock_regions(). The former sets default values for region array names, > > allocation direction flag (bottom_up) and current memory limit. The latter only > > resets region arrays and corresponding counters. > > > > In addition to these, the patch set introduces a data structure that simulates > > physical memory, test_memory. It is a simple wrapper around a pointer to the > > memory block allocated via malloc(), which is added to memblock as available > > memory. This is required because the tested functions interact with the memory > > before allocating it. > > > > Patchset structure: > > * Patch 1 splits reset_memblock() into two functions - > > reset_memblock_regions() and reset_memblock_attributes(), and updates > > basic API tests to use the new definitions > > * Patch 2 adds test_memory struct and functions to add (or release) dummy > > physical memory > > * Patches 3 - 8 add test cases for memblock_alloc, memblock_alloc_try_nid and > > memblock_alloc_from for both allocation directions (default top down and > > bottom up) > > * Patch 9 adds README and TODO files > > Except for few minor comments about README and TODO these patches look good > to me. I went ahead and applied this series with some formatting fixes.