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 25DB7A04DC; Mon, 19 Oct 2020 18:23:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 754C8E275; Mon, 19 Oct 2020 18:23:24 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id CF35EE271 for ; Mon, 19 Oct 2020 18:23:22 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id j18so255909pfa.0 for ; Mon, 19 Oct 2020 09:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q3n1LnEaNZENSJ3VEbDlrSuyUZ9jqtS6sk2S1cirk7w=; b=OOWpes86j1fYi6V1HkJGuLOWLqfrCQUUml2ndeK/5Y0ULE0V/sdKj2J2VATjIiMP1E +sDoE8pzl7FOdoE4BGv27B39OYz/UxbaUJ30M1hI37Pmu3mYawhTsm9yKTezSguKWDZD InMteb6SGaSEWzqly6dowLijk+mO13J//i3mNHXkoJeW3K4H2GIgkdBQFxQ/1nb+b1vj 9GWcBR2TGQqs70uBbJOtvG/L9qxDNBAVz1Y7ApZsm40svOOadm/BAo3ditm+IaL/C0WR P5Vy4Vmdcd2L/Pc0RZKHedHirLre7rxt/ojKSXBzfil4GBGFdkmR+qvuJjVipjxvXtO4 tYIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q3n1LnEaNZENSJ3VEbDlrSuyUZ9jqtS6sk2S1cirk7w=; b=Bjt2qmK5pq3zRVz70aD6Q5n98xR4zilvQxGM4vHX4d0C8rr22JJ6K4ov/P19tQKW8j G4hz8C9Op76iOnE0gRWPPvSQc7XfSwj3kN0ELLJG7451ie4foyy/fgBCay78vdIv50L2 tQSyxsepo2A4vPkjSxWUOJ9sPzVDjPqL1J1wZxAWKY9pJjfdbbI4sIifzUrU42H4IBtt XedGtMbMfZ8qI908vEQLgDh8+nOknP8LMVELWAV2pNNk2ggRAiRdYZOp/UlcKURnoClH AW7v7Ej6tVKagn9YQjJp7BezI8zFyxmzJUx6k+4TMe07VtkST1TKHTEUQOZ1W/jpUbjJ e5lg== X-Gm-Message-State: AOAM531G0bR4GQcfTUMkqfZhmJgp+pamqYy3N9A2htzWS6JBBokeFLUi ev6M+wr8Cypx4VJKYcm+Nn6842PHhav/CQ== X-Google-Smtp-Source: ABdhPJyHHaLBr0YQvx4meaV2zm81D7HA3W/UKjBsA/HkMqaq0mhBQ0bf95I58JOTKDdDf5yFO9Pivg== X-Received: by 2002:a63:ea4f:: with SMTP id l15mr384417pgk.434.1603124600288; Mon, 19 Oct 2020 09:23:20 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r3sm324700pfl.67.2020.10.19.09.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 09:23:19 -0700 (PDT) Date: Mon, 19 Oct 2020 09:23:11 -0700 From: Stephen Hemminger To: dev@dpdk.org Cc: Anatoly Burakov Message-ID: <20201019092311.1cf170aa@hermes.local> In-Reply-To: <20201019154235.17799-1-stephen@networkplumber.org> References: <20201019154235.17799-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] mem: close rtemap files 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 Mon, 19 Oct 2020 08:42:35 -0700 Stephen Hemminger wrote: > The memory subsystem is leaving open a file descriptor for each > rtemap file. This can lead to hundreds of extra open file descriptors > which has negative side effects. For example, the application may go > over its maximum file descriptor limit, or the application may be using > limited API's like select that only allow 1024 file descriptors. > > The EAL memory subsystem does not need to hold the file open. > Probably the original intention was to keep the file locked, but that is > not necessary. The Linux kernel keeps a reference count on the file, > and the mmap counts is a reference and therefore maintains the file > as locked. > > The fix is one line just close the file after it is setup. > > Fixes: 582bed1e1d1d ("mem: support mapping hugepages at runtime") > Cc: anatoly.burakov@intel.com > Signed-off-by: Stephen Hemminger This is fixes the open files, but has issues on shutdown. Will send new version later.