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 E332842503 for ; Tue, 5 Sep 2023 12:15:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E74B040289; Tue, 5 Sep 2023 12:15:18 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id B6CF04026A for ; Tue, 5 Sep 2023 12:15:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693908917; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dvBrJlU3El8Tn+/umHhNdGFcHsWMhM1jTXSglZ+jal4=; b=C+DYwNZs/7e3wWRM4/GDFNd8Cgz1Q5qhdcJlmWhkddw2ft+qFwWR8j+TKHmjNd75rJyVgd 6hAWc+mMScnK0zdJgvYn0bh1Nyg0u9uf0g54eh70LWBJS11tsXAtSJwEoScD8u+OgIy5E/ y1phUoq84oNKjRPmnY6AhWhZU1lZPnA= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-536-_VEF9TCjMlyeTCZObS2-XQ-1; Tue, 05 Sep 2023 06:15:15 -0400 X-MC-Unique: _VEF9TCjMlyeTCZObS2-XQ-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-500a675a034so2438676e87.1 for ; Tue, 05 Sep 2023 03:15:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693908914; x=1694513714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dvBrJlU3El8Tn+/umHhNdGFcHsWMhM1jTXSglZ+jal4=; b=CiDtvJqSa7oa9sFr47vEgRi3eKb1MldxUbmIaptabNBw1dabfoYwJs2Su05ypZ0TFB i00yjFp7aLPPmJ4VYWsldkvqFbXpCSy0HDTzleGyfoVFVlj7NjO9oIiesDPTZ6yDx13m 46J3coA9Jc5RN81+CaE377zoYtQnZ0NMFnpMDZwsls+KusF3AbzTxF3giE6rtPuljmON PIqo3lg4ngwOgCKr9BVtnf40aS3Ox6k9laolQGJWqgxFP2TTiNmeNTAMhrrvLx9JXK00 ZaE8FH6X9O0a1sEAVoA2JxSyoMANOb6ltZrpCwjnoj+NYS8lChxYjkl3si2ahnfZKtlu PYrA== X-Gm-Message-State: AOJu0YzNXkxyPJ66e7gpHFfWsvCA6kN4HX6OrNHB0n+g3jIuYfdpvwjx lztwJA/OcE+UqN1me6ORL8+mSpwOUPyF3RTeo5htLMJ4bqDbGfqhRJXZbq/AqJrFcOBbg4bR/x0 KCfz2YeBgAzQ0iaJgNhAj/rc= X-Received: by 2002:a05:6512:a88:b0:500:b53f:fbc2 with SMTP id m8-20020a0565120a8800b00500b53ffbc2mr10141891lfu.26.1693908914406; Tue, 05 Sep 2023 03:15:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/3FskU3ya4k5WfT38dHFyfhk6fbbqEzDKKRUVdGiTo5Wp8oUZvNLxnpThLWeSbMbZYLAjLrc1I6YrGNtROg4= X-Received: by 2002:a05:6512:a88:b0:500:b53f:fbc2 with SMTP id m8-20020a0565120a8800b00500b53ffbc2mr10141857lfu.26.1693908914003; Tue, 05 Sep 2023 03:15:14 -0700 (PDT) MIME-Version: 1.0 References: <20230830103303.2428995-1-artemyko@nvidia.com> <20230904082455.3864024-1-artemyko@nvidia.com> <20230905100553.0b6518ca@sovereign> In-Reply-To: From: David Marchand Date: Tue, 5 Sep 2023 12:15:02 +0200 Message-ID: Subject: Re: [PATCH v2] eal: fix memory initialization deadlock To: Artemy Kovalyov Cc: Dmitry Kozlyuk , "dev@dpdk.org" , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ophir Munk , "stable@dpdk.org" , Anatoly Burakov , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Stephen Hemminger X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Tue, Sep 5, 2023 at 11:05=E2=80=AFAM Artemy Kovalyov wrote: > > > > + /* memory_hotplug_lock is taken in rte_eal_init(), so it= 's > > > + * safe to call thread-unsafe version. > > > + */ > > > > Nit: the lock is really taken in rte_eal_memory_init(). > > Probably "The lock is held during initialization, so..." > > would more robust against code changes and differences between platform= s. > > It was previously located differently, but in the current version, it has= been shifted to rte_eal_init(). It might be worth noting this to ensure th= at if there are further code changes in the future, the locking problem bec= omes more apparent. We had discussed this in the bug report. One option to explore is lock annotations. One note thought: those annotations do not get inherited in called code. So some special care is needed to maintain/annotate all code leading to the locations where the locks do matter. Quick example with rte_memseg_list_walk: https://github.com/david-marchand/dpdk/commit/mem_annotations And clang catches a deadlock: https://github.com/david-marchand/dpdk/actions/runs/6082842080/job/16501450= 978#step:19:816 --=20 David Marchand