From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by dpdk.org (Postfix) with ESMTP id 928971F1C for ; Mon, 29 Oct 2018 11:11:20 +0100 (CET) Received: by mail-ed1-f53.google.com with SMTP id y20-v6so6739211eds.10 for ; Mon, 29 Oct 2018 03:11:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4hOFwM+YNhjktq1mXseRBzVQKJYidPRiTYe54QxLGDM=; b=noG4h6FHWudIGdryT0EzqihHWlafJOoH6Wn155lSVuE20bvNr2rSM9eJBn+WGs2aNK ChXxHgPgRgGJHFEL87XE6yzfj9kBuWLPNo1/8EC970o78VxW+lcnKdfsc/SB9BV2fOyP xjOpU4SV78hQbhYtbshanHcbJLiTNNeK8NC+vwELUjsSgtDcNwczsYA68RW6MhqNTFNv T3o3/HiLA+KwPN23gtp9AIq1llfehDSik1+NP2DrNunmuyGYUDYReJ+u3TqoSCKvaULG z17tUQu2syng1t/JBbdKA3pJRDIj/0wtsfM1/brmF+5TnXp/e0Q1EOhTaIaXanWduluS t3pQ== 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=4hOFwM+YNhjktq1mXseRBzVQKJYidPRiTYe54QxLGDM=; b=aV5RFSypK+HXW05wV+fFQQPDNITRhOCMk6/Vk8I1oeLaoNdzX1cpoIb/t41pGF+Icv vcv6x7Nipp+P8J5mBu+IuNP/gPj/k/4vb7xl46TtvV+OAsCjNwxA7RA40hhK+7L5/jqZ a3ov9QeVTlckZA1IjNGYubXoRjC4IYSEIvu9xDdacHiofDMtWg0svAhRYBeLZqtz2RZ5 UaxY1QheWGzAH3Etk+mMHFZvpbry4ZqbhZITC54+UDz9ldpxHfTVPlVr5+LseM8DLaS6 Bpx8gukf4dX2RdfWrW64G+lmMgkUTczqtKiWxwQLDVcDfDUVijMO5YKlKqwRCpGgtP2e U3BQ== X-Gm-Message-State: AGRZ1gKSkvA/huTQzF2gJmVPr4V6TwgEw4RPtcwBScQmTaAUQH/n34SI AGgDh9i2KiEiZ/vHrgzCkBWP18ohxHtP9NR08MWKHQ== X-Google-Smtp-Source: AJdET5d26TgDnKomE7v/adDnUzvSuAUlC/De3YNhkkSS460Ul3LhKDwkmVBk4AbPTG59QF5jR3plm5ksxIgAHwVS9MA= X-Received: by 2002:a17:906:5583:: with SMTP id y3-v6mr9973132ejp.79.1540807880198; Mon, 29 Oct 2018 03:11:20 -0700 (PDT) MIME-Version: 1.0 References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> <1593678.TTmrtHRuFR@xps> <2DBBFF226F7CF64BAFCA79B681719D954502B7E1@shsmsx102.ccr.corp.intel.com> <1651382.pnTT7vZl36@xps> In-Reply-To: <1651382.pnTT7vZl36@xps> From: Alejandro Lucero Date: Mon, 29 Oct 2018 10:11:09 +0000 Message-ID: To: Thomas Monjalon Cc: lei.a.yao@intel.com, dev , "Xu, Qian Q" , xueqin.lin@intel.com, "Burakov, Anatoly" , Ferruh Yigit Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3 0/6] use IOVAs check based on DMA mask 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: , X-List-Received-Date: Mon, 29 Oct 2018 10:11:20 -0000 I know what is going on. In patchset version 3 I forgot to remove an old code. Anatoly spotted that and I was going to send another version for fixing it. Before sending the new version I saw that report about a problem with dma_mask and I'm afraid I did not send another version with the fix ... Yao, can you try with next patch?: *diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c* *index ef656bbad..26adf46c0 100644* *--- a/lib/librte_eal/common/eal_common_memory.c* *+++ b/lib/librte_eal/common/eal_common_memory.c* @@ -458,10 +458,6 @@ rte_eal_check_dma_mask(uint8_t maskbits) return -1; } - /* keep the more restricted maskbit */ - if (!mcfg->dma_maskbits || maskbits < mcfg->dma_maskbits) - mcfg->dma_maskbits = maskbits; - /* create dma mask */ mask = ~((1ULL << maskbits) - 1); On Mon, Oct 29, 2018 at 9:48 AM Thomas Monjalon wrote: > 29/10/2018 10:36, Yao, Lei A: > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > 29/10/2018 09:23, Yao, Lei A: > > > > Hi, Lucero, Thomas > > > > > > > > This patch set will cause deadlock during memory initialization. > > > > rte_memseg_walk and try_expand_heap both will lock > > > > the file &mcfg->memory_hotplug_lock. So dead lock will occur. > > > > > > > > #0 rte_memseg_walk > > > > #1 <-rte_eal_check_dma_mask > > > > #2 <-alloc_pages_on_heap > > > > #3 <-try_expand_heap_primary > > > > #4 <-try_expand_heap > > > > > > > > Log as following: > > > > EAL: TSC frequency is ~2494156 KHz > > > > EAL: Master lcore 0 is ready (tid=7ffff7fe3c00;cpuset=[0]) > > > > [New Thread 0x7ffff5e0d700 (LWP 330350)] > > > > EAL: lcore 1 is ready (tid=7ffff5e0d700;cpuset=[1]) > > > > EAL: Trying to obtain current memory policy. > > > > EAL: Setting policy MPOL_PREFERRED for socket 0 > > > > EAL: Restoring previous memory policy: 0 > > > > > > > > Could you have a check on this? A lot of test cases in our validation > > > > team fail because of this. Thanks a lot! > > > > > > Can we just call rte_memseg_walk_thread_unsafe()? > > > > > > +Cc Anatoly > > > > Hi, Thomas > > > > I change to rte_memseg_walk_thread_unsafe(), still > > Can't work. > > > > EAL: Setting policy MPOL_PREFERRED for socket 0 > > EAL: Restoring previous memory policy: 0 > > EAL: memseg iova 140000000, len 40000000, out of range > > EAL: using dma mask ffffffffffffffff > > EAL: alloc_pages_on_heap(): couldn't allocate memory due to DMA mask > > EAL: Trying to obtain current memory policy. > > EAL: Setting policy MPOL_PREFERRED for socket 1 > > EAL: Restoring previous memory policy: 0 > > EAL: memseg iova 1bc0000000, len 40000000, out of range > > EAL: using dma mask ffffffffffffffff > > EAL: alloc_pages_on_heap(): couldn't allocate memory due to DMA mask > > error allocating rte services array > > EAL: FATAL: rte_service_init() failed > > EAL: rte_service_init() failed > > PANIC in main(): > > I think it is showing there are at least 2 issues: > 1/ deadlock > 2/ allocation does not comply with mask check (out of range) > > >