Re: [RFC PATCH 0/5] pgo: Add PGO support for module profile data

From: jarmo . tiitto
Date: Mon Jun 14 2021 - 18:27:52 EST


Kees Cook wrote tiistaina 15. kesäkuuta 2021 0.57.46 EEST:
> On Sat, Jun 12, 2021 at 06:24:21AM +0300, Jarmo Tiitto wrote:
> > [...]
> > The patches itself are based on Kees/for-next/clang/features tree
> > where I have two of my bug fix patches already in. :-)
>
> BTW, due to the (soon to be addressed) requirements of noinstr[1],
> I've removed PGO from my -next tree, and moved it into its own tree in
> "for-next/clang/pgo".
>
> -Kees
>
> [1] https://lore.kernel.org/lkml/202106140921.5E591BD@keescook/
>
> --
> Kees Cook

Yeah, I noticed that. Actually, I think we really should wait for that noinstr
stuff since:

> There is an lockup that only occurs during bare metal run after +15min, so I
> haven't been able to catch it in VM.
> I suspect this is caused by the RCU locking I added such that it results in
> recursive calls into __llvm_profile_instrument_target()

That basically means LLVM is instrumenting code that I call from
__llvm_profile_instrument_target() resulting in nice cycle of doom.
Sigh...

I wrote fix for this but it would be nice to be sure the compiler
doesn't pull the rug under my toes. :-)
--
Jarmo