Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-21 Thread Kees Cook
On Tue, Aug 04, 2020 at 12:06:49PM -0400, Arvind Sankar wrote: > On Mon, Aug 03, 2020 at 09:45:32PM -0700, Andi Kleen wrote: > > > Why is that? Both .text and .text.hot have alignment of 2^4 (default > > > function alignment on x86) by default, so it doesn't seem like it should > > > matter for pac

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-04 Thread Arvind Sankar
On Mon, Aug 03, 2020 at 09:45:32PM -0700, Andi Kleen wrote: > > Why is that? Both .text and .text.hot have alignment of 2^4 (default > > function alignment on x86) by default, so it doesn't seem like it should > > matter for packing density. Avoiding interspersing cold text among > > You may lose

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Fāng-ruì Sòng
On 2020-08-03, Andi Kleen wrote: Why is that? Both .text and .text.hot have alignment of 2^4 (default function alignment on x86) by default, so it doesn't seem like it should matter for packing density. Avoiding interspersing cold text among You may lose part of a cache line on each unit bound

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Andi Kleen
> Why is that? Both .text and .text.hot have alignment of 2^4 (default > function alignment on x86) by default, so it doesn't seem like it should > matter for packing density. Avoiding interspersing cold text among You may lose part of a cache line on each unit boundary. Linux has a lot of units

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Fāng-ruì Sòng
On 2020-08-03, Arvind Sankar wrote: On Mon, Aug 03, 2020 at 12:05:06PM -0700, Andi Kleen wrote: > However, the history of their being together comes from > > 9bebe9e5b0f3 ("kbuild: Fix .text.unlikely placement") > > which seems to indicate there was some problem with having them separated out,

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Arvind Sankar
On Mon, Aug 03, 2020 at 12:05:06PM -0700, Andi Kleen wrote: > > However, the history of their being together comes from > > > > 9bebe9e5b0f3 ("kbuild: Fix .text.unlikely placement") > > > > which seems to indicate there was some problem with having them separated > > out, > > although I don't

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-03 Thread Andi Kleen
> However, the history of their being together comes from > > 9bebe9e5b0f3 ("kbuild: Fix .text.unlikely placement") > > which seems to indicate there was some problem with having them separated out, > although I don't quite understand what the issue was from the commit message. Separating it o

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-08-01 Thread Arvind Sankar
On Fri, Jul 31, 2020 at 11:18:02PM -0700, Kees Cook wrote: > On Fri, Jul 31, 2020 at 11:51:28PM -0400, Arvind Sankar wrote: > > > > This also changes the ordering to place all hot resp unlikely sections > > separate > > from other text, while currently it places the hot/unlikely bits of each > >

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-07-31 Thread Kees Cook
On Fri, Jul 31, 2020 at 11:51:28PM -0400, Arvind Sankar wrote: > On Fri, Jul 31, 2020 at 04:07:57PM -0700, Kees Cook wrote: > > From: Nick Desaulniers > > > > Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too. > > > > When compiling with profiling information (collected via P

Re: [PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-07-31 Thread Arvind Sankar
On Fri, Jul 31, 2020 at 04:07:57PM -0700, Kees Cook wrote: > From: Nick Desaulniers > > Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too. > > When compiling with profiling information (collected via PGO > instrumentations or AutoFDO sampling), Clang will separate code into >

[PATCH v5 13/36] vmlinux.lds.h: add PGO and AutoFDO input sections

2020-07-31 Thread Kees Cook
From: Nick Desaulniers Basically, consider .text.{hot|unlikely|unknown}.* part of .text, too. When compiling with profiling information (collected via PGO instrumentations or AutoFDO sampling), Clang will separate code into .text.hot, .text.unlikely, or .text.unknown sections based on profiling