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 2631B42B8E for ; Wed, 24 May 2023 16:50:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2311B40156; Wed, 24 May 2023 16:50:18 +0200 (CEST) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 967A540156 for ; Wed, 24 May 2023 16:50:16 +0200 (CEST) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-64d2c865e4eso782356b3a.0 for ; Wed, 24 May 2023 07:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1684939816; x=1687531816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=39b+Va/xZlKzrMHAPggdwgZi0NlvWXUbPMksoyLy7uo=; b=Ayl5E4upXzW2MLwvViPaQpyELLiM0veufv/b/A0NaHKcb8FNdg+KmXLzuWSnL1IA++ vy8ZWKdn3p9BtY2BxwVgIzVX/L2Hz8gOGD6D342ELw64hK+u385ISRpjAi0Vc7klLDDH n1gP027fPZRbwTbP5OsHgVl/rqvNQR4ZYwuSlofmSSWCnKZvb+E0v/2iND/OG9U8Ezdt w67WJhAnzB/RwvQLjnnrfTJHAMb7c/upOwcaiapBr4D8jzTE9g13Pisx+RmUGZku69Vl iH7HP7DCiZeoEU0o3BXi8ERPwMaDBkE1GdbhuzKDYqP9DS5oT4czSiwtcdWMecq/+9Mo sDOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684939816; x=1687531816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=39b+Va/xZlKzrMHAPggdwgZi0NlvWXUbPMksoyLy7uo=; b=BECljwDhNmkZ6IjGoBwYWfcvqiRzqtDJbSxZxtGmt5guscNaX0H0Gk4pKSyEoaWH50 FlY0BFLZXDUVOn6hnuNNFH9SSBVUMEtgLVXcA574dhmYz1yTKvyZH9DN0qpt+TDqUob1 hiZuqeaIsfRrAlrNglw/yt6sL7nblaXlZnHg9mxC2MJU4sqcuIrdUbWwv+Sf3KE7d3VA /KUKyXVsysy4TE6DC10ewA5YmQGXFhSaUKh6xMs3yqOo6jsrZCMhDelVAErFaqF5SnHV gEu+hDkw6tOMyGFzS4TP7XODtjt+v42HcWjmTEBe293+4UrnVfTk1mijDqz3otB2n1xj wn8g== X-Gm-Message-State: AC+VfDw/Nkvb9PSAMXQoiQp5iBGgNd4a9wphNSuFN11Ya5gFp0ZFyh7j 86/jmLI/A/xLmofK+RqIyhIIKA== X-Google-Smtp-Source: ACHHUZ7+sfW3gvuiZ3Lc1VcXltXm/sNYQLr585OcKuyNqTkJAI2WC40Txo4ZJcil5/lPHBOHF6/GmA== X-Received: by 2002:a05:6a00:13a9:b0:63d:2f13:200 with SMTP id t41-20020a056a0013a900b0063d2f130200mr3399690pfg.16.1684939815777; Wed, 24 May 2023 07:50:15 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a24-20020a62e218000000b00642f1e03dc1sm7711158pfi.174.2023.05.24.07.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 07:50:15 -0700 (PDT) Date: Wed, 24 May 2023 07:50:13 -0700 From: Stephen Hemminger To: Cc: , , , , Subject: Re: [PATCH] common/mlx5: adjust fork call with the new kernel API Message-ID: <20230524075013.3c2f7b6e@hermes.local> In-Reply-To: <20230524120140.416144-1-erezf@nvidia.com> References: <20230524120140.416144-1-erezf@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Wed, 24 May 2023 15:01:40 +0300 wrote: > From: Erez Ferber > > While doing process fork() the operating system remaps all the parent > process's memory to the address space of the child process and activates > the Copy-on-Write mechanics - it duplicates physical pages once memory > writing happens in the child process. Sometimes memory duplication is > not allowed - for example, if the page contains hardware queue > descriptors. To handle similar issues the rdma-core library should be > prepared for forking. > > The ibv_fork_init() prepares the library to track all the related memory > and prevent it from forking using madvise() system API. This approach > allows fork, but not all the memory is forked to the child process and, > application should care not to touch pages where the parent application > allocated the rdma-core objects. > > The newer kernels propose an option of copy-on-fork for DMA pages and > tracking all the memory and disabling it for the forking is no longer > needed. The new API routine ibv_is_fork_initialized() should be involved > to decide if library initialization for forking is required. > > Fixes: 0e83b8e536 ("net/mlx5: move rdma-core calls to separate file") > Cc: stable@dpdk.org > Signed-off-by: Erez Ferber I don't think DPDK applications should fork(), and lots other parts of the shared huge pages will break if an application does this.