From patchwork Wed Oct 19 18:34:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rebecca Mckeever X-Patchwork-Id: 13012271 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 B8A1FC433FE for ; Wed, 19 Oct 2022 18:35:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C70F6B007D; Wed, 19 Oct 2022 14:35:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 577F56B007E; Wed, 19 Oct 2022 14:35:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 43F8D6B0080; Wed, 19 Oct 2022 14:35:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 344B66B007D for ; Wed, 19 Oct 2022 14:35:03 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id F053AC0EC3 for ; Wed, 19 Oct 2022 18:35:02 +0000 (UTC) X-FDA: 80038550844.06.2929BDD Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) by imf04.hostedemail.com (Postfix) with ESMTP id 8827C40036 for ; Wed, 19 Oct 2022 18:35:02 +0000 (UTC) Received: by mail-qt1-f196.google.com with SMTP id g11so12286448qts.1 for ; Wed, 19 Oct 2022 11:35:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3m/4y2MR8gwHAVKXn6zWeuE8EVdOtK5C6kZLltneEHw=; b=O8Wcj3siSaLUiNoAxNd7BSOg8sMUmChv4yD97G66TuQCFi1qqHnZOHyI+nNCFyjP4i GRNt2RuZwgV9JKMfqFAzEsLeUjymGFqIT+8RDtKlzQFpFAWkEKTGZm6Cce9TW/58S+lu RafzkGJ7dI0FtIE2qvCFWAXdGGDa+YAIru4m4Wz+VCdC4+OwCS/xq1jmqe6ZkC+1OGOu ydzeo/BuwDy6cyqI2ocdR3N06cpGcSGGRJrbW8CYxRNo2SbOtIf31mbiDPNuR/UorXiY 66JpMoZ0cWDzTQoi6TmhRfbOVwmlEsoPhP4itaN4RSNqyVruts8FilGD8HvVZTb+33Cy efmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3m/4y2MR8gwHAVKXn6zWeuE8EVdOtK5C6kZLltneEHw=; b=jQZtzw5wUmN1vIctlU7aYT5k37xIje+OCkOraXd0otgymPORYUUkfSZzQ6sJyq+lHW BGCVaUKR3370RprSAL6KoaAKLfeFDvpyHNMZn/pmPHBzuUHvaZkspkR/rO/jfD8NtBuL gcjZ9U2qZ0THZ/M0PbLdV8LHx+pS4evSarJs8VNv7/fLgsm0LcHK6xy217miqWT9d+p4 uBbJQXjjpK9TH9L62F8p419HRi7aGe1otWl1ewik5ovX8Ldc2Sr+C8B/DvB/JwNsFyna 4YwJ3u91PnpC/hI+4SpH9ozn5vb9OwriRu+HOZBxnf39d+Gw5whXhA+G+0+Q+j9Hjbp3 7HWQ== X-Gm-Message-State: ACrzQf0+X2Tw/3ZOAbM9l11KihT+qktaHOkd+aHz9JseZnoovFdIiJrG JZHcn4hMt0pfY7TgslODKew= X-Google-Smtp-Source: AMsMyM4mrUchVtySA1ZdmfnOuXHuUFsPnkVD1l6m3s7KCDUvatE8rSo+LBemxh2dP4CD2tlD622A5Q== X-Received: by 2002:a05:622a:48c:b0:39c:f2c5:41eb with SMTP id p12-20020a05622a048c00b0039cf2c541ebmr7780649qtx.212.1666204501638; Wed, 19 Oct 2022 11:35:01 -0700 (PDT) Received: from sophie ([143.244.47.100]) by smtp.gmail.com with ESMTPSA id r28-20020ae9d61c000000b006ed30a8fb21sm5377417qkk.76.2022.10.19.11.35.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 11:35:00 -0700 (PDT) From: Rebecca Mckeever To: Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: David Hildenbrand , Rebecca Mckeever Subject: [PATCH v3 0/5] memblock tests: add tests for memblock_alloc_exact_nid_raw Date: Wed, 19 Oct 2022 13:34:07 -0500 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666204502; a=rsa-sha256; cv=none; b=JnB8YHGBz5kut1K6cr5Eet8Qb3voy4ZNLavzsjWv2mwjuRYkNkP0Abwz94QHDEQ77+CDi5 wRWpJkXXgjrwQtQ+fRn3B5yahHmE9gjwV69C8QIf3v6yi3JstKhqMZNtxvRpJUh/PTcoQp RPCoUkWVpZyAXUxT5Shk/nMM3kkX0T4= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O8Wcj3si; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.196 as permitted sender) smtp.mailfrom=remckee0@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666204502; 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=3m/4y2MR8gwHAVKXn6zWeuE8EVdOtK5C6kZLltneEHw=; b=Ml/jdud9X42nKeSGrgtRRFyVEHfNgUgkMP2pE5Km4hIHrogBgoQl2ycgTrUmZIsnOMXMbn RxYWjKW9QeBh/aVKXN2+qVONPMGMeFpH7IVBJdUPEvD1FJ9hOPbnc+BcOE3LWUUWPmgH2N BM+YuK+e363H8tlHnHsS9vAiYHk8BmY= X-Rspamd-Queue-Id: 8827C40036 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O8Wcj3si; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of remckee0@gmail.com designates 209.85.160.196 as permitted sender) smtp.mailfrom=remckee0@gmail.com X-Rspam-User: X-Rspamd-Server: rspam08 X-Stat-Signature: syzogmnf3raha93zjydgsy4a4p3x4g44 X-HE-Tag: 1666204502-733124 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: These patches add tests for memblock_alloc_exact_nid_raw(). There are two sets of tests: range tests and NUMA tests. The range tests use a normal (i.e., UMA) simulated physical memory and set the nid to NUMA_NO_NODE. The NUMA tests use a simulated physical memory that is set up with multiple NUMA nodes. Additionally, most of the NUMA tests set nid != NUMA_NO_NODE. For the range tests, the TEST_F_EXACT flag is used to run the same set of range tests used for memblock_alloc_try_nid_raw(). The NUMA tests have the same setup as the corresponding test for memblock_alloc_try_nid_raw(), but several of the memblock_alloc_exact_nid_raw() tests fail to allocate memory in setups where the memblock_alloc_try_nid_raw() test would allocate memory. Also, some memblock_alloc_exact_nid_raw() tests drop the lower limit of the requested range in order to allocate within the requested node, but the same setup in a memblock_alloc_try_nid_raw() test allocates within the requested range. --- Changelog v1 -> v2 PATCH 0: - Add missing memblock_alloc_exact_nid_raw to subject line v2 -> v3 Based on feedback from David Hildenbrand: PATCH 1: - alloc_nid_api.c, alloc_nid_api.h, common.h: + Add TEST_F_EXACT flag so that tests in alloc_nid_api.c can be run with that flag to test memblock_alloc_exact_nid_raw() - alloc_exact_nid_api.c: + Update to run range tests in alloc_nid_api.c with TEST_F_EXACT flag instead of using a separate set of tests - alloc_nid_api.c: + Rename tests and other functions by removing "_try" so that the function names are general enough to refer to any of the memblock_alloc_*nid*() functions of the memblock API --- Rebecca Mckeever (5): memblock tests: introduce range tests for memblock_alloc_exact_nid_raw memblock tests: add top-down NUMA tests for memblock_alloc_exact_nid_raw memblock tests: add bottom-up NUMA tests for memblock_alloc_exact_nid_raw memblock tests: add generic NUMA tests for memblock_alloc_exact_nid_raw memblock tests: remove completed TODO item tools/testing/memblock/Makefile | 2 +- tools/testing/memblock/TODO | 7 +- tools/testing/memblock/main.c | 2 + .../memblock/tests/alloc_exact_nid_api.c | 1113 +++++++++++++++++ .../memblock/tests/alloc_exact_nid_api.h | 25 + tools/testing/memblock/tests/alloc_nid_api.c | 542 ++++---- tools/testing/memblock/tests/alloc_nid_api.h | 1 + tools/testing/memblock/tests/common.h | 2 + 8 files changed, 1425 insertions(+), 269 deletions(-) create mode 100644 tools/testing/memblock/tests/alloc_exact_nid_api.c create mode 100644 tools/testing/memblock/tests/alloc_exact_nid_api.h