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 3699BC433FE for ; Tue, 11 Oct 2022 09:36:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 90A806B0072; Tue, 11 Oct 2022 05:36:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B95C6B0073; Tue, 11 Oct 2022 05:36:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 759336B0074; Tue, 11 Oct 2022 05:36:13 -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 5FEC66B0072 for ; Tue, 11 Oct 2022 05:36:13 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2EFAFA1062 for ; Tue, 11 Oct 2022 09:36:13 +0000 (UTC) X-FDA: 80008162626.24.B71FD5F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id CC0E0180025 for ; Tue, 11 Oct 2022 09:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665480971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lvTLEvqcj3p3d1KXb3PDcuwC6nozluzlm8I3s02xoko=; b=Qp4qPb/f3dv9y8ANgvsEJTYkPREX+Z54352RxYtD2K8C2FSFCHM7jG7vcc+1LLEkvhV/kh IrW9NFAB6KS7TXwbzRV7Fzxy1Wrs6C9YGYf2HY6v6+vy2yHxydFidSdg2QpsJFcXk0Qosh ljP9WIA1buC6xVsvNFnsE/p0tLa1lM0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-125-QMpemQ3COsCorGnAz1xchQ-1; Tue, 11 Oct 2022 05:36:10 -0400 X-MC-Unique: QMpemQ3COsCorGnAz1xchQ-1 Received: by mail-wm1-f72.google.com with SMTP id fc12-20020a05600c524c00b003b5054c70d3so8189974wmb.5 for ; Tue, 11 Oct 2022 02:36:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lvTLEvqcj3p3d1KXb3PDcuwC6nozluzlm8I3s02xoko=; b=BZN776d4GBUBdgrLd55IbA3bSBlmLQpnWH0lPRVkVLwLRRhSqrGGinX9jQbDkanlYK 6eafxMixy0Gv7jr/Mkgr7xeBa9lRqE8y5a7zgPAMYB903FACndGVxnz0cAZ33oVgAyM8 StxVk9FMqcjhLxRLsnbGQlIQVWEj0q3r/HMTaddPpNyMyRbAn5Hdhl/D0rNLvfkjvI/C azmQORoSv6JNRI+K9Us5dM94vuYKHNSZ3354q+d615IyOHLINl/32uukpoE3h83XDF4g BJncwn4R49jYROHC0grsAC1C8whGmaxOl2JYEZiA5EH+VhzyldTYBR44SWy+9djAjB+w Rypg== X-Gm-Message-State: ACrzQf2zlIOUu+m41fLn7qy/MVEVpgSdrvc/D4FlZmsmPhw1S4sDmoxo pDlsxnMnYeRiTQTCgbCrDk0NU4TIhxwHDeQ87aSmfRYbPbH2ad64I+VD3Xk+bN0JuQJdtlCKxDD WFr21L+wP+xs= X-Received: by 2002:adf:e88c:0:b0:22e:2e7c:54a5 with SMTP id d12-20020adfe88c000000b0022e2e7c54a5mr13859521wrm.245.1665480968719; Tue, 11 Oct 2022 02:36:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73WSNxypt6hIcD2iNb+bFCQxuzh5DpPW3Sjfby+ihYilYt4z//1nawXaP5Sy+GMe5DeUksPw== X-Received: by 2002:adf:e88c:0:b0:22e:2e7c:54a5 with SMTP id d12-20020adfe88c000000b0022e2e7c54a5mr13859509wrm.245.1665480968375; Tue, 11 Oct 2022 02:36:08 -0700 (PDT) Received: from ?IPV6:2003:cb:c709:6900:f110:6527:aa46:a922? (p200300cbc7096900f1106527aa46a922.dip0.t-ipconnect.de. [2003:cb:c709:6900:f110:6527:aa46:a922]) by smtp.gmail.com with ESMTPSA id w8-20020adfee48000000b002205a5de337sm10870198wro.102.2022.10.11.02.36.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Oct 2022 02:36:07 -0700 (PDT) Message-ID: Date: Tue, 11 Oct 2022 11:36:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v2 1/5] memblock tests: add range tests for memblock_alloc_exact_nid_raw To: Rebecca Mckeever Cc: Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20221011041910.GA7782@sophie> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20221011041910.GA7782@sophie> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665480971; a=rsa-sha256; cv=none; b=VOK3nUGQCxm32kO8t5jRUQJxFuLMy4cAPDImabwv6yBNTw+5h+biRbLpmtq07DXAW0nx5y rptLYPGhIWQd8qziTllOTgTYFiFI6nZPevV3OZJRBbmxnNSqMnVZepkVENbXwqMcCNCs/h 8eHZJ/IK9tFFtU7R1nMBPkIjEBvAwpg= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Qp4qPb/f"; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665480971; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lvTLEvqcj3p3d1KXb3PDcuwC6nozluzlm8I3s02xoko=; b=JRKIH3sL4WwOcDiQqGLlRFBLQjIJjQZn5hCDa8tnHFlDavA0EAbca5o+hHgmfVpVkwe9U2 jJyNksXv0XHEwy1piKoOKI5EDldT0KthUP50L18ye72waUfrLYaObmX1ts8tsTB7hS2OHH JtPG6HtPpIpl4on6TQDFEjIf4mkWsok= Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Qp4qPb/f"; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: 3qwwzmcw8jc8gczbx7ekske57nxj3zqo X-Rspamd-Queue-Id: CC0E0180025 X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1665480971-886328 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 11.10.22 06:19, Rebecca Mckeever wrote: > On Mon, Oct 10, 2022 at 01:16:03PM +0200, David Hildenbrand wrote: >> On 03.10.22 01:41, Rebecca Mckeever wrote: >>> Add tests for memblock_alloc_exact_nid_raw() that are very similar to >>> the range tests for memblock_alloc_try_nid_raw(). >>> >>> Signed-off-by: Rebecca Mckeever >>> --- >>> tools/testing/memblock/Makefile | 2 +- >>> tools/testing/memblock/main.c | 2 + >>> .../memblock/tests/alloc_exact_nid_api.c | 1208 +++++++++++++++++ >>> .../memblock/tests/alloc_exact_nid_api.h | 9 + >>> 4 files changed, 1220 insertions(+), 1 deletion(-) >>> create mode 100644 tools/testing/memblock/tests/alloc_exact_nid_api.c >>> create mode 100644 tools/testing/memblock/tests/alloc_exact_nid_api.h >>> >>> diff --git a/tools/testing/memblock/Makefile b/tools/testing/memblock/Makefile >>> index 246f7ac8489b..2310ac4d080e 100644 >>> --- a/tools/testing/memblock/Makefile >>> +++ b/tools/testing/memblock/Makefile >>> @@ -7,7 +7,7 @@ CFLAGS += -I. -I../../include -Wall -O2 -fsanitize=address \ >>> LDFLAGS += -fsanitize=address -fsanitize=undefined >>> TARGETS = main >>> TEST_OFILES = tests/alloc_nid_api.o tests/alloc_helpers_api.o tests/alloc_api.o \ >>> - tests/basic_api.o tests/common.o >>> + tests/basic_api.o tests/common.o tests/alloc_exact_nid_api.o >>> DEP_OFILES = memblock.o lib/slab.o mmzone.o slab.o >>> OFILES = main.o $(DEP_OFILES) $(TEST_OFILES) >>> EXTR_SRC = ../../../mm/memblock.c >>> diff --git a/tools/testing/memblock/main.c b/tools/testing/memblock/main.c >>> index 4ca1024342b1..278f9dec5008 100644 >>> --- a/tools/testing/memblock/main.c >>> +++ b/tools/testing/memblock/main.c >>> @@ -3,6 +3,7 @@ >>> #include "tests/alloc_api.h" >>> #include "tests/alloc_helpers_api.h" >>> #include "tests/alloc_nid_api.h" >>> +#include "tests/alloc_exact_nid_api.h" >>> #include "tests/common.h" >>> int main(int argc, char **argv) >>> @@ -12,6 +13,7 @@ int main(int argc, char **argv) >>> memblock_alloc_checks(); >>> memblock_alloc_helpers_checks(); >>> memblock_alloc_nid_checks(); >>> + memblock_alloc_exact_nid_checks(); >>> return 0; >>> } >> >> >> memblock_alloc_exact_nid_raw(NUMA_NO_NODE) behaves exactly the way >> memblock_alloc_try_nid_raw(NUMA_NO_NODE) behaves -- which is essentially >> memblock_alloc_raw(). >> >> So do we really need a separate set of tests for these? >> > Instead of a separate set of tests, I could add a flag for > memblock_alloc_exact_nid_raw() to test_flags so that the range tests in > alloc_nid_api.c could be run with that flag. Do you think I should do > that, or omit tests for memblock_alloc_exact_nid_raw(NUMA_NO_NODE) > altogether? Good question. From an API point of view, it makes sense to test that API somehow. With implementation in mind, it doesn't make too much sense to test it twice. Whatever you prefer :) Just wanted to point out that separate tests don't make sense -- using a flag would be cleaner. -- Thanks, David / dhildenb