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 9ADCBC54EE9 for ; Thu, 8 Sep 2022 12:23:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A9496B0073; Thu, 8 Sep 2022 08:23:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 331686B0074; Thu, 8 Sep 2022 08:23:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AB4E8D0001; Thu, 8 Sep 2022 08:23:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 05FA66B0073 for ; Thu, 8 Sep 2022 08:23:35 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CB52814105D for ; Thu, 8 Sep 2022 12:23:34 +0000 (UTC) X-FDA: 79888833948.29.935DE55 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 696D51C0075 for ; Thu, 8 Sep 2022 12:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662639814; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=79g5VpFONhuMPtawANlVR2ff/cNbGpCflmstr/JbOIo=; b=HA74NKFpezNtNzbOIyb75LSsbDIixKYdhT64aW1KO6DjsFqnkesxUGSVusk6Hdxb4NjsY0 ZS3J5HNbVy7Vq3m4vEbxV1wSsIa4uyJ63gv8f90MQTAKC4paiKEwfEkVfPBUUFBBUQjsaM dFCRGj5Pj5Gx2Vs9bq1gf3jAm0O9cEk= 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-408-d1MM72ZXO3eahlOqfFdqog-1; Thu, 08 Sep 2022 08:23:32 -0400 X-MC-Unique: d1MM72ZXO3eahlOqfFdqog-1 Received: by mail-wm1-f72.google.com with SMTP id r186-20020a1c44c3000000b003b3309435a9so341125wma.6 for ; Thu, 08 Sep 2022 05:23:32 -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 :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=79g5VpFONhuMPtawANlVR2ff/cNbGpCflmstr/JbOIo=; b=qfZj6WsAHDb9Ywla6tPc2FeUTCyIszr2dpM17qiWSJoL2j6dN/mAHXqC+SkSkJeDGv 5BLMSybqN4qpzxJomceOtkwHBfqJAcTOQ7k+RusJI9cEN5H1ZK1gU2r4Bt8H/zamHg70 BLqbj8+WyPlcaROs9FcWlU9LVfLx5ZZBq2T2s7oTEe5ikVFz7STZ3+RZ4Tin3PqUSSRi H14ltbtxSV+++MxaIkewqdBKGPCGpZmqy1Hn2ZuVtHKlDgQXd3wzTDj4/CiC1MO7TXzA awuRQm9kCn5xc4Ir5ITeRzs2doTcr+wsjNtJBh9QGwa+qHqPN1zYdlOUMME7VGERujNv Bmfw== X-Gm-Message-State: ACgBeo3wu0kJ758HUEuxThKpD2pdooKra7SdWUFdNE/Sq6RsJc0EgPXD MR8jmSKY6JcooWYSHMbWZl0i0Sg8ocTF31/nNwazFwuhBHicohGbMubbiJtY44cCrhucTVQxeok W4MRgTrsdHiA= X-Received: by 2002:a05:6000:381:b0:221:7542:61bb with SMTP id u1-20020a056000038100b00221754261bbmr4934146wrf.305.1662639811622; Thu, 08 Sep 2022 05:23:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR6lEwY3r9hTla4Z6KBQ6ssYqnMJ1AS54mmV7VZRMfZnvmvazj3IMqsdpTmP0X2s/dv0JIT9ew== X-Received: by 2002:a05:6000:381:b0:221:7542:61bb with SMTP id u1-20020a056000038100b00221754261bbmr4934129wrf.305.1662639811311; Thu, 08 Sep 2022 05:23:31 -0700 (PDT) Received: from ?IPV6:2003:d8:2f0d:ba00:c951:31d7:b2b0:8ba0? (p200300d82f0dba00c95131d7b2b08ba0.dip0.t-ipconnect.de. [2003:d8:2f0d:ba00:c951:31d7:b2b0:8ba0]) by smtp.gmail.com with ESMTPSA id r3-20020a05600c434300b003a5fa79007fsm2276556wme.7.2022.09.08.05.23.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 05:23:30 -0700 (PDT) Message-ID: Date: Thu, 8 Sep 2022 14:23:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v4 2/4] memblock tests: add top-down NUMA tests for memblock_alloc_try_nid* To: Rebecca Mckeever , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <03b434f9ccbeb059a04d5af57d69038a14c21ec6.1662264560.git.remckee0@gmail.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <03b434f9ccbeb059a04d5af57d69038a14c21ec6.1662264560.git.remckee0@gmail.com> 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=1662639814; a=rsa-sha256; cv=none; b=k0yj1EBLvd1R4O2QkiCwNt3rlPHC+bnW+lq/+hG4IOgSexa2DMkt/vxbmW4tYgcJh9rpdM 0gxie1aF4DEvgSxQV0Db6zvyEd4bz2l6k85BQpASphJot6WECnBi6B3Du2C4QZDTpTCTTs eUV7EbPrG9a6gwy7HwVM4recKWMINLw= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HA74NKFp; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.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=1662639814; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=79g5VpFONhuMPtawANlVR2ff/cNbGpCflmstr/JbOIo=; b=kG7eY9oWh8ihlUEsR+bJyLorOOipPnV4+5vZ8KIJBS+bmWbB3Eh+7LpYYcrS7aTf3uz81K dvcvw4FVTpop+p1/ASMstt7Pld85vhdxPApSo5FrS2cChrD1eGG4BOfUS4dZbTDzvjEL1w 2S9Rc86wEznETLlxqls9poKDq4PH6hw= X-Stat-Signature: sfjono3uqsz3jpdhn8uihnzzxroaudw7 X-Rspam-User: X-Rspamd-Queue-Id: 696D51C0075 X-Rspamd-Server: rspam07 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HA74NKFp; spf=pass (imf18.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1662639814-606396 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 04.09.22 06:21, Rebecca Mckeever wrote: > Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw() > where the simulated physical memory is set up with multiple NUMA nodes. > Additionally, all of these tests set nid != NUMA_NO_NODE. These tests are > run with a top-down allocation direction. > > The tested scenarios are: > > Range unrestricted: > - region can be allocated in the specific node requested: > + there are no previously reserved regions > + the requested node is partially reserved but has enough space > - the specific node requested cannot accommodate the request, but the > region can be allocated in a different node: > + there are no previously reserved regions, but node is too small > + the requested node is fully reserved > + the requested node is partially reserved and does not have > enough space > > Range restricted: > - region can be allocated in the specific node requested after dropping > min_addr: > + range partially overlaps with two different nodes, where the first > node is the requested node > + range partially overlaps with two different nodes, where the > requested node ends before min_addr > - region cannot be allocated in the specific node requested, but it can be > allocated in the requested range: > + range overlaps with multiple nodes along node boundaries, and the > requested node ends before min_addr > + range overlaps with multiple nodes along node boundaries, and the > requested node starts after max_addr > - region cannot be allocated in the specific node requested, but it can be > allocated after dropping min_addr: > + range partially overlaps with two different nodes, where the > second node is the requested node > > Signed-off-by: Rebecca Mckeever > --- > tools/testing/memblock/tests/alloc_nid_api.c | 694 ++++++++++++++++++- > tools/testing/memblock/tests/alloc_nid_api.h | 16 + > tools/testing/memblock/tests/common.h | 18 + > 3 files changed, 717 insertions(+), 11 deletions(-) > > diff --git a/tools/testing/memblock/tests/alloc_nid_api.c b/tools/testing/memblock/tests/alloc_nid_api.c > index 32b3c1594fdd..a639e9d3e098 100644 > --- a/tools/testing/memblock/tests/alloc_nid_api.c > +++ b/tools/testing/memblock/tests/alloc_nid_api.c > @@ -3,6 +3,14 @@ > > static int alloc_nid_test_flags = TEST_F_NONE; > > +/* > + * contains the denominators of the fractions of MEM_SIZE contained in each node > + * (e.g., if node_fractions[0] = SZ_8, node 0 will contain 1/8th of MEM_SIZE) > + */ > +static const phys_addr_t node_fractions[] = { > + SZ_4, SZ_16, SZ_8, SZ_8, SZ_16, SZ_16, SZ_4, SZ_16 > +}; > + Besides that part, that I consider confusing :) Acked-by: David Hildenbrand -- Thanks, David / dhildenb