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 2D387A0C4B for ; Fri, 5 Nov 2021 15:26:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E28B840E5A; Fri, 5 Nov 2021 15:26:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id C6BB840E5A 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-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-X_2Q26pgMAacFiKjsQwNyQ-1; Fri, 05 Nov 2021 10:26:56 -0400 X-MC-Unique: X_2Q26pgMAacFiKjsQwNyQ-1 Received: by mail-lj1-f197.google.com with SMTP id g7-20020a2eb0c7000000b00218a595caacso1762659ljl.5 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=00gOmCS6VmlzvuHkfdsT1tWGnQtbMUBVlehrXhAX2c4pCQH6Cjg5OCna6WsM6RAT3c yLvxlEtKHS7pHSyIQnXvBYEoBfQ4V0HVK8kK3egLZ9kF1mybrBRUvn1da+y+6VLff/Iq 9NopFNT6Zf5Hym+rNCZsKYeZ2OEf3pz10XfewsNYaODlKJLJEKIDOh4uFLvj7jZf1iUS Hap1qaX7xV8gfw9JptYmPdceGRjG5RxGzTUcJ9L/aEjETJAvxJctaVJiSSIRy9yetpog SyAk+6cfzix+ZpncWCMaRuHKsR+rus/VHtAShHDByq+I6smYtqPjTSKLTJnUW5x8OGd9 PzyQ== X-Gm-Message-State: AOAM533DgeW9K1lwQ1ITRc8ovwGjvzj8uMXMmiYZ8+KXgjLJn8ez5/ES Ji6777eaoGG9JVR5x9k66yuF8sR5Kwy1++cPXFpZLE3xmiTGn+bshQrYLbK+xAbx0/+s+Aon9ly 0zpAKCmdYV39mdnN3V3f/n3o= X-Received: by 2002:a05:6512:3f28:: with SMTP id y40mr54511821lfa.499.1636122414620; 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-stable] [dpdk-dev] [PATCH] eal: fix mem alloc from control thread if socket 0 is unused X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 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