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 52577C433EF for ; Mon, 7 Mar 2022 18:17:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D48ED8D0002; Mon, 7 Mar 2022 13:17:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CFB1A8D0001; Mon, 7 Mar 2022 13:17:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE7B48D0002; Mon, 7 Mar 2022 13:17:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0042.hostedemail.com [216.40.44.42]) by kanga.kvack.org (Postfix) with ESMTP id B0EE58D0001 for ; Mon, 7 Mar 2022 13:17:48 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 44C0C18290290 for ; Mon, 7 Mar 2022 18:17:48 +0000 (UTC) X-FDA: 79218398616.31.407252B Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf08.hostedemail.com (Postfix) with ESMTP id B6607160008 for ; Mon, 7 Mar 2022 18:17:47 +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 dfw.source.kernel.org (Postfix) with ESMTPS id E743B61303; Mon, 7 Mar 2022 18:17:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4266C340EF; Mon, 7 Mar 2022 18:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646677066; bh=dMWp6dfQJtApHFoFC3z+P98pDL4OG/wx5oadmxcaPis=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OIxM0K85f+JVS/L67FAjImn0M27vXFzXTv1ztgL0e7bGZpqH0SyHoVLe68pcrUiFy dcAha3/uiXXtm1sY8TTz5KJEbybp29slUmowOOYI7RxDEIv9oWTTa2phq8uesmGcYt ktEHg7rUPBvc/e+l3MiBoPMLAblYN1Nx1YBQ0+fImgSLu2PLysP9Hc2pa1rKY8NTK0 m7+9Wdh0UxTUyIo7fW4Rd0cHYneXA0FmsRW/9r0rTkKoNSA6xTzDUVBoPzYx9bTzvE Tv6XF3aifzczfQ7pWghfSGy7Hr2ATtx+/uXvef9A9lWNQH/CExZ7rFq/5kV2HpdYJT xK3IFyenJYE8w== Date: Mon, 7 Mar 2022 20:17:39 +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-Rspamd-Queue-Id: B6607160008 X-Stat-Signature: ghxuewzxwdgakjr799p3xkigre55zxb5 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=OIxM0K85; spf=pass (imf08.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1646677067-82011 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: 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. The only think that I'd really like is to wrap the lines longer that 80 characters. (scripts/checkpatch.pl --max-line-length=80 can help with that) > [1] https://lore.kernel.org/linux-mm/cover.1643796665.git.karolinadrobnik@gmail.com/ > > Karolina Drobnik (9): > memblock tests: Split up reset_memblock function > memblock tests: Add simulation of physical memory > memblock tests: Add memblock_alloc tests for top down > memblock tests: Add memblock_alloc tests for bottom up > memblock tests: Add memblock_alloc_from tests for top down > memblock tests: Add memblock_alloc_from tests for bottom up > memblock tests: Add memblock_alloc_try_nid tests for top down > memblock tests: Add memblock_alloc_try_nid tests for bottom up > memblock tests: Add TODO and README files > > tools/testing/memblock/Makefile | 3 +- > tools/testing/memblock/README | 114 ++ > tools/testing/memblock/TODO | 28 + > tools/testing/memblock/main.c | 7 + > tools/testing/memblock/tests/alloc_api.c | 742 +++++++++++ > tools/testing/memblock/tests/alloc_api.h | 9 + > .../memblock/tests/alloc_helpers_api.c | 393 ++++++ > .../memblock/tests/alloc_helpers_api.h | 9 + > tools/testing/memblock/tests/alloc_nid_api.c | 1167 +++++++++++++++++ > tools/testing/memblock/tests/alloc_nid_api.h | 9 + > tools/testing/memblock/tests/basic_api.c | 49 +- > tools/testing/memblock/tests/basic_api.h | 1 - > tools/testing/memblock/tests/common.c | 33 +- > tools/testing/memblock/tests/common.h | 21 +- > 14 files changed, 2550 insertions(+), 35 deletions(-) > create mode 100644 tools/testing/memblock/README > create mode 100644 tools/testing/memblock/TODO > create mode 100644 tools/testing/memblock/tests/alloc_api.c > create mode 100644 tools/testing/memblock/tests/alloc_api.h > create mode 100644 tools/testing/memblock/tests/alloc_helpers_api.c > create mode 100644 tools/testing/memblock/tests/alloc_helpers_api.h > create mode 100644 tools/testing/memblock/tests/alloc_nid_api.c > create mode 100644 tools/testing/memblock/tests/alloc_nid_api.h > > > base-commit: f30b002ccfee8c60c8feb590e145c0b5e8fa4c67 > -- > 2.30.2 > -- Sincerely yours, Mike.