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

10 messages, 3 authors, 2021-01-22 · open the first message on its own page

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

From: Bill Wendling <morbo@google.com>
Date: 2021-01-18 02:33:35

On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
[ big snip ]
[More snippage.]
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
I would like to know what the impact of the Clang's Integrated
Assembler and DWARF v5 are.

I dropped both means...

1. Do not pass "LLVM_IAS=1" to make.
2. Use default DWARF v2 (with Nick's patchset: CONFIG_DEBUG_INFO_DWARF2=y).

...for a successfull build and boot on bare metal.
[Next message]
On each rebuild I need to pass to make ...?

  LLVM=1 -fprofile-use=vmlinux.profdata
Yes.
Did you try together with passing LLVM_IAS=1 to make?
One of my tests was with the integrated assembler enabled. Are you
finding issues with it?

The problem with using top-of-tree clang is that it's not necessarily
stable. You could try using the clang 11.x release (changing the
"CLANG_VERSION >= 120000" in kernel/pgo/Kconfig/ to "CLANG_VERSION >=
110000").

-bw

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

From: Sedat Dilek <hidden>
Date: 2021-01-18 12:47:23

On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4

- Sedat -
quoted
I would like to know what the impact of the Clang's Integrated
Assembler and DWARF v5 are.

I dropped both means...

1. Do not pass "LLVM_IAS=1" to make.
2. Use default DWARF v2 (with Nick's patchset: CONFIG_DEBUG_INFO_DWARF2=y).

...for a successfull build and boot on bare metal.
[Next message]
quoted
On each rebuild I need to pass to make ...?

  LLVM=1 -fprofile-use=vmlinux.profdata
Yes.
quoted
Did you try together with passing LLVM_IAS=1 to make?
One of my tests was with the integrated assembler enabled. Are you
finding issues with it?

The problem with using top-of-tree clang is that it's not necessarily
stable. You could try using the clang 11.x release (changing the
"CLANG_VERSION >= 120000" in kernel/pgo/Kconfig/ to "CLANG_VERSION >=
110000").

-bw

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

From: Sedat Dilek <hidden>
Date: 2021-01-18 17:36:32

On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.

For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724

Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.

Thanks.

Regards,
- Sedat -
quoted
quoted
I would like to know what the impact of the Clang's Integrated
Assembler and DWARF v5 are.

I dropped both means...

1. Do not pass "LLVM_IAS=1" to make.
2. Use default DWARF v2 (with Nick's patchset: CONFIG_DEBUG_INFO_DWARF2=y).

...for a successfull build and boot on bare metal.
[Next message]
quoted
On each rebuild I need to pass to make ...?

  LLVM=1 -fprofile-use=vmlinux.profdata
Yes.
quoted
Did you try together with passing LLVM_IAS=1 to make?
One of my tests was with the integrated assembler enabled. Are you
finding issues with it?

The problem with using top-of-tree clang is that it's not necessarily
stable. You could try using the clang 11.x release (changing the
"CLANG_VERSION >= 120000" in kernel/pgo/Kconfig/ to "CLANG_VERSION >=
110000").

-bw

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

From: Bill Wendling <morbo@google.com>
Date: 2021-01-18 21:58:02

On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.

-bw

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

From: Sedat Dilek <hidden>
Date: 2021-01-18 23:30:32

On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
quoted
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.
That means to build the first PGO-enabled kernel with clang-11 and
rebuild in a second step again with the same clang-11.

Just FYI:
I was able to boot into a Linux-kernel  rebuild with *no  LLVM_IAS=1*
(means use "GNU AS 2.35.1") set and DWARF5 using LLVM=1 from
LLVM/Clang-12.

- Sedat -

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

From: Sedat Dilek <hidden>
Date: 2021-01-21 06:00:48

On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
I downgraded to clang-11.1.0-rc1.
( See attachment. )

Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works.

But again after generating vmlinux.profdata and doing the PGO-rebuild
- the resulting Linux-kernel does NOT boot in QEMU or on bare metal.
With GNU/as I can boot.

So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF
v2 is not allowed).
There is something wrong (here) with passing LLVM_IAS=1 to make when
doing the PGO-rebuild.

Can someone please verify and confirm that the PGO-rebuild with
LLVM_IAS=1 boots or boots not?

Thanks.

- Sedat -
quoted
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.

-bw

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

From: Sedat Dilek <hidden>
Date: 2021-01-21 22:45:59

On Thu, Jan 21, 2021 at 3:03 AM Sedat Dilek [off-list ref] wrote:
On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
I downgraded to clang-11.1.0-rc1.
( See attachment. )

Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works.

But again after generating vmlinux.profdata and doing the PGO-rebuild
- the resulting Linux-kernel does NOT boot in QEMU or on bare metal.
With GNU/as I can boot.

So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF
v2 is not allowed).
There is something wrong (here) with passing LLVM_IAS=1 to make when
doing the PGO-rebuild.

Can someone please verify and confirm that the PGO-rebuild with
LLVM_IAS=1 boots or boots not?

Thanks.

- Sedat -
quoted
quoted
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.
I passed LLVM_IAS=1 with KAFLAGS=-fprofile-use=vmlinux.profdata:

/usr/bin/perf_5.10 stat make V=1 -j4 HOSTCC=clang HOSTCXX=clang++
HOSTLD=ld.lld CC=clang LD=ld.lld PAHOLE=/opt/paho
le/bin/pahole LOCALVERSION=-2-amd64-clang11-pgo KBUILD_VERBOSE=1
KBUILD_BUILD_HOST=iniza KBUILD_BUILD_USER=sedat.dilek@gmail.com
KBUILD_BUILD_TIMESTAMP=2021-01-21 bind
eb-pkg KDEB_PKGVERSION=5.11.0~rc4-2~bullseye+dileks1 LLVM=1
KCFLAGS=-fprofile-use=vmlinux.profdata LLVM_IAS=1
KAFLAGS=-fprofile-use=vmlinux.profdata

The resulting Linux-kernel does not boot.

But I see in the build-log these warnings:

warning: arch/x86/platform/efi/quirks.c: Function control flow change
detected (hash mismatch) efi_arch_mem_reserve Hash = 73770966985
[-Wbackend-plugin]
warning: arch/x86/platform/efi/efi.c: Function control flow change
detected (hash mismatch) efi_attr_is_visible Hash = 57959232386
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) memcmp Hash = 12884901887
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) bcmp Hash = 12884901887
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) strcmp Hash = 44149752232
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) strnlen Hash = 29212902728
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) simple_strtoull Hash =
288230479369728480 [-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) strstr Hash = 76464046323
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) strchr Hash = 30948479515
[-Wbackend-plugin]
warning: arch/x86/boot/compressed/string.c: Function control flow
change detected (hash mismatch) kstrtoull Hash = 288230543187488006
[-Wbackend-plugin]

What does "Function control flow change detected (hash mismatch)" mean?
Related with my boot problems?

- Sedat -

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

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2021-01-22 01:44:03

On Wed, Jan 20, 2021 at 6:03 PM Sedat Dilek [off-list ref] wrote:
On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
I downgraded to clang-11.1.0-rc1.
( See attachment. )

Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works.

But again after generating vmlinux.profdata and doing the PGO-rebuild
- the resulting Linux-kernel does NOT boot in QEMU or on bare metal.
With GNU/as I can boot.

So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF
v2 is not allowed).
There is something wrong (here) with passing LLVM_IAS=1 to make when
doing the PGO-rebuild.

Can someone please verify and confirm that the PGO-rebuild with
LLVM_IAS=1 boots or boots not?
I was able to build+boot with LLVM_IAS=1 on my personal laptop (no
dwarf 5, just mainline+v5).
Thanks.

- Sedat -
quoted
quoted
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.
I agree, providing test results with patches that haven't landed yet
can cloud the interpretation of results.  It would be helpful to drop
local patch sets before trying this.

If the resulting image still isn't working for you, can you please
provide your config? Surely we'd be able to reproduce boot failures in
QEMU?  Nothing comes to mind about a change of assemblers causing an
issue; I would assume assembly cannot be instrumented by the compiler
(even though the compiler is the "driver" of the assembler).

The hash warnings are certainly curious.
IndexedInstrProfReader::getInstrProfRecord() is the only place in LLVM
sources that can emit that.
-- 
Thanks,
~Nick Desaulniers

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

From: Sedat Dilek <hidden>
Date: 2021-01-22 01:50:03

On Fri, Jan 22, 2021 at 2:43 AM Nick Desaulniers
[off-list ref] wrote:
On Wed, Jan 20, 2021 at 6:03 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
I downgraded to clang-11.1.0-rc1.
( See attachment. )

Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works.

But again after generating vmlinux.profdata and doing the PGO-rebuild
- the resulting Linux-kernel does NOT boot in QEMU or on bare metal.
With GNU/as I can boot.

So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF
v2 is not allowed).
There is something wrong (here) with passing LLVM_IAS=1 to make when
doing the PGO-rebuild.

Can someone please verify and confirm that the PGO-rebuild with
LLVM_IAS=1 boots or boots not?
I was able to build+boot with LLVM_IAS=1 on my personal laptop (no
dwarf 5, just mainline+v5).
To clarify:

I can build a PGO-enabled Linux-kernel and boot it.
Afterwards generate a vmlinux.profdata.
In a next step: A rebuild without PGO-Kconfig disabled + LLVM_IAS=1
does not boot.

- Sedat -
quoted
Thanks.

- Sedat -
quoted
quoted
Can you give me a LLVM commit-id where you had success with LLVM_IAS=1
and especially CONFIG_DEBUG_INFO_DWARF5=y?
Success means I was able to boot in QEMU and/or bare metal.
The DWARF5 patch isn't in yet, so I don't want to rely upon it too much.
I agree, providing test results with patches that haven't landed yet
can cloud the interpretation of results.  It would be helpful to drop
local patch sets before trying this.

If the resulting image still isn't working for you, can you please
provide your config? Surely we'd be able to reproduce boot failures in
QEMU?  Nothing comes to mind about a change of assemblers causing an
issue; I would assume assembly cannot be instrumented by the compiler
(even though the compiler is the "driver" of the assembler).

The hash warnings are certainly curious.
IndexedInstrProfReader::getInstrProfRecord() is the only place in LLVM
sources that can emit that.
--
Thanks,
~Nick Desaulniers

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

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2021-01-22 01:53:52

On Thu, Jan 21, 2021 at 5:49 PM Sedat Dilek [off-list ref] wrote:
On Fri, Jan 22, 2021 at 2:43 AM Nick Desaulniers
[off-list ref] wrote:
quoted
On Wed, Jan 20, 2021 at 6:03 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 10:56 PM Bill Wendling [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 9:26 AM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 1:39 PM Sedat Dilek [off-list ref] wrote:
quoted
On Mon, Jan 18, 2021 at 3:32 AM Bill Wendling [off-list ref] wrote:
quoted
On Sun, Jan 17, 2021 at 4:27 PM Sedat Dilek [off-list ref] wrote:
quoted
[ big snip ]
[More snippage.]
quoted
[ CC Fangrui ]

With the attached...

   [PATCH v3] module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for
undefined symbols

...I was finally able to boot into a rebuild PGO-optimized Linux-kernel.
For details see ClangBuiltLinux issue #1250 "Unknown symbol
_GLOBAL_OFFSET_TABLE_ loading kernel modules".
Thanks for confirming that this works with the above patch.
quoted
@ Bill Nick Sami Nathan

1, Can you say something of the impact passing "LLVM_IAS=1" to make?
The integrated assembler and this option are more-or-less orthogonal
to each other. One can still use the GNU assembler with PGO. If you're
having an issue, it may be related to ClangBuiltLinux issue #1250.
quoted
2. Can you please try Nick's DWARF v5 support patchset v5 and
CONFIG_DEBUG_INFO_DWARF5=y (see attachments)?
I know Nick did several tests with PGO. He may have looked into it
already, but we can check.
Reproducible.

LLVM_IAS=1 + DWARF5 = Not bootable

I will try:

LLVM_IAS=1 + DWARF4
I was not able to boot into such a built Linux-kernel.
PGO will have no effect on debugging data. If this is an issue with
DWARF, then it's likely orthogonal to the PGO patch.
quoted
For me worked: DWARF2 and LLVM_IAS=1 *not* set.

Of course, this could be an issue with my system's LLVM/Clang.

Debian clang version
12.0.0-++20210115111113+45ef053bd709-1~exp1~20210115101809.3724
Please use the official clang 11.0.1 release
(https://releases.llvm.org/download.html), modifying the
kernel/pgo/Kconfig as I suggested above. The reason we specify clang
12 for the minimal version is because of an issue that was recently
fixed.
I downgraded to clang-11.1.0-rc1.
( See attachment. )

Doing the first build with PGO enabled plus DWARF5 and LLVM_IAS=1 works.

But again after generating vmlinux.profdata and doing the PGO-rebuild
- the resulting Linux-kernel does NOT boot in QEMU or on bare metal.
With GNU/as I can boot.

So this is independent of DWARF v4 or DWARF v5 (LLVM_IAS=1 and DWARF
v2 is not allowed).
There is something wrong (here) with passing LLVM_IAS=1 to make when
doing the PGO-rebuild.

Can someone please verify and confirm that the PGO-rebuild with
LLVM_IAS=1 boots or boots not?
I was able to build+boot with LLVM_IAS=1 on my personal laptop (no
dwarf 5, just mainline+v5).
To clarify:

I can build a PGO-enabled Linux-kernel and boot it.
Afterwards generate a vmlinux.profdata.
In a next step: A rebuild without PGO-Kconfig disabled + LLVM_IAS=1
does not boot.
Does the rebuild produce the hash warnings previously reported?

Can you send your .config for this?
-- 
Thanks,
~Nick Desaulniers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help