Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp678905pxb; Thu, 21 Jan 2021 17:47:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyetxEJURkYojc4twiaTSQLLYrNTtVhk39pJVaOzNPQ/l7tXqsGPrpBle2PCX+fCJoRpdvd X-Received: by 2002:a17:906:3101:: with SMTP id 1mr1467268ejx.115.1611280031844; Thu, 21 Jan 2021 17:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611280031; cv=none; d=google.com; s=arc-20160816; b=XkGJBzT1PUOA9fOiOyyg68t7ZqGm8dbzmDqh+G970zZqIYnw4rc0uS7GNsvOCB6m0c v7i65eJRzygUI62CTyWs9uant2IC8efH9AY4EjtC6jnjGypfh7Dn1mAJZn+HpqVlDbOo XhpZ9DiSlVE7BIlpyHTPv7wRYTmtI6n+zPgF92NU4JiSUuMHeo5nAFMDMJBqUtbmPrpD PdRlB7/4xgt1iGKH88oL95O2914HQ5lWKP7vxONLDAWFqd9/qlHVpEM+az9BYv+g9kw2 AcGiQ+bBR2rLCwH2nag3dVwGfQNjSsVVgq+A8p9Ob/5cQFA99dFScBJrZSfpc2nWakLX EaXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=ZrJ80j43VKcZseBzjEDXZkPUTdnyBRJJDoCKdAeE1fI=; b=wEBnHNzNnPLp9OFQQNzFrn5NzBJO9SF/K7jRxgDRB8SjVGsQUCdBvz3IZlobRT/NmX aNN2Il2c4xIEoMZDg2/MUKfYCI3Ukra7UaJJgIJxZFMpz2poOodaB959zLyFbZJ7KRmM AHpLXbMwRd392TUL1r0B4lZnvlI9uazXFHEE8CTguJc3AH1DsMEGV6bRTe/FX4mdKb4y imRXPu4lftzyzVsLdlvygR7dexAdhNUe+TUcpx7A565woYcYotUBOvJgGy5vsW1otGwf H5zfpGIC/Bel1Dau3knj70/wva/O/8Hl9axXhRVZ/fm9S5mJO10uOc0S2KK+QXTTQ3NN 5uBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BZHLJs8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp6si2426226ejc.532.2021.01.21.17.46.48; Thu, 21 Jan 2021 17:47:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BZHLJs8y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbhAVBoS (ORCPT + 99 others); Thu, 21 Jan 2021 20:44:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbhAVBoP (ORCPT ); Thu, 21 Jan 2021 20:44:15 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91F4EC0613ED; Thu, 21 Jan 2021 17:43:35 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id y19so8127510iov.2; Thu, 21 Jan 2021 17:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=ZrJ80j43VKcZseBzjEDXZkPUTdnyBRJJDoCKdAeE1fI=; b=BZHLJs8y7K7z7YH/cc5895ObD9XSbV79EkAZkoaVlzFA/QZxYwP7ZMPn1HmaLZKPrf WvMBu8rtxXlYkkCIZomHFjjLjP4fyPuLS6Xq+spyMsUajuQDZLcHrGZzi9ZzIeV1o8dO 6Jk5Fhir96oK70iFJ/gmVvJXlyfsqVprd2Cv2XlDY+nrg3DCRBi4Ibac2Lrf903p/uz7 xNuoAyXv7lQty/qBiiL82W5cFdFvxRt4tIbmwTJ03Z5jQ0oWxzMoIUfGb+60+5m4CDIV WBZV+F9gWwhXpVpRpwJaGBBwqouWi2mbEePE+miVKPhr7HkgHoU7QgYnR705S+I+V+rS 4obA== 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:reply-to :from:date:message-id:subject:to:cc; bh=ZrJ80j43VKcZseBzjEDXZkPUTdnyBRJJDoCKdAeE1fI=; b=e0tYzEvyIZ8nCM/BUyv+toeQGxfeqccuzT3QHArUfr83F2Rom5E2PR0MgM1VW7ZC9u W1gbF9p+TAYR52u4NQPvcGNNvwQxwNVW7WS//zgF2iyUpGLAafFBxWaDDlqERukCmM8A wty/iEZnUo54tCrQHEdbI9w94mybc2fnD34zNKR6l9PEK2VQx0kUXxWsZiO+LBqnaaU3 5nFWjmSZ5QXKg3ayDD8aJoYxPtbZOZvKlDk62CXqzP3T76dk3W0Nognp8vPwqMrvI6LP s/aLsndfYyX0IAszMKHS1A+7babUkDDZkR+0mHSB/I9ZJuXXt8d9+lLxqZa+LWee5259 g/3g== X-Gm-Message-State: AOAM533K93/eQsliw5P5ZDjnIgQj07C8GQQIYZu/GTaZxwSfizOeZxoh Zz/aQAfxCnMmm//d61bDpe6tTP8XIaCfSd/zECI= X-Received: by 2002:a5e:970c:: with SMTP id w12mr919750ioj.171.1611279814937; Thu, 21 Jan 2021 17:43:34 -0800 (PST) MIME-Version: 1.0 References: <20210111081821.3041587-1-morbo@google.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 22 Jan 2021 02:43:22 +0100 Message-ID: Subject: Re: [PATCH] pgo: add clang's Profile Guided Optimization infrastructure To: Nick Desaulniers Cc: Bill Wendling , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , Clang-Built-Linux ML , Andrew Morton , Nathan Chancellor , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 2:34 AM Nick Desaulniers wrote: > > On Wed, Jan 20, 2021 at 6:21 PM Sedat Dilek wrote: > > > > Hi, > > > > When I looked through the code I wondered why we do not add a > > "CONFIG_PGO_CLANG_PROFDATA" which can be helpful when doing the PGO > > rebuild with a vmlinux.profdata. > > > > This introduces a "PGO_PROFDATA" to turn on/off to pass > > "-fprofile-use=vmlinux.profdata" (see CFLAGS_PGO_CLANG_PROFDATA in > > top-level Makefile). > > > > If we turn off via "PGO_PROFILE := n" in several Makefiles - we should > > do the same and add "PGO_PROFDATA := n" to the same Makefiles? > > > > Please see the attached diff. > > This is a good idea; something that I brought up in initial code > review (on github). Would it be ok with you to land the core first, > then follow up with this suggestion? > > Also, AutoFDO production builds are so incredibly similar to PGO > builds that I could see a possible path forward: > 1. land PGO upstream > 2. adds docs for AutoFDO > 3. consider a config for hardcoding the location of the profiling data > so that we don't need to specify it at the command line invocation of > make. > I made a v3 - with some small nits. The idea was to do the "PGO-rebuild" handling a bit easier. But as you say that can wait. Some personal notes: I will be very happy when people verify/confirm what's going on with PGO-rebuild + LLVM_IAS=1. As said GNU/AS and PGO-rebuild is fine. ( This seems to be independent of clang-12 or clang-11. ) ( This seems to be independent of DWARF v4 or v5 enabled. ) The benefit here I saw was a reduction in build-time of 00:30 seen from a total 04:30 when using a PGO-rebuilt Linux-kernel. Approx. 10%? This is not much compared to a ThinLTO + PGO optimized LLVM toolchain whcih saved here 40% of build-time. - Sedat -