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 A1AC9430DB; Wed, 23 Aug 2023 16:56:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 636C5410F1; Wed, 23 Aug 2023 16:56:20 +0200 (CEST) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id 86E4640223 for ; Wed, 23 Aug 2023 16:56:19 +0200 (CEST) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-565439b6b3fso2923165a12.2 for ; Wed, 23 Aug 2023 07:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692802578; x=1693407378; 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=ElU3Do6ntHHpzU+deo0ZUnQYrA7nqVqR2kbT5d2gM5A=; b=TifmzxCxbNN0tBPMCwfBl4+Z1hPSuXi8puIMxz2ReLLg0pr+fIlnkStNfYAU929FnZ NyhloH/fHGfDqG91qYrgn8q5+EO7zEitNLRpUNVrc6PbrH98oTYtWtDAMY5o4kgAbcdV ALvqugvLlQ4PpCtLp6xEbvg1RFev7QU2D3JiocZI2nL/Qtxbb1mmudk77nPXAXPc5zIV W/kkNpNn2Fymf7LaT24lpRGMDzc+ILBVEVryEJibDVD+KRvPkLxQtmk73GqSzPuT0K72 1f4yExL9Ddp8qBlzbpp0DMJmXZDsd55OKLpmxzOYFi6U4z/ADTc4f9nlX5xgBWBXXoCB SbiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692802578; x=1693407378; 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=ElU3Do6ntHHpzU+deo0ZUnQYrA7nqVqR2kbT5d2gM5A=; b=Nm8s4nTU9qXYPe1q6BR5AZt/XsD4sFk+dUFtrsN80+yBUM47tXVVXtJmFvvX0xJe60 c685965ytYRrdd00f/G9gIx9UolPuVtSs6P5IKLhJNiwfldUJ9PdJAt7nHtqaDXsqwe6 dFWv3jDHllCr5WFRHlVDbjbOjI+MQYjDKsLXSJmD36VBGvY2nU7fgUvBLAQ8eh3+qVo1 kgp1KwAwvvvCzt8hBCf3at+EHlSIw+iVtKs4BjIobadJhz1OzvLQFk9FWPsgruStxDzJ rV7Q5B/WRTDYlNRiZOOMLD2MXszXsCiJ//23tWCg7Q0Eyceq9tcE86Yw+W7Wdlaew0hc TWEg== X-Gm-Message-State: AOJu0YwGte+uHsskJNhrFLLqWrbLVi9T+gsNOQ7a/eXHTMDEy9pfCuz2 FKfFlOqG07lw8BHsoMR0QpjXXg== X-Google-Smtp-Source: AGHT+IFlMsWZxn54aYlrPMe8UU22uXOybwfhCvAaJyrzaOhFkU3FUVjKpuaK9uxxpc4QRsBS+ptHxQ== X-Received: by 2002:a17:90b:3553:b0:269:60ed:d495 with SMTP id lt19-20020a17090b355300b0026960edd495mr8891129pjb.27.1692802578480; Wed, 23 Aug 2023 07:56:18 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id 4-20020a17090a004400b00268032f6a64sm5372183pjb.25.2023.08.23.07.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 07:56:18 -0700 (PDT) Date: Wed, 23 Aug 2023 07:56:16 -0700 From: Stephen Hemminger To: bugzilla@dpdk.org Cc: dev@dpdk.org Subject: Re: [Bug 1277] memory_hotplug_lock deadlock during initialization Message-ID: <20230823075616.45b2f971@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 > It seems the issue arose due to changes in the DPDK read-write lock > implementation. Following these changes, the RW-lock no longer supports > recursion, implying that a single thread shouldn't obtain a read lock if it > already possesses one. The problem arises during initialization: the > rte_eal_memory_init() function acquires the memory_hotplug_lock, and later on, > the sequence of calls eal_memalloc_init() -> rte_memseg_list_walk() acquires it > again without releasing it. This scenario introduces the risk of a potential > deadlock when concurrent write locks are applied to the same > memory_hotplug_lock. To address this locally, we resolved the issue by > replacing rte_memseg_list_walk() with rte_memseg_list_walk_thread_unsafe(). recursive read locks are bad idea and the fact that it worked before was an accident. Please send patch for review.