From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F564A0C4B; Fri, 5 Nov 2021 15:27:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82131411A7; Fri, 5 Nov 2021 15:26:59 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id CB08841134 for ; Fri, 5 Nov 2021 15:26:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636122417; 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: in-reply-to:in-reply-to:references:references; bh=n2nRiX+HnM8AtOUdF2KIrPG1Z9xJKeIUzkWEUyeJ/Cg=; b=iLfaYQBzCFYTcbvxZXCNyx4O1caCncKSF32G8ToIYeqnf8C3FGQPRFcmfk4uoD5NlcQQfZ fRig2rneI7AcThkZyaxcSt/beapJ4oMAs4voJewVjAfVkzvLn7O+eYVmW9fdutj3R5YXn4 d8pRFOSydaDEcu6xE2bfLpdPhQRdybE= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-GWozjj8HN7G3VdhC9IWB3A-1; Fri, 05 Nov 2021 10:26:56 -0400 X-MC-Unique: GWozjj8HN7G3VdhC9IWB3A-1 Received: by mail-lj1-f200.google.com with SMTP id f9-20020a05651c160900b00217e6a3ec32so3128217ljq.1 for ; Fri, 05 Nov 2021 07:26:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n2nRiX+HnM8AtOUdF2KIrPG1Z9xJKeIUzkWEUyeJ/Cg=; b=8Ao/uarO/kpG8DPDwsH29Yc53zl0tvvAfpW/STSC5V+Xai18Ys9AGcrJikrCVaRZvW vnLLSYqSlYDV70zJPutF+h8S7b2dHN5X8pAnclH+OVhtM9Fm1QyIdZO2EweLh60F3AXl oMD9Zdx+37HL6ew2y6Lnml7c7nZygi3r29xEorspAjc37KLJNwlkBIQ9IOGwYwJJVHgk IHfl5zPo5faz3wzdTQYsBn9YEWLxNTwgbn7kJOXmOTw9nli5XByKGU2JkIPKrfPlpsnm X50Q96Edd2rSBt0N+xyV4Kemh+36+0Cj2dRQlXQb+uXTX40qOL9UG2grp7/RvJSErJjP ALfw== X-Gm-Message-State: AOAM531EVbcTPAaYMlWQdkwGeqSVPeGO5+4EkXsxaFYoaEgOPwC6OMJV ombGx6rPIZ7eUVlR3dI8k9spJHH3gq8ncMyvUkLfMubKO0LTMFbYclIcdQhV6Mm0p3sBvGoBm57 WeSPf2QM87o4MdMwkC1Y= X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr54511814lfa.499.1636122414569; Fri, 05 Nov 2021 07:26:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKGQwY+SfmjZrSChFOG5zxqB5iFDbAel8Q+n4EgKYYa87+0l+stwvBo+wxhR1xADMy+kNwu4atVcqT6+25gts= X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr54511797lfa.499.1636122414354; Fri, 05 Nov 2021 07:26:54 -0700 (PDT) MIME-Version: 1.0 References: <20211029094929.29864-1-olivier.matz@6wind.com> In-Reply-To: From: David Marchand Date: Fri, 5 Nov 2021 15:26:43 +0100 Message-ID: To: Olivier Matz Cc: Anatoly Burakov , dev , Ilyes Ben Hamouda , dpdk stable Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] eal: fix mem alloc from control thread if socket 0 is unused X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Nov 4, 2021 at 9:54 AM Olivier Matz wrote: > > > From: Ilyes Ben Hamouda > > > > > > When using rte_malloc() from a control thread, the used heap is the one > > > from numa socket 0, which may not have available memory. > > > > > > Fix this by selecting the first socket which has available memory. > > > > > > Note: malloc_get_numa_socket() is only used from one .c file, so move > > > it there, and remove the inline keyword. > > > > > > Fixes: b94580d6887e ("malloc: avoid unknown socket id") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Ilyes Ben Hamouda > > > Signed-off-by: Olivier Matz Acked-by: David Marchand > I didn't know this was possible (and still wonder in which case it can > be useful). But yes, I can send a new version with an updated title and > commit log. What about this one below? No need for a v2, I took your suggestion. Applied, thanks. > > eal: fix mem alloc from thread having unknown socket id > > When using rte_malloc() from a thread which is not bound to a numa > socket (the typical case is a control thread, but it can also happen > on a dataplane thread if its cpu affinity is on cores attached to > several sockets), the used heap is the one from numa socket 0, which > may not have available memory. > > Fix this by selecting the first socket which has available memory. > > Note: malloc_get_numa_socket() is only used from one .c file, so move > it there, and remove the inline keyword. > -- David Marchand