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 CA090A0579; Wed, 7 Apr 2021 11:10:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B38F01410F6; Wed, 7 Apr 2021 11:10:03 +0200 (CEST) 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 6ACDE1410F4 for ; Wed, 7 Apr 2021 11:10:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617786601; 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=vHCO+ff+1k2d57MsEG3BMwS5OwIhUyc7ktiMitvzs6M=; b=H99cWmUDIeax2CRLnfDeDPtrq7QDyBK4AWGRXnIr9dgi/pAmt7Wet0NSm88rVNK4XdzZOD F79XKElTWMnFs4ptAQSC81B8HuV4P5zg58Ok/G0mt5OYxIIMeXv/bimSmuXtAlNCylebN3 8m37XpVt9VvxvqCjfM4PMhFwxp13CxQ= Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-477-wX_TbcKnM22mgEj-J6KyyA-1; Wed, 07 Apr 2021 05:09:58 -0400 X-MC-Unique: wX_TbcKnM22mgEj-J6KyyA-1 Received: by mail-ua1-f72.google.com with SMTP id n4so1649500uao.21 for ; Wed, 07 Apr 2021 02:09:57 -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=vHCO+ff+1k2d57MsEG3BMwS5OwIhUyc7ktiMitvzs6M=; b=BGnZYL8Ya1tc9fqUZKTzDh+AGGlwNsbys4hoX9PUG9uLE3JvgdoW+3P9Ig9MHv4z5N lPwNy6eoZ/4/Sfg1Ntq3XKjvqhNg21YUs5M+Hgsl5zGGBGjIdtSmmCfoavoLQl3GdElK ob9U8rmSunVPc1LVkNJZJb/fgRatL+/WI82kEXWEyKtC6u9kBo4cpMUVxjhqeFAjJg3v iAQHuYnGI/egALdrJAJYxwr8IThzRGNYZhxEMTodbNYKf8g5w1fvduxca8eut9amqmwu dHwlFyhrkdKOyUqkHVb2QhqaOUi4sc9/ZiFs3707gomRIhG98idDT/cd64Jb25rMJ2X6 Si6Q== X-Gm-Message-State: AOAM531JlxTffK/JCVRtW3GrCnuvgdEdtqWrMKEj9LXAmWc+D5HRa/3M 5cZYPntcJFj0pT75CN6+qaGum7KzYYzNdPitwGLC/jgQQYwiaZ/U59OJkhBYOXmvs1p+J5DDGA3 2HUDc8KBRURhO9WHgjHg= X-Received: by 2002:a67:f84a:: with SMTP id b10mr1208000vsp.10.1617786597491; Wed, 07 Apr 2021 02:09:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKYvg7f3jAdUx3B4xOeQTkcvTD64faAo63buKZqueRWAI04ZpJunmUV4UiHwbIbduOV+8wzClQQgaYy4LdOSY= X-Received: by 2002:a67:f84a:: with SMTP id b10mr1207992vsp.10.1617786597242; Wed, 07 Apr 2021 02:09:57 -0700 (PDT) MIME-Version: 1.0 References: <20210222104131.11979-1-roy.shterman@vastdata.com> <63d59764-3a86-6b7d-97c3-28a8d1a6eebb@intel.com> In-Reply-To: <63d59764-3a86-6b7d-97c3-28a8d1a6eebb@intel.com> From: David Marchand Date: Wed, 7 Apr 2021 11:09:46 +0200 Message-ID: To: Roy Shterman Cc: dev , "Burakov, Anatoly" , Yuval Mintz , Aviv Ben David , 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-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 Thu, Apr 1, 2021 at 1:07 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() falsely* > > although we have hugepages available. > > > > Fixes: d435aad37da7 ("mem: support --huge-unlink mode") Cc: stable@dpdk.org > > > > Signed-off-by: Roy Shterman > Acked-by: Anatoly Burakov Applied, thanks. -- David Marchand