Re: [PATCH v9] pgo: add clang's Profile Guided Optimization infrastructure

From: Kees Cook
Date: Tue Jun 01 2021 - 14:53:50 EST


On Mon, May 31, 2021 at 02:12:46PM -0700, Nathan Chancellor wrote:
> On Wed, May 19, 2021 at 02:37:26PM -0700, Kees Cook wrote:
> > I've added this to patch to my -next tree now:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=for-next/clang/pgo&id=e1af496cbe9b4517428601a4e44fee3602dd3c15
> >
>
> Would this be appropriate to send? Someone sent some patches based on
> this work so it would be nice to solidify how they will get to Linus
> if/when the time comes :)

Yeah, good idea.

> https://lore.kernel.org/r/20210528200133.459022-1-jarmo.tiitto@xxxxxxxxx/
> https://lore.kernel.org/r/20210528200432.459120-1-jarmo.tiitto@xxxxxxxxx/
> https://lore.kernel.org/r/20210528200821.459214-1-jarmo.tiitto@xxxxxxxxx/
> https://lore.kernel.org/r/20210528201006.459292-1-jarmo.tiitto@xxxxxxxxx/
> https://lore.kernel.org/r/20210528201107.459362-1-jarmo.tiitto@xxxxxxxxx/
> https://lore.kernel.org/r/20210528201213.459483-1-jarmo.tiitto@xxxxxxxxx/

BTW, Jarmo, if you haven't had this suggested yet, I'd recommend using
this kind of a script for your email sending workflow to get a set of
threaded patches:

#!/bin/sh
set -x

MYSELF="Your Name <and.email@xxxxxxxxx>"
prefix="PATCH"
# or
#prefix="PATCH v2"
# etc...
SHA="SHA your series is based on"


format_args="--cover-letter -n -o outgoing/"
maint_args="--norolestats"

mkdir -p outgoing
git format-patch $format_args --subject-prefix "$prefix" "$SHA"

./scripts/checkpatch.pl "$@" --codespell outgoing/0*patch

${EDITOR:-vi} outgoing/*

# Send patches
git send-email --transfer-encoding=8bit --8bit-encoding=UTF-8 \
--no-chain-reply-to --thread \
--from="$MYSELF" --cc="$MYSELF" \
--to-cmd="./scripts/get_maintainer.pl $maint_args -m" \
--cc-cmd="./scripts/get_maintainer.pl $maint_args --nom" \
outgoing/*


>
> Cheers,
> Nathan
>
> ======================================
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index c45613c30803..0d03f6ccdb70 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14378,9 +14378,13 @@ F: include/uapi/linux/personality.h
> PGO BASED KERNEL PROFILING
> M: Sami Tolvanen <samitolvanen@xxxxxxxxxx>
> M: Bill Wendling <wcw@xxxxxxxxxx>
> +M: Kees Cook <keescook@xxxxxxxxxxxx>
> R: Nathan Chancellor <nathan@xxxxxxxxxx>
> R: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
> +L: clang-built-linux@xxxxxxxxxxxxxxxx
> S: Supported
> +B: https://github.com/ClangBuiltLinux/linux/issues
> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/clang/pgo

I think I'm going to keep things combined in a single tree for now since the patch rate
is low:

+T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/clang/features

> F: Documentation/dev-tools/pgo.rst
> F: kernel/pgo/
>

I should likely do the same entry for CFI.

--
Kees Cook