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 EA9D2A0583; Thu, 19 Mar 2020 13:54:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D9664F94; Thu, 19 Mar 2020 13:54:37 +0100 (CET) Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by dpdk.org (Postfix) with ESMTP id 69F54CF3 for ; Thu, 19 Mar 2020 13:54:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584622475; 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=ALegup9AH5m6fmOqzbRVi4ldRR48K7cnE7LljsD5yd4=; b=HoSFwGHpxd+VCy75PsED4/sLXXhDuagmRiML264lmHx2Ph4WJrFPfzEWgXhLv5Z8ZthyGh M4q33Y3SrcvAlQsehIKFTDOtTchZPTzk7AX8KiKOx09E/OLWpF7THtU2cEThiMo94pqss3 wCnAx+2cPK+EYPVMnceOVuGGr+mBOsw= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-69-VKk3bp5KN-Ob1a8L6D7oBQ-1; Thu, 19 Mar 2020 08:54:34 -0400 X-MC-Unique: VKk3bp5KN-Ob1a8L6D7oBQ-1 Received: by mail-ua1-f70.google.com with SMTP id y8so635634uap.0 for ; Thu, 19 Mar 2020 05:54:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sZQbIquehx43OEt3te61j2Wqr1DE+5GGt7+N1DFuFeI=; b=eZa60mFaHtRlRABx22fs+wRbwyJgYE5iEmkeOhpy/fCs1dwWO3PY+VJ7LR1XvwVQlq q6gW8/hLxIhyO4pYw7A5R8pit0+staIwGedrVi9OCPGDm3AWg+A23cBSKOhRfgVnTlc/ XvWqeETjX4pg8/xQ10KKiD+l4LDFFmm1KZw0MjlsUhs2EsEybzftfy3ENzyU3JrZ0clP faR5XSgDCjnkWyWyCYX7wTxH/uD2oZrT+FdHfPdnYs7bx6/PFZ/nchEM+zIbKGqOaQbS wr6Rj9g3WGcBzTIB2vbH9wU2AcCJobSoHYhoX+DS73dVM+D1dRYfbAZXv3By55ivbDSA otcQ== X-Gm-Message-State: ANhLgQ0ffp0hNUTBm0WQ77zRaQYQ2j2PmAY0kfzIhrbzRf160ghI/b4k rbffqDbge/JK7YWF+h8jr5qM9Aj9VJCumY18avHGhsbbh5JgsuO/+qtqPWrHGuejSW4mPDJjVt4 VU2wahLlw/H5b3jTZN3A= X-Received: by 2002:a67:905:: with SMTP id 5mr1900291vsj.105.1584622473274; Thu, 19 Mar 2020 05:54:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsHTaftbRwI/box/3JtxSF193sqItU0fwITNZvndp0Qm5iuOWrTSIX1BtG0BEIMpQ8SanKtAvvRSCcTwe1ZQYE= X-Received: by 2002:a67:905:: with SMTP id 5mr1900274vsj.105.1584622472865; Thu, 19 Mar 2020 05:54:32 -0700 (PDT) MIME-Version: 1.0 References: <20200309100025.9022-1-james.r.harris@intel.com> <20200310093156.GA1915@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20200310093156.GA1915@bricha3-MOBL.ger.corp.intel.com> From: David Marchand Date: Thu, 19 Mar 2020 13:54:21 +0100 Message-ID: To: Jim Harris , Bruce Richardson Cc: dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] contigmem: cleanup properly when load fails X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Tue, Mar 10, 2020 at 10:32 AM Bruce Richardson wrote: > > On Mon, Mar 09, 2020 at 03:00:25AM -0700, Jim Harris wrote: > > If contigmem is not able to allocate all of the > > requested buffers, it frees whatever buffers were > > able to be allocated up until that point. > > > > But the pointers are not set to NULL in that case. > > After the load fails, the FreeBSD kernel will > > immediately call the contigmem unload handler, which > > tries to free the buffers again since the pointers > > were not set to NULL. > > > > It's not clear that we should just rely on the unload > > handler getting called after load failure. So let's > > keep the existing cleanup code in the load handler, > > but explicitly set the pointers to NULL after freeing > > them. Can you check this Fixes is correct? Fixes: 5f51eca22489 ("contigmem: free allocated memory on error") Cc: stable@dpdk.org --=20 David Marchand