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 8C5C9A0548; Sun, 28 Feb 2021 15:38:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C1C222A253; Sun, 28 Feb 2021 15:38:44 +0100 (CET) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by mails.dpdk.org (Postfix) with ESMTP id 607AD4069E for ; Sun, 28 Feb 2021 14:21:47 +0100 (CET) Received: by mail-lf1-f49.google.com with SMTP id v5so21089554lft.13 for ; Sun, 28 Feb 2021 05:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vastdata.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pCL0gnVgCHZgZ9if7nKJignGdRpuaGg03OMP33OHqf8=; b=LVAtMOocRAsCscbsHa2+Cg1NjtWrZh28Hq9tT0qMSVbo6TyC35vrTTH7QfzxuAuJKa UtbKRTkok6JXuQSc0CqLzYdk4GNNZnuvfPr5UHLLQ/uIadET2NZ2iVDkPclZNVkkzCaF jFEhFT3b3dw6qQ9QTFbpbEPawm/vjwyJSbuM6a5rPbBS6fNRrbOkHVzF2NLunMLMGk0a 72vqGWDOeDemNLSgymxDYKQfiEImoac3dFSgG/ZyYhnkGyXXOumHkVmZYI3r0DlOZXJA YmCDlFUYWLum9IKV+QFoXgm0pqK38Zo3sVn/vErVMCj/pfF7kvF2uZPjYFXimsG2jThl tzuA== 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=pCL0gnVgCHZgZ9if7nKJignGdRpuaGg03OMP33OHqf8=; b=IGFytqEWVQ2wjKUAKgQoINYGIfOQe5axTACYp0NJfvrQqwMgFg2wt34mBczzqF8QH3 Xm6WvWm/QpyJURxxRp8yk64833xZDYqtj/9mwd/XkZCNLfpLkZn3DI+Cw7TyAulMvwdI I/sJWtRn3iFwYv7ucB1yAqmhddURtzdyv+3Myzg4cS20P/8FsKiBx89nQWhrqAE+bJLb orhWpqL0RAdzrd7i/dZAosrLEC4VAb1lNuwx6H5B6in5vqKbgTSVigzLPuCYVd/FEoih Q4oeP+KZn2/QbUqSoMVppP7ZExtj1Cf4i1XDNWZzO06HKz9Kp4ecPMVdeSgQ4dl4rATZ 2Fwg== X-Gm-Message-State: AOAM531cYs8qk+2lr6cSkNzI3QouMRdlNsVaReLNRXLVPj92E7MdQFGC 8x+fjSpZ2TNkW+PH49pBHvpO880xld0gGwdjD0pfgA== X-Google-Smtp-Source: ABdhPJxN6+8WpG4X3UMaYXX5eWDW+oSOusHUPDPXfIIp1I+IObv+YwB5B7FZXRe208U/8KQGEkvEaWStSqUvFy5rByM= X-Received: by 2002:ac2:50da:: with SMTP id h26mr4386135lfm.33.1614518506917; Sun, 28 Feb 2021 05:21:46 -0800 (PST) MIME-Version: 1.0 References: <20210222104131.11979-1-roy.shterman@vastdata.com> In-Reply-To: From: Roy Shterman Date: Sun, 28 Feb 2021 15:21:36 +0200 Message-ID: To: "Burakov, Anatoly" Cc: dev@dpdk.org, Yuval Mintz , Aviv Ben David X-Mailman-Approved-At: Sun, 28 Feb 2021 15:38:42 +0100 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH] mem: fix free segment when using huge-unlink option 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 Mon, Feb 22, 2021 at 5:53 PM Burakov, Anatoly wrote: > On 22-Feb-21 10:41 AM, Roy Shterman wrote: > > When using huge_unlink we unlink the segment right > > after allocation. Although we unlink the file we keep > > the fd in fd_list so file still exist just the path deleted. > > When freeing the hugepage we need to close the fd and assign > > it with (-1) in fd_list for the page to be released. > > > > The current flow fails rte_malloc in the following flow when working > > with --huge-unlink option: > > 1. alloc_seg() for segment A - > > We allocate segment, unlink the path to the segment > > and keep the file descriptor in fd_list. > > 2. free_seg() for segment A - > > We clear the segment metadata and return - without closing fd > > or assigning (-1) in fd list. > > 3. alloc_seg() for segment A again - > > We find segment A as available, try to allocate it, > > find the old fd in fd_list try to unlink it > > as part of alloc_seg() but failed because path doesn't exist. > > > > The impact of such error is falsly failing rte_malloc() > > although we have hugepages available. > > > > Fixes: d435aad37da7 ("mem: support --huge-unlink mode") > > > > Signed-off-by: Roy Shterman > > Cc: stable@dpdk.org > > Provisionally, patch looks fine, but i'll have to have a closer look. > Hi Anatoly, Do I need to send this patch also to stable or it will happen automatically if the patch will reach the next release candidate? Also I wonder if you had more time to review this one? > > -- > Thanks, > Anatoly > Thanks, Roy