From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 066E7A00B8; Mon, 28 Oct 2019 11:47:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 13A5B1BEE4; Mon, 28 Oct 2019 11:47:52 +0100 (CET) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 57D341BEE3 for ; Mon, 28 Oct 2019 11:47:50 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id m9so1090531ljh.8 for ; Mon, 28 Oct 2019 03:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=iEUOKILIBDwbtcsh7aFIOd8bIlBk3r7aAoDHosfXPwM=; b=llWPMl+5b+mUXIA4HNfI54CasBwQyxt2Jr724GjRi5diNVWWYTR1k8RUFKEoXAzhJa +ILFK+sco4I4lfw8yVzuVZy82qt3mGuTwUs8E2ICtD1B/HKE/Md6j1pwKf5urUsN2y4P LlRpYw/4uC0owtuy5PaUigLhNPihzccdpvRp0qoER88846ChTtVYORgI14slbA8g3FJh V0stPWFiZSC5GQkT+W9btqbhFtF8JONoNmF0FeB55KQYVn2jlehBre2d638XW+4x2ily wm9wylRdAwMekNFwJZcyHPmKpnMstww0XyIxI0s5ge6yGjJl/3a3mhAKZy8jxx0XERoV pSnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iEUOKILIBDwbtcsh7aFIOd8bIlBk3r7aAoDHosfXPwM=; b=GjIrPctaKhSxRVprP1KYI/MsRtW7glyi7Eg8uxBs4CmUJ29XIiMSSqkjwo6B6rHA6o E6LfCoVajyBbfuC4a4FTsEW6+9VPHYoxVJUHJc0moqeO1OZyTw5DLc71zzcLRt9TOBpK vSZd5zuwC8FbBk8L+6/ZLB6NC4nofi715uN8bjnNfpdNo6tNgMrioRJOFI+UR+qauFyS WKvNnEgWjhmRiEuOV7oXcBcoRLBxbSUjq5nytkQBM4tCG+foABe/SbS/zmcc+z3QL45N 2lZDB+APtn7kC38ssQkV7bFS6CoWqWICBbut6LBsINlR2QIlAG6V19qSmEyszLGzjp7M 9kNw== X-Gm-Message-State: APjAAAXJVY9aQX79KpICpPmo5F4iTSO+6CknIUXGFqQ70R7yWNBIW1CL io4vcAXtVYVb6Z/6CgOBR21xsg== X-Google-Smtp-Source: APXvYqzfJiN1E6VAb5SoTskpoOPVXTdt5pw0ekLzJRM7Uqkp7ltyJSq59Q3giVi6KixXT8zirJRsrA== X-Received: by 2002:a2e:6a02:: with SMTP id f2mr453289ljc.174.1572259669759; Mon, 28 Oct 2019 03:47:49 -0700 (PDT) Received: from [10.0.0.72] (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id a6sm86035lji.30.2019.10.28.03.47.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Oct 2019 03:47:49 -0700 (PDT) To: Thomas Monjalon Cc: dev@dpdk.org, Aaron Conole , Michael Santana , John McNamara , Marko Kovacevic , David Hunt , Bruce Richardson , Vladimir Medvedkin , Robert Sanford , Erik Gabriel Carrillo , mattias.ronnblom@ericsson.com, stephen@networkplumber.org References: <20190917075754.8310-1-amo@semihalf.com> <20191022115412.8837-1-aostruszka@marvell.com> <20191022115412.8837-2-aostruszka@marvell.com> <12578231.CQkhPFEoQU@xps> From: Andrzej Ostruszka Message-ID: <1bb37fbc-bf02-9485-fcb5-0c342ccee4f6@semihalf.com> Date: Mon, 28 Oct 2019 11:47:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <12578231.CQkhPFEoQU@xps> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 01/10] build: add an option to enable LTO build 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Thank you Thomas for the comments. Please see below for replies. On 10/27/19 12:47 PM, Thomas Monjalon wrote: > Adding John and Marko for doc review. > > 22/10/2019 13:54, Andrzej Ostruszka: >> --- /dev/null >> +++ b/doc/guides/prog_guide/lto.rst > > This new file is not included in the prog guide index. Will add it (between "writing efficient code" and "profile app"). >> @@ -0,0 +1,36 @@ > > You are missing the mandatory SPDX and Copyright header. Will add. >> +Link Time Optimization >> +====================== >> + >> +The DPDK framework supports compilation with link time optimization > > Instead of "The DPDK framework", I prefer just "DPDK". OK >> +turned on. This depends obviously on the capabilities of the compiler > > Not sure what you are talking about. > If it is about fat objects, it is not obvious. > >> +to do "whole program" optimization at link time and is available only That was not a reference to some formally defined "capabilities" just an "obvious" statement that in order to benefit from LTO one needs a compiler "capable of" performing it. I will rephrase this paragraph as: -8<------------- The DPDK supports compilation with link time optimization turned on. This depends obviously on the ability of the compiler to do "whole program" optimization at link time and is available only for compilers that support that feature (gcc and icc). To be more specific, compiler (in addition to performing LTO) have to support creation of ELF objects containing both normal code and internal representation (fat-lto-objects). This is required since during build some code is generated by parsing produced ELF objects (pmdinfogen). -8<------------- Will it suffice? If not, then please suggest wording to be used. >> +for compilers that support that feature (gcc and icc). To be more > > Please start a new sentence at the beginning of a line in the RsT file. > It is easier to review and update. OK >> +specific compiler have to support creation of ELF objects containing > > A comma is missing after "specific". OK >> +both normal code and internal representation (fat-lto-objects). This is >> +required since during build some code is generated by parsing produced >> +ELF objects (pmdinfogen). >> + >> +The amount of performance gain that one can get from LTO depends on the >> +compiler and the code that is being compiled. However LTO is also >> +useful for additional code analysis done by the compiler. In particular >> +due to interprocedural analysis compiler can produce additional warnings >> +about variables that might be used uninitialized. Some of these >> +warnings might be "false positives" though and you might need to >> +explicitly initialize variable in order to silence the compiler. > > Any word about build speed degradation? It is mentioned at the end of this file - I will move it here. >> +Link time optimization can be enabled for whole DPDK framework by >> +setting: >> + >> +.. code-block:: console >> + CONFIG_ENABLE_LTO=y >> + >> +in config file for the case of make based build and by: >> + >> +.. code-block:: console >> + meson build -Db_lto=true >> + ninja -C build > > No need to add the ninja step here. OK >> +for the case of meson based build. > > Better to describe the case (make or meson) before the code-block. OK >> +Please note that turning LTO on causes considerable extension of >> +compilation time. > > "compilation time" is not accurate. > When referring to compilation + linking, it is better to use the words > "build time". OK >> --- a/doc/guides/rel_notes/release_19_11.rst >> +++ b/doc/guides/rel_notes/release_19_11.rst >> @@ -56,6 +56,14 @@ New Features >> Also, make sure to start the actual text at the margin. >> ========================================================= >> >> +**Added build support for Link Time Optimization.** >> + >> + LTO is an optimization technique used by the compiler to perform whole >> + program analysis and optimization at link time. In order to do that >> + compilers store their internal representation of the source code that >> + the linker uses at the final stage of compilation process. >> + >> + See :doc:`../prog_guide/lto` for more information: > > Please rebase and add a blank line when adding a paragraph. OK [...] > I wanted to merge this series in 19.11-rc1 but I think it is better > to move its merge in 19.11-rc2. OK. I'll send the next version today. Thank you again for the comments. Regards Andrzej