From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A67A6A053E for ; Wed, 5 Aug 2020 17:22:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 86D7C1C02E; Wed, 5 Aug 2020 17:22:01 +0200 (CEST) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 914322C23 for ; Wed, 5 Aug 2020 17:21:59 +0200 (CEST) Received: by mail-wm1-f68.google.com with SMTP id t14so6742513wmi.3 for ; Wed, 05 Aug 2020 08:21:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mayadata-io.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=HfBGK0IfXB8ukALsDLQ80juW8VOSfNrweaIypnVM4i0=; b=tAvbZucLISKpoK019s9fK+38vpMccG51zOosZ50ReOWv5+yxp/p++NxaCDMR+4mzkn kJYO8bMmzfkJO8gpXp9jlAOAGVq/bnOSpE9BnG2X+NHPSEvfMh3F0D5M0plg3z48/Z3d 21EUZ6ePlrmj2BHI0gH/l9l/a8KSXXKHAkBtz34zEJob1wvYDt1vhrRZqCQ0LcF3jv1Z QiN9B74uWlU68AXbEoLfeCjey1ejNZPesYXCyeN+1WKEEBQ/4RU5lECsoOZ2etdMCsRl BiaynGSWvXRhtz2B01nKr3yuTARkba+IrZKbcoGt16o2kfrFeCZ7JuKBXIRXkyPKeaNe urvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=HfBGK0IfXB8ukALsDLQ80juW8VOSfNrweaIypnVM4i0=; b=E3V/hGduInLfCePLR4hwgIMAO7YaPe/UpFkJGzq6+9/w2toUjhA8ZiKg63bQCCj8PA wPAKbYWi6s6mTqehT3GlwBSo1jlutQueSF0upt3fbAu/xaZDWQA/YktNJvqK+OC7Hkg/ BRRC5zVXFtD0E3dUKJsTCV9lmL9pFdSlBK/Q5yrpa/OudYUDMb4+z5Uvp1GXCezPur9I Ld5AfO6UhFpbnHufv235t/EchBWAOEMuGJ3Hp+GN4c9FW5D4rs96Op7hJU4uS+RrHQ29 na5dGmUZBlhiUWw2N+7YnL/cZAs5B/Zwmf7ymC8kPcT9JIhd4juZj0K7sZsA+xZI51b+ HoWA== X-Gm-Message-State: AOAM531uC28RqVbqfaSXXCp2NKGc67zIEL+LQ1CtRrO7qxLVB9acQpB0 IJt7+2gTAp6gNwvoeR4bZ73qYRZ/xSQ= X-Google-Smtp-Source: ABdhPJzJZNL0rDLvgJCj5/eELEogbPnlMjok+DDxXl3rmfydBin81+Oxk4B+knFcRNL/E1UYtVvmaQ== X-Received: by 2002:a1c:2985:: with SMTP id p127mr3597400wmp.166.1596640918987; Wed, 05 Aug 2020 08:21:58 -0700 (PDT) Received: from [192.168.0.33] (cpc98324-croy25-2-0-cust73.19-2.cable.virginm.net. [82.38.60.74]) by smtp.gmail.com with ESMTPSA id f9sm3006810wrm.62.2020.08.05.08.21.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Aug 2020 08:21:58 -0700 (PDT) From: Nick Connolly X-Google-Original-From: Nick Connolly To: nicolas.dichtel@6wind.com, Anatoly Burakov Cc: dev@dpdk.org, stable@dpdk.org References: <20200805122640.13884-1-nick.connolly@mayadata.io> <4a1d578d-30e3-88de-be02-34ee0dd41ad1@mayadata.io> <906edd92-cda3-9e79-ebdd-29a944082b61@6wind.com> Message-ID: <64e06514-67ef-9843-48f1-beed83b03991@mayadata.io> Date: Wed, 5 Aug 2020 16:21:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [dpdk-stable] [PATCH] mem: fix allocation failure on non-NUMA kernel X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 05/08/2020 16:13, Nicolas Dichtel wrote: > Le 05/08/2020 à 16:53, Nick Connolly a écrit : > [snip] >>>>>> +    if (check_numa()) { >>>>>> +        ret = get_mempolicy(&cur_socket_id, NULL, 0, addr, >>>>>> +                    MPOL_F_NODE | MPOL_F_ADDR); >>>>>> +        if (ret < 0) { >>>>>> +            RTE_LOG(DEBUG, EAL, "%s(): get_mempolicy: %s\n", >>>>>> +                __func__, strerror(errno)); >>>>>> +            goto mapped; >>>>>> +        } else if (cur_socket_id != socket_id) { >>>>>> +            RTE_LOG(DEBUG, EAL, >>>>>> +                    "%s(): allocation happened on wrong socket (wanted %d, >>>>>> got %d)\n", >>>>>> +                __func__, socket_id, cur_socket_id); >>>>>> +            goto mapped; >>>>>> +        } >>>>>> +    } else { >>>>>> +        if (rte_socket_count() > 1) >>>>>> +            RTE_LOG(DEBUG, EAL, "%s(): not checking socket for allocation >>>>>> (wanted %d)\n", >>>>>> +                    __func__, socket_id); >>>>> nit: maybe an higher log level like WARNING? >>>> Open to guidance here - my concern was that this is going to be generated for >>>> every call to alloc_seg() and I'm not sure what the frequency will be - I'm >>>> cautious about flooding the log with warnings under 'normal running'.  Are the >>>> implications of running on a multi socket system with NUMA support disabled in >>>> the kernel purely performance related for the DPDK or is there a functional >>>> correctness issue as well? >>> Is it really a 'normal running' to have CONFIG_RTE_EAL_NUMA_AWARE_HUGEPAGES in >>> dpdk and not CONFIG_NUMA in the kernel? >> I'm not an expert of DPDK, but I think it needs to be treated as 'normal >> running', for the following reasons: >> >> 1. The existing code in eal_memalloc_alloc_seg_bulk() is designed to >>    work even if check_numa() indicates that NUMA support is not enabled: >> >>    #ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES >>    if (check_numa()) { >>             oldmask = numa_allocate_nodemask(); >>             prepare_numa(&oldpolicy, oldmask, socket); >>             have_numa = true; >>         } >>    #endif > The question was not to return an error, but to display a warning. So the code > will work (after your patch), no problem. > >> 2. The DPDK application could be built with >>    CONFIG_RTE_EAL_NUMA_AWARE_HUGE_PAGES and then the binary run on >>    different systems with and without NUMA support. > In a production environment, it seems odd to have a custom kernel and a generic > dpdk app, it's why I propose the log level WARNING (or NOTICE maybe?). > I let other comment about this, I don't have a strong opinion. Thanks - appreciate the input - I also have no strong opinions here and am happy to be guided. Regards, Nick