Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1601699pxj; Sat, 12 Jun 2021 13:59:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxY6pIxXO2+PgSrHkULJMBoi3kd9CjdJ7g+Ug44bKmdUInUxNXP90oR5mbD7roldTbZxBGx X-Received: by 2002:a17:906:2b85:: with SMTP id m5mr9108975ejg.141.1623531564960; Sat, 12 Jun 2021 13:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623531564; cv=none; d=google.com; s=arc-20160816; b=grZWiZ5pc5C/wnJspwrcFcrTyPPolMkPaYMko+pZJv2KXgkGwSutGc6f5BlyLfU/EC Unj68uFwKgGLD29B0HAqqb5ufM0Os01/I5lbF+Ymqvqv9fWXNYNW7qBS8MfO3kboCNv1 FllgIQHdy9O65RMfWa+eOEKoN2vEqKXgLRUnfzNGw6aLntx8F3WpA3zMOBlExybgeh8o UgqiCJopapZOc0Lj3BEKJLY5qkz9j/TdtJavnJsWeeHy9HhWt+koBPa2VRImTINUnNmm 4B2tz/Ssfwhux6HMS1A4p7/ooZON0E4N27rjXb2SEg9R3KlGvKNWNvG8nq1ctCpAHoSw GG9Q== 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:in-reply-to :references:mime-version:dkim-signature; bh=OSnBn94ZP8p/1/buUtxgjO9fzVQ2s0+6fGFuy2vE7IA=; b=UjV9hmvMQ7DBT7QD9SibGkEKb3Z1xwH0iiFKzer9PRYcEzpT/fjcApjmhu+l3pJLXR ECMyYYJ/Vhln7qwwzNh2F7C+FqHtlT1VFnBxjL8WsI9rKpRQn/vWxb0SIxFWNgHO7y23 lfaf6rzveAxoCeH8dLNtqiiN43iDBGX25Ozf98DastVSnaNnCA5sC3SEsdUVkWhpSEQ3 NWAwTjaQFk9P2Q9iDjbQAUW0OqrNt7/s1yYty3upNCnLQSkQEqpXW2unpzxAL7j+EZn5 DfI+Qz2wVIauv1Y3bVkueeM0zzP/BuVLY6Ql+8JQ5i2A6ET2dZeDzInRhr65MlJSAbDK 7JmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=L8JRkLCo; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si1374736ejj.20.2021.06.12.13.59.02; Sat, 12 Jun 2021 13:59:24 -0700 (PDT) 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=@google.com header.s=20161025 header.b=L8JRkLCo; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231431AbhFLU7x (ORCPT + 99 others); Sat, 12 Jun 2021 16:59:53 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:45798 "EHLO mail-ed1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbhFLU7x (ORCPT ); Sat, 12 Jun 2021 16:59:53 -0400 Received: by mail-ed1-f45.google.com with SMTP id r7so26865651edv.12 for ; Sat, 12 Jun 2021 13:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OSnBn94ZP8p/1/buUtxgjO9fzVQ2s0+6fGFuy2vE7IA=; b=L8JRkLCoAJMOPS9X4wb9Vx9xV6mJeXX9OnrLLtLRj8v0O6TK1m6d3Q8IAUBuTVihqm Zr1Qnd26IEuwn8YxasVLvOa4MerfYNGg2/oBYidoU5xZitx7iFIEZCn/DreAIv9sGfzN QcmFY+jvINuN9oNXV0pfFvmnxTTgK70KhrTmn+U3JxmLtMkbrGjAKLG5QZdAyKz6fU4U xL6bxG9d1GFxenrPA8v32BZTHIyjHCh2JXfWr1pjHaoZ9gisaTtecsq9zHcDl38sxoJq iyTlaRLnjgAWXh05YQwRMC3/gwwS24HZ5ebqnqWuCuqdHeB41F++mXaSkBKOCF9u+fJD KgVw== 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=OSnBn94ZP8p/1/buUtxgjO9fzVQ2s0+6fGFuy2vE7IA=; b=rFrldp2O2BDhcGMdZDyVEUoC6KmhCKSiuXxxvd1tnNqldFbPGBeW6Erh0hy/GbU4oL /cZLA3xIaTdYygZbHGOtTc05jeqPiwYOwaQZ9UieMvfwjndvFzf+FLkSLNi9K2/qa3/b vzxaKlZ8yfsC+c2xq3NDf2xV0G3eJ5Se0bkEftFPDrZxiP98eQ8lb+NRLv43Xuf3Pcy1 jwC01AwZYicneC86W62szxDKpzOHo4WN1dhhlmcHYRUPKsRQwghzKygB1v5VSRv2PplU fKy9ZT6cjRblZ7G0wrFxUx8PfHzs6RjhjQUxq00Pgss3xMA702NSsHb5zAnW/Nxs2rfZ craQ== X-Gm-Message-State: AOAM533zllZLqSG8BIx09U/0/Uc/4DVVuYFQPYR9F+IssaPtMYZyJbwA ZmtnI8DnEY2GQinpvxyPSJU2BXTCpOjYUXvNAxkv X-Received: by 2002:a05:6402:946:: with SMTP id h6mr9974082edz.261.1623531412092; Sat, 12 Jun 2021 13:56:52 -0700 (PDT) MIME-Version: 1.0 References: <20210111081821.3041587-1-morbo@google.com> <20210407211704.367039-1-morbo@google.com> <20210612202505.GG68208@worktop.programming.kicks-ass.net> In-Reply-To: <20210612202505.GG68208@worktop.programming.kicks-ass.net> From: Bill Wendling Date: Sat, 12 Jun 2021 13:56:41 -0700 Message-ID: Subject: Re: [PATCH v9] pgo: add clang's Profile Guided Optimization infrastructure To: Peter Zijlstra Cc: Kees Cook , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , clang-built-linux , Andrew Morton , Nathan Chancellor , Nick Desaulniers , Sami Tolvanen , Fangrui Song , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 12, 2021 at 1:25 PM Peter Zijlstra wrote: > On Sat, Jun 12, 2021 at 12:10:03PM -0700, Bill Wendling wrote: > Yes it is, but is that sufficient in this case? It very much isn't for > KASAN, UBSAN, and a whole host of other instrumentation crud. They all > needed their own 'bugger-off' attributes. > > > > We've got KCOV and GCOV support already. Coverage is also not an > > > argument mentioned anywhere else. Coverage can go pound sand, we really > > > don't need a third means of getting that. > > > > > Those aren't useful for clang-based implementations. And I like to > > look forward to potential improvements. > > I look forward to less things doing the same over and over. The obvious > solution if of course to make clang use what we have, not the other way > around. > That is not the obvious "solution". > > > Do you have actual numbers that back up the sampling vs instrumented > > > argument? Having the instrumentation will affect performance which can > > > scew the profile just the same. > > > > > Instrumentation counts the number of times a branch is taken. Sampling > > is at a gross level, where if the sampling time is fine enough, you > > can get an idea of where the hot spots are, but it won't give you the > > fine-grained information that clang finds useful. Essentially, while > > sampling can "capture the hot spots very well", relying solely on > > sampling is basically leaving optimization on the floor. > > > > Our optimizations experts here have determined, through data of > > course, that instrumentation is the best option for PGO. > > It would be very good to post some of that data and explicit examples. > Hear-say don't carry much weight. Should I add measurements from waving a dead chicken over my keyboard? I heard somewhere that that works as well. Or how about a feature that hasn't been integrated yet, like using the perf tool apparently? I'm sure that will be worth my time. You can't just come up with a potential, unimplemented alternative (gcov is still a thing and not using "perf") and expect people to dance to your tune. I could give you numbers, but they would mean nothing to you, and I suspect that you would reject them out of hand because it may not benefit *everything*. The nature of FDO/PGO is that it's targeted to specific tasks. For example, Fangrui gave you numbers, and you rejected them out of hand. I've explained to you why instrumentation is better than sampling (at least for clang). Fangrui gave you numbers. Let's move on to something else. Now, for the "nointr" issue. I'll see if we need an additional change for that. -bw