From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D56A9C433C1 for ; Fri, 26 Mar 2021 16:15:45 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 663D8619CB for ; Fri, 26 Mar 2021 16:15:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 663D8619CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5331E40686; Fri, 26 Mar 2021 17:15:43 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 9E5EF40685 for ; Fri, 26 Mar 2021 17:15:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616775340; 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=/073RSJxaqZyCl9yBo3lqEXq9EIQoCTIBF3mbBau5N8=; b=CgZXfWN6twvOgiBna1zNm7qeA+WO8Pj64ra+5dx9a26vUXLyVhiVtEhxqk4vkgIlsPECJl QzSz501y6gmzhQMaU+GMIpCtIQU2Nmfij8hW+CAApPIR7FCymQFG0ctYakUoPeg7iualwt 8wtWNq5ck48TgN5HL1YzPPS6XPix4Wk= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-luyYHUAMOrSJRF4heB3puw-1; Fri, 26 Mar 2021 12:15:38 -0400 X-MC-Unique: luyYHUAMOrSJRF4heB3puw-1 Received: by mail-vk1-f197.google.com with SMTP id x23so2083925vkd.0 for ; Fri, 26 Mar 2021 09:15:38 -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=/073RSJxaqZyCl9yBo3lqEXq9EIQoCTIBF3mbBau5N8=; b=AwJ+dy6V3tpo2UDY7t125ByJb4GdDou2egbVr94BPbflvqzDxls29yyLbThLMYE0wR xZkyyci1ZfQaMrXXNDacX4pj9+6rBYNoviYYPD3gd6WH9wR2yILx5VF8ocYb98w0hM8N DJg73Hq4TfHr0iNaNzEEOCCDr8CejXRASjy8xT+Ul3mpvjG+y+Qt6rzUFM1uFz44zM0t BEl1RoBKVptw7o12XBxPentAJTkf39iDuxp5UbHmNmw4/2tT1enRV2uzO5Br5c+Fx9YR MuLFciRdqqz0ryu/crbs3UTMaNzc1yxNGuikjqWkhJggfWN4+8gUmVBYBuyJ+F60BjyA 50VQ== X-Gm-Message-State: AOAM531iixHyWpUtQRbOOGfNhXsgwG4CiE5K7MhwRfdprLtScp5GI2mP M+9iAOEo1Yv1XbZoowsS02N/xQZ0VqqPHsO/7aF4LEOqBDB9riGaT7v0MeYku47APLEQ8CB7T+i sC1IBaLaNQT2A2QukjYA= X-Received: by 2002:ab0:3a97:: with SMTP id r23mr8239547uaw.87.1616775338422; Fri, 26 Mar 2021 09:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPvTDqhv4KYmhlwSRVI1bpTlUUwMOmYaZxLJslWaEHXUgacGWtzNQnLKLfF/VYQfXHB//+DGIsYW154oL43Is= X-Received: by 2002:ab0:3a97:: with SMTP id r23mr8239527uaw.87.1616775338203; Fri, 26 Mar 2021 09:15:38 -0700 (PDT) MIME-Version: 1.0 References: <20210324180128.32752-1-dmitry.kozliuk@gmail.com> <20210324193227.15497-1-dmitry.kozliuk@gmail.com> In-Reply-To: <20210324193227.15497-1-dmitry.kozliuk@gmail.com> From: David Marchand Date: Fri, 26 Mar 2021 17:15:27 +0100 Message-ID: To: Dmitry Kozlyuk Cc: dev , Anatoly Burakov , Jie Zhou 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 v2] mem: fix cleanup when multi-process is disabled 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 Wed, Mar 24, 2021 at 8:32 PM Dmitry Kozlyuk wrote: > > rte_eal_memory_detach() did not account for cases where multi-process > mode is disabled: --in-memory and --no-shconf. This resulted > in unmapping memory that had not been mapped, which caused errors: > > EAL: Could not unmap memory: No error (Windows) > EAL: Cannot munmap(0x1d47f40, 0x7000): Invalid argument (Linux) > > Confusing "No error" was caused by using errno instead of rte_errno > set by rte_mem_unmap(). > > Skip detaching memory altogether when --in-memory is specified. > Skip unmapping configuration when it's not shared. > Fix and add error handling to produce proper log messages. > > Fixes: dfbc61a2f9a6 ("mem: detach memsegs on cleanup") > Cc: Anatoly Burakov > > Reported-by: Jie Zhou > Suggested-by: David Marchand > Signed-off-by: Dmitry Kozlyuk Acked-by: Ranjit Menon Acked-by: Anatoly Burakov Applied, thanks Dmitry. -- David Marchand