From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 8E658160 for ; Mon, 29 Oct 2018 09:23:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Oct 2018 01:23:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,439,1534834800"; d="scan'208";a="82367677" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga008.fm.intel.com with ESMTP; 29 Oct 2018 01:23:44 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 29 Oct 2018 01:23:44 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.84]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.161]) with mapi id 14.03.0415.000; Mon, 29 Oct 2018 16:23:42 +0800 From: "Yao, Lei A" To: Thomas Monjalon , Alejandro Lucero CC: "dev@dpdk.org" , "Xu, Qian Q" , "Lin, Xueqin" Thread-Topic: [dpdk-dev] [PATCH v3 0/6] use IOVAs check based on DMA mask Thread-Index: AQHUbwHVCqPw4mslyE66+0cqAeEf9aU14R4g Date: Mon, 29 Oct 2018 08:23:41 +0000 Message-ID: <2DBBFF226F7CF64BAFCA79B681719D954502B75A@shsmsx102.ccr.corp.intel.com> References: <1538743527-8285-1-git-send-email-alejandro.lucero@netronome.com> <4805099.7RpDHruce7@xps> In-Reply-To: <4805099.7RpDHruce7@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTFkZGJlMWMtYmIxYi00MzQ1LTliOTktODgzNmM4MzcwMTNlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiV0w1VFRabUdOV1lac2lGTnBKWm9Vc1creXVqTGkrRzR0V2taUW1nS1NJMkx6VDBadXRoMUcwOWw1dDAwUE84NiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 08:23:46 -0000 Hi, Lucero, Thomas This patch set will cause deadlock during memory initialization.=20 rte_memseg_walk and try_expand_heap both will lock=20 the file &mcfg->memory_hotplug_lock. So dead lock will occur.=20 #0 rte_memseg_walk #1 <-rte_eal_check_dma_mask #2 <-alloc_pages_on_heap #3 <-try_expand_heap_primary =20 #4 <-try_expand_heap Log as following: EAL: TSC frequency is ~2494156 KHz EAL: Master lcore 0 is ready (tid=3D7ffff7fe3c00;cpuset=3D[0]) [New Thread 0x7ffff5e0d700 (LWP 330350)] EAL: lcore 1 is ready (tid=3D7ffff5e0d700;cpuset=3D[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=20 team fail because of this. Thanks a lot! BRs Lei > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Monday, October 29, 2018 5:04 AM > To: Alejandro Lucero > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 0/6] use IOVAs check based on DMA > mask >=20 > 05/10/2018 14:45, Alejandro Lucero: > > I sent a patchset about this to be applied on 17.11 stable. The memory > > code has had main changes since that version, so here it is the patchse= t > > adjusted to current master repo. > > > > This patchset adds, mainly, a check for ensuring IOVAs are within a > > restricted range due to addressing limitations with some devices. There > > are two known cases: NFP and IOMMU VT-d emulation. > > > > With this check IOVAs out of range are detected and PMDs can abort > > initialization. For the VT-d case, IOVA VA mode is allowed as long as > > IOVAs are within the supported range, avoiding to forbid IOVA VA by > > default. > > > > For the addressing limitations known cases, there are just 40(NFP) or > > 39(VT-d) bits for handling IOVAs. When using IOVA PA, those limitations > > imply 1TB(NFP) or 512M(VT-d) as upper limits, which is likely enough fo= r > > most systems. With machines using more memory, the added check will > > ensure IOVAs within the range. > > > > With IOVA VA, and because the way the Linux kernel serves mmap calls > > in 64 bits systems, 39 or 40 bits are not enough. It is possible to > > give an address hint with a lower starting address than the default one > > used by the kernel, and then ensuring the mmap uses that hint or hint p= lus > > some offset. With 64 bits systems, the process virtual address space is > > large enoguh for doing the hugepages mmaping within the supported > range > > when those addressing limitations exist. This patchset also adds a chan= ge > > for using such a hint making the use of IOVA VA a more than likely > > possibility when there are those addressing limitations. > > > > The check is not done by default but just when it is required. This > > patchset adds the check for NFP initialization and for setting the IOVA > > mode is an emulated VT-d is detected. Also, because the recent patchset > > adding dynamic memory allocation, the check is also invoked for ensurin= g > > the new memsegs are within the required range. > > > > This patchset could be applied to stable 18.05. >=20 > Applied, thanks >=20 >=20 >=20