From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) by dpdk.org (Postfix) with ESMTP id DCFAADED for ; Mon, 29 Oct 2018 11:16:09 +0100 (CET) Received: by mail-ed1-f54.google.com with SMTP id x2-v6so6759366eds.3 for ; Mon, 29 Oct 2018 03:16:09 -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=UTiNJhgc1qgEiiCDwU3DOFHRr98JCQgAz7YzqcDXj0Q=; b=ycT1V6L/DFFicMG73v4Trcr4vlZyZefAY8nWa0tKBwg6unxTLF7i7jxuqYLtIqSZtE N2kiYL9PsFU+8cvLqwWDdADISlN1+mlz7Za8+79i/jFBUdQ1Gy7AvQGwf2rXzlR7B7wF 80TC8Agi9UQdeKCIXl4LBUYoI3W7aI0pU9X9R5O5LcEvyJ+7+yYjTqMGKsgegph/cq52 +9lhrRFXiXDHJN5cdtamThzr2C/Xm8IfObgHk0wk+7/m4QsAlrytFTrw3gnv9yg+87p0 ELBg1OT9VvOMzwrFzZBQDg5LtgBTPidjNCSHAie6QzdJCDQDdsRkeU3vr3iIbT9IMPHX fjDA== 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=UTiNJhgc1qgEiiCDwU3DOFHRr98JCQgAz7YzqcDXj0Q=; b=oIJJgLXJ8j1grPHZ45BixKHnbJfcHnM9L2XVM2gzIVnav8xJnoY0RfbDnTTL6SV7AC IDeDkBbS657sDKln1WpvWq88GXfKCT1zTkhoHikFySzAbSfBy7U3eOJU3dNfIcDumo1a a6O1/UkywNGEPG0CWXNsuGe/RZJwDCUDzvYDFPaijDn+PcFYmNpfFXuTCUzUgrG6JsX3 3+CvV9P5TJhvP0Ii5fND5dC1ITC5I061jqheSKx/Xdtz3tqCzKz19qLR15v+8zyNXyT4 rv/fVJVM/3plIXnuVCDLb1VpjNzAPLxXDt6BlbSknMKCBcp7lUlGXgCog0pUZ5vDFb0d pnlw== X-Gm-Message-State: AGRZ1gIgR2hlcE0broiXNx28CQb9jj6OxPl4sJq7rEnIaYWQmv6MnYE5 60vaz0S3Mrh7XD1uMzBqYtKl6BNMHKiJTraCmCn1Og== X-Google-Smtp-Source: AJdET5dled4BgC/2LpiHnAhhX+0VC80Rne2Rj0gE6XQk7GN3PpDJLeUljQQgQzCJWq3P9rmdpmjqOzqVmYZC747Inhc= X-Received: by 2002:a50:86e7:: with SMTP id 36-v6mr12679224edu.104.1540808169540; Mon, 29 Oct 2018 03:16:09 -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: From: Alejandro Lucero Date: Mon, 29 Oct 2018 10:15:58 +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:16:10 -0000 Apologies. Forget my previous email. Just using the wrong repo. Looking at solving this asap. On Mon, Oct 29, 2018 at 10:11 AM Alejandro Lucero < alejandro.lucero@netronome.com> wrote: > 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) >> >> >>