From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 622FADE0 for ; Wed, 13 Sep 2017 00:13:58 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5078720AC6; Tue, 12 Sep 2017 18:13:56 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 12 Sep 2017 18:13:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=UkgHEHKz0BdLfRr BZusX1nggINdalZUFpx6uXjP/oag=; b=oqQzGsPRCy6cUfVZJ20Xnnrbl9aTVBS 9CZxojbQ8V4VDJjayrxllt9xTwBWkUzZLFSy1U0CEnvO/v2u2yQw3JjSSNa4uk4O COHFJ2Egw9Jw8n3KRm5ZubvpBLuWjbNQcKS4bM5OsLfb3u6+DlM3Q9FiDXt7WW+V gwKc4Pgfvpd0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=UkgHEHKz0BdLfRrBZusX1nggINdalZUFpx6uXjP/oag=; b=WFSqF+0s ak42wMlODESXuOhsa1ga1FiaXUYMVUcxg5qeDqw/GGvdQC0IpoCwOlv+l/kN5M8C HDfW2924H6pX1G48Pjp76BmtBjMg5G1FdabHbmhxm6lMFX9TCyGLcOIOKWIbIKB6 kY13YQJx6sMBpN7KBZR2aSupa3nmRLBqml/Xm84wrzNHt/yC9hKKIUAwx/aleQ2R d4dbMHYeKh4wckOwDHls0aYiZ9Ce0pDjvIN6cjMvcaqwhNif/62xukJmRP1KufOJ ehvbDc5JP7bviJ5bqIXMWf/P5ti3iAQPl9lV8thcbr8Z3WKfugdTYvg38+CCOSSR ZaIP4zhCTqp8JA== X-ME-Sender: X-Sasl-enc: br+lu6Ix0uqLuzI90eZ2pPNSu95tTahpyJu1zKzckd9M 1505254436 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id F39937E409; Tue, 12 Sep 2017 18:13:55 -0400 (EDT) From: Thomas Monjalon To: Aaron Conole Cc: Eelco Chaudron , dev@dpdk.org, jingjing.wu@intel.com, john.mcnamara@intel.com Date: Wed, 13 Sep 2017 00:13:55 +0200 Message-ID: <65446528.e11mYSnacx@xps> In-Reply-To: References: <22990026376b08418cb0eb6f028840c03e89f47f.1505221429.git.echaudro@redhat.com> <1863612.973jloI4LL@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] app/testpmd: adds mlockall() to fix pages 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: Tue, 12 Sep 2017 22:13:58 -0000 12/09/2017 22:29, Aaron Conole: > Thomas Monjalon writes: > > > 12/09/2017 16:50, Aaron Conole: > >> Eelco Chaudron writes: > >> > >> > Call the mlockall() function, to attempt to lock all of its process > >> > memory into physical RAM, and preventing the kernel from paging any > >> > of its memory to disk. > >> > > >> > When using testpmd for performance testing, depending on the code path > >> > taken, we see a couple of page faults in a row. These faults effect > >> > the overall drop-rate of testpmd. On Linux the mlockall() call will > >> > prefault all the pages of testpmd (and the DPDK libraries if linked > >> > dynamically), even without LD_BIND_NOW. > >> > > >> > Signed-off-by: Eelco Chaudron > >> > >> Acked-by: Aaron Conole > > > > It is interesting, but why make it in testpmd? > > > > Maybe it should be documented in this guide: > > http://dpdk.org/doc/guides/linux_gsg/nic_perf_intel_platform.html > > Well, I'm not sure what the user would be able to do to get the > prefaulting performance without having a library they use with > LD_PRELOAD and a function with the constructor attribute which does the > same thing, AND export LD_BIND_NOW before linking starts. > > The LD_BIND_NOW simply does the symbol resolution, but there's no > guarantee that it will fault all the code pages in to process space, and > without an mlockall(), I'm not sure that there's any kind of guarantee > that they don't get swapped out of resident memory (which also leads to > later page faults). > > Maybe I misunderstood the question? Maybe you misunderstood :) I was saying that if this improvement applies to applications, it should be documented in the tuning guide.