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 A5B79A0583; Thu, 19 Mar 2020 15:41:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0EC59F94; Thu, 19 Mar 2020 15:41:24 +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 C8680CF3 for ; Thu, 19 Mar 2020 15:41:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584628882; 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=rq8ZbotAm1FnWqL/cymmVqcqn5uKr/VbLj8QuYXvEtQ=; b=GOb8nVAc8QcHRQSAOjTgfGjWxfdH3cIKpVBOZMsXUugHPTMz/jgcpxbmEwociEEW2114Ej v/mPTAC+A2Wtnyt5kw+4esH0XCwRCa+tGFc7ameR5FbSl4DrJQttILER9T9WuklKa/ejOm d7XiZjmfJCpBKt/ua6dHJC4eYLEtV1I= Received: from mail-vs1-f69.google.com (mail-vs1-f69.google.com [209.85.217.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-RGDeLC8rMY6leP7AmTq8pw-1; Thu, 19 Mar 2020 10:41:18 -0400 X-MC-Unique: RGDeLC8rMY6leP7AmTq8pw-1 Received: by mail-vs1-f69.google.com with SMTP id s23so364504vsa.17 for ; Thu, 19 Mar 2020 07:41:18 -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=4aVtqK0pKAD+WoQWw53shklTXcq7UKy0tSDRITPi4HQ=; b=KjO4omvi6fHSygpNRN6HMsgFJFvFr83yFQPWbXQdFxckWGk1tC4MCjV+9WZ5XYY68V RfnrMGik59dXgsHH4xljH/NAH+2PQNjk6O3GFl8+icYDR+nrBcRVKOuoFkpi2yrRjDRl OKZHdqze9uXIBJAvivjX/eCO589UWp60CZxysV1vzReMRb8GiCrTRdWYgALt1eyXxBWp N1cKx/2UJ2aqznfAJDon6Ubm6rGrrjeJhuKXRDV8KLJMlmzz6Vak8YtEW3FQFqg9tetu +bEM5NsnzobdfgJzMscoPvL6FE7DtSizL3KKSYqM9MJbBAk4QaI1ArUtAMs0WoSmCVuT 7K2w== X-Gm-Message-State: ANhLgQ1Am7QMB4WHehE6+fl+EndBL79BprlKbV6UTzIDi1BSkCCnhoJ6 bNcyocT+9Xe1xv0irbcjw3/GvcRk11lu4Pwrn3DHZm6jLwTelXgY/+cH3YSQ0qlvK/KXh04Ntwm HonLVDXY9alztP+sG6O8= X-Received: by 2002:a67:905:: with SMTP id 5mr2344924vsj.105.1584628877893; Thu, 19 Mar 2020 07:41:17 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu9NxjYeJSEBA3bnzkQPzaSZgs1pdv84GwXM1LjlvJ15GAIFkdcYkmp40wMXx0JKg9p/UJxEXdeWVWXpx3BjAw= X-Received: by 2002:a67:905:: with SMTP id 5mr2344902vsj.105.1584628877589; Thu, 19 Mar 2020 07:41:17 -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 15:41:06 +0100 Message-ID: To: Jim Harris Cc: dev , Bruce Richardson 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. Fixes: 5f51eca22489 ("contigmem: free allocated memory on error") Cc: stable@dpdk.org > > > > Signed-off-by: Jim Harris > > --- > Acked-by: Bruce Richardson > Applied, thanks. --=20 David Marchand