Re: [PATCH v4 6/6] Add Propeller configuration for kernel build.

2024-10-23 Thread Masahiro Yamada
On Wed, Oct 23, 2024 at 4:25 PM Arnd Bergmann wrote: > > On Wed, Oct 23, 2024, at 07:06, Masahiro Yamada wrote: > > On Tue, Oct 22, 2024 at 9:00 AM Rong Xu wrote: > > > >> > > +=== > >> > > + > >> > > +Configure the kernel with:: > >> > > + > >> > > + CONFIG_AUTOFDO_CLANG=y > >> > > >>

Re: [PATCH v2 1/7] s390/kdump: implement is_kdump_kernel()

2024-10-23 Thread David Hildenbrand
On 23.10.24 09:42, Heiko Carstens wrote: On Mon, Oct 21, 2024 at 04:45:59PM +0200, David Hildenbrand wrote: For my purpose (virtio-mem), it's sufficient to only support "kexec triggered kdump" either way, so I don't care. So for me it's good enough to have bool is_kdump_kernel(void) {

Re: [PATCH v2 1/7] s390/kdump: implement is_kdump_kernel()

2024-10-23 Thread Heiko Carstens
On Mon, Oct 21, 2024 at 04:45:59PM +0200, David Hildenbrand wrote: > For my purpose (virtio-mem), it's sufficient to only support "kexec > triggered kdump" either way, so I don't care. > > So for me it's good enough to have > > bool is_kdump_kernel(void) > { > return oldmem_data.start; > }

Re: [PATCH net] Documentation: ieee802154: fix grammar

2024-10-23 Thread Miquel Raynal
Hi Leo, leocst...@gmail.com wrote on Tue, 22 Oct 2024 21:12:01 -0700: > Fix grammar where it improves readability. > > Signed-off-by: Leo Stone Reviewed-by: Miquel Raynal Thanks, Miquèl

Re: [PATCH v4 6/6] Add Propeller configuration for kernel build.

2024-10-23 Thread Masahiro Yamada
On Tue, Oct 22, 2024 at 9:00 AM Rong Xu wrote: > > > +=== > > > + > > > +Configure the kernel with:: > > > + > > > + CONFIG_AUTOFDO_CLANG=y > > > > > > This is automatically met due to "depends on AUTOFDO_CLANG". > > Agreed. But we will remove the dependency from PROPELlER_CLANG to > A

Re: [PATCH v4 6/6] Add Propeller configuration for kernel build.

2024-10-23 Thread Arnd Bergmann
On Wed, Oct 23, 2024, at 07:06, Masahiro Yamada wrote: > On Tue, Oct 22, 2024 at 9:00 AM Rong Xu wrote: > >> > > +=== >> > > + >> > > +Configure the kernel with:: >> > > + >> > > + CONFIG_AUTOFDO_CLANG=y >> > >> > >> > This is automatically met due to "depends on AUTOFDO_CLANG". >> >> Ag

Re: [PATCH v2 1/7] s390/kdump: implement is_kdump_kernel()

2024-10-23 Thread Alexander Egorenkov
Hi David, David Hildenbrand writes: > Staring at the powerpc implementation: > > /* > * Return true only when kexec based kernel dump capturing method is used. > * This ensures all restritions applied for kdump case are not automatically > * applied for fadump case. > */ > bool is_kdump

Re: [PATCH v4 6/6] Add Propeller configuration for kernel build.

2024-10-23 Thread Rong Xu
While Propeller often works best with AutoFDO (or the instrumentation based FDO), it's not required. One can use Propeller (or similar post-link-optimizer, like Bolt) on plain kernel builds. So I will remove "depends on AUTOFDO_CLANG". I will not use "imply" -- simpler is better here. -Rong On W

Re: [PATCH v6 3/6] KVM: arm64: Add support for PSCI v1.2 and v1.3

2024-10-23 Thread Miguel Luis
> On 19 Oct 2024, at 17:15, David Woodhouse wrote: > > From: David Woodhouse > > As with PSCI v1.1 in commit 512865d83fd9 ("KVM: arm64: Bump guest PSCI > version to 1.1"), expose v1.3 to the guest by default. The SYSTEM_OFF2 > call which is exposed by doing so is compatible for userspace bec

Re: [PATCH v6 2/6] KVM: arm64: Add PSCI v1.3 SYSTEM_OFF2 function for hibernation

2024-10-23 Thread Miguel Luis
Hi David, > On 19 Oct 2024, at 17:15, David Woodhouse wrote: > > From: David Woodhouse > > The PSCI v1.3 specification adds support for a SYSTEM_OFF2 function > which is analogous to ACPI S4 state. This will allow hosting > environments to determine that a guest is hibernated rather than just

Re: [PATCH 0/1] remoteproc documentation changes

2024-10-23 Thread Jonathan Corbet
anish kumar writes: > This patch series transitions the documentation > for remoteproc from the staging directory to the > mainline kernel. It introduces both kernel and > user-space APIs, enhancing the overall documentation > quality. > > V4: > Fixed compilation errors and moved documentation to

[PATCH v4 2/6] alloc_tag: introduce shutdown_mem_profiling helper function

2024-10-23 Thread Suren Baghdasaryan
Implement a helper function to disable memory allocation profiling and use it when creation of /proc/allocinfo fails. Ensure /proc/allocinfo does not get created when memory allocation profiling is disabled. Signed-off-by: Suren Baghdasaryan --- lib/alloc_tag.c | 33 ++---

Re: [PATCH v4 1/6] maple_tree: add mas_for_each_rev() helper

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > Add mas_for_each_rev() function to iterate maple tree nodes in reverse > order. > > Suggested-by: Liam R. Howlett > Signed-off-by: Suren Baghdasaryan > Reviewed-by: Liam R. Howlett Reviewed-by: Pasha Tatashin > --- > include/linu

Re: [PATCH v4 5/6] alloc_tag: introduce pgtag_ref_handle to abstract page tag references

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > To simplify later changes to page tag references, introduce new > pgtag_ref_handle type. This allows easy replacement of page_ext > as a storage of page allocation tags. > > Signed-off-by: Suren Baghdasaryan Reviewed-by: Pasha Tatashi

Re: [PATCH 0/1] remoteproc documentation changes

2024-10-23 Thread Jonathan Corbet
Jonathan Corbet writes: > anish kumar writes: > >> This patch series transitions the documentation >> for remoteproc from the staging directory to the >> mainline kernel. It introduces both kernel and >> user-space APIs, enhancing the overall documentation >> quality. >> >> V4: >> Fixed compilat

Re: [PATCH v4 2/6] alloc_tag: introduce shutdown_mem_profiling helper function

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > Implement a helper function to disable memory allocation profiling and > use it when creation of /proc/allocinfo fails. > Ensure /proc/allocinfo does not get created when memory allocation > profiling is disabled. > > Signed-off-by: Sur

Re: [PATCH v4 3/6] alloc_tag: load module tags into separate contiguous memory

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > When a module gets unloaded there is a possibility that some of the > allocations it made are still used and therefore the allocation tags > corresponding to these allocations are still referenced. As such, the > memory for these tags c

Re: [PATCH v4 6/6] alloc_tag: support for page allocation tag compression

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > Implement support for storing page allocation tag references directly > in the page flags instead of page extensions. sysctl.vm.mem_profiling > boot parameter it extended to provide a way for a user to request this > mode. Enabling comp

Re: [PATCH v4 4/6] alloc_tag: populate memory for module tags as needed

2024-10-23 Thread Pasha Tatashin
On Wed, Oct 23, 2024 at 1:08 PM Suren Baghdasaryan wrote: > > The memory reserved for module tags does not need to be backed by > physical pages until there are tags to store there. Change the way > we reserve this memory to allocate only virtual area for the tags > and populate it with physical p

[PATCH v4 0/6] page allocation tag compression

2024-10-23 Thread Suren Baghdasaryan
This patchset implements several improvements: 1. Gracefully handles module unloading while there are used allocations allocated from that module; 2. Provides an option to store page allocation tag references in the page flags, removing dependency on page extensions and eliminating the memory overh

[PATCH v4 1/6] maple_tree: add mas_for_each_rev() helper

2024-10-23 Thread Suren Baghdasaryan
Add mas_for_each_rev() function to iterate maple tree nodes in reverse order. Suggested-by: Liam R. Howlett Signed-off-by: Suren Baghdasaryan Reviewed-by: Liam R. Howlett --- include/linux/maple_tree.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/maple_tree

[PATCH v4 3/6] alloc_tag: load module tags into separate contiguous memory

2024-10-23 Thread Suren Baghdasaryan
When a module gets unloaded there is a possibility that some of the allocations it made are still used and therefore the allocation tags corresponding to these allocations are still referenced. As such, the memory for these tags can't be freed. This is currently handled as an abnormal situation and

[PATCH v4 5/6] alloc_tag: introduce pgtag_ref_handle to abstract page tag references

2024-10-23 Thread Suren Baghdasaryan
To simplify later changes to page tag references, introduce new pgtag_ref_handle type. This allows easy replacement of page_ext as a storage of page allocation tags. Signed-off-by: Suren Baghdasaryan --- include/linux/mm.h | 25 +- include/linux/pgalloc_tag.h | 92 ++

[PATCH v4 4/6] alloc_tag: populate memory for module tags as needed

2024-10-23 Thread Suren Baghdasaryan
The memory reserved for module tags does not need to be backed by physical pages until there are tags to store there. Change the way we reserve this memory to allocate only virtual area for the tags and populate it with physical pages as needed when we load a module. Signed-off-by: Suren Baghdasar

Re: [PATCH v6 1/6] firmware/psci: Add definitions for PSCI v1.3 specification

2024-10-23 Thread Miguel Luis
> On 19 Oct 2024, at 17:15, David Woodhouse wrote: > > From: David Woodhouse > > The v1.3 PSCI spec (https://developer.arm.com/documentation/den0022) adds > the SYSTEM_OFF2 function. Add definitions for it and its hibernation type > parameter. > > Signed-off-by: David Woodhouse > --- > inc

Re: [PATCH 07/12] huge_memory: Allow mappings of PMD sized pages

2024-10-23 Thread Alistair Popple
Alistair Popple writes: > Alistair Popple wrote: >> Dan Williams writes: [...] >>> + >>> + return VM_FAULT_NOPAGE; >>> +} >>> +EXPORT_SYMBOL_GPL(dax_insert_pfn_pmd); >> >> Like I mentioned before, lets make the exported function >> vmf_insert_folio() and move the pte, pmd, pud internal pri

[PATCH v5 1/7] Add AutoFDO support for Clang build

2024-10-23 Thread Rong Xu
Add the build support for using Clang's AutoFDO. Building the kernel with AutoFDO does not reduce the optimization level from the compiler. AutoFDO uses hardware sampling to gather information about the frequency of execution of different code paths within a binary. This information is then used to

Re: [PATCH 07/12] huge_memory: Allow mappings of PMD sized pages

2024-10-23 Thread Dan Williams
Alistair Popple wrote: > > Alistair Popple writes: > > > Alistair Popple wrote: > >> Dan Williams writes: > > [...] > > >>> + > >>> + return VM_FAULT_NOPAGE; > >>> +} > >>> +EXPORT_SYMBOL_GPL(dax_insert_pfn_pmd); > >> > >> Like I mentioned before, lets make the exported function > >> vmf_inse

[PATCH v5 0/7] Add AutoFDO and Propeller support for Clang build

2024-10-23 Thread Rong Xu
Hi, This patch series is to integrate AutoFDO and Propeller support into the Linux kernel. AutoFDO is a profile-guided optimization technique that leverages hardware sampling to enhance binary performance. Unlike Instrumentation-based FDO (iFDO), AutoFDO offers a user-friendly and straightforward

[PATCH v5 2/7] objtool: Fix unreachable instruction warnings for weak functions

2024-10-23 Thread Rong Xu
In the presence of both weak and strong function definitions, the linker drops the weak symbol in favor of a strong symbol, but leaves the code in place. Code in ignore_unreachable_insn() has some heuristics to suppress the warning, but it does not work when -ffunction-sections is enabled. Suppose

[PATCH v5 7/7] Add Propeller configuration for kernel build

2024-10-23 Thread Rong Xu
Add the build support for using Clang's Propeller optimizer. Like AutoFDO, Propeller uses hardware sampling to gather information about the frequency of execution of different code paths within a binary. This information is then used to guide the compiler's optimization decisions, resulting in a mo

[PATCH v5 5/7] AutoFDO: Enable -ffunction-sections for the AutoFDO build

2024-10-23 Thread Rong Xu
Enable -ffunction-sections by default for the AutoFDO build. With -ffunction-sections, the compiler places each function in its own section named .text.function_name instead of placing all functions in the .text section. In the AutoFDO build, this allows the linker to utilize profile information t

[PATCH v5 3/7] Change the symbols order when --ffunction-sections is enabled

2024-10-23 Thread Rong Xu
When the -ffunction-sections compiler option is enabled, each function is placed in a separate section named .text.function_name rather than putting all functions in a single .text section. However, using -function-sections can cause problems with the linker script. The comments included in includ

[PATCH v5 6/7] AutoFDO: Enable machine function split optimization for AutoFDO

2024-10-23 Thread Rong Xu
Enable the machine function split optimization for AutoFDO in Clang. Machine function split (MFS) is a pass in the Clang compiler that splits a function into hot and cold parts. The linker groups all cold blocks across functions together. This decreases hot code fragmentation and improves iCache a

[PATCH v5 4/7] Add markers for text_unlikely and text_hot sections

2024-10-23 Thread Rong Xu
Add markers like __hot_text_start, __hot_text_end, __unlikely_text_start, and __unlikely_text_end which will be included in System.map. These markers indicate how the compiler groups functions, providing valuable information to developers about the layout and optimization of the code. Co-developed

Re: [PATCH 0/1] remoteproc documentation changes

2024-10-23 Thread Mathieu Poirier
On Wed, 23 Oct 2024 at 07:53, Jonathan Corbet wrote: > > anish kumar writes: > > > This patch series transitions the documentation > > for remoteproc from the staging directory to the > > mainline kernel. It introduces both kernel and > > user-space APIs, enhancing the overall documentation > > q

Re: [PATCH v4 5/6] AutoFDO: Enable machine function split optimization for AutoFDO

2024-10-23 Thread Rong Xu
On Tue, Oct 22, 2024 at 11:50 PM Masahiro Yamada wrote: > > On Tue, Oct 22, 2024 at 8:28 AM Rong Xu wrote: > > > > On Sun, Oct 20, 2024 at 8:18 PM Masahiro Yamada > > wrote: > > > > > > On Tue, Oct 15, 2024 at 6:33 AM Rong Xu wrote: > > > > > > > > Enable the machine function split optimizatio

[PATCH v4 6/6] alloc_tag: support for page allocation tag compression

2024-10-23 Thread Suren Baghdasaryan
Implement support for storing page allocation tag references directly in the page flags instead of page extensions. sysctl.vm.mem_profiling boot parameter it extended to provide a way for a user to request this mode. Enabling compression eliminates memory overhead caused by page_ext and results in

Re: [PATCH v4 5/6] alloc_tag: introduce pgtag_ref_handle to abstract page tag references

2024-10-23 Thread Andrew Morton
On Wed, 23 Oct 2024 10:07:58 -0700 Suren Baghdasaryan wrote: > To simplify later changes to page tag references, introduce new > pgtag_ref_handle type. This allows easy replacement of page_ext > as a storage of page allocation tags. > > ... > > static inline void pgalloc_tag_copy(struct folio *

Re: [PATCH v4 5/6] alloc_tag: introduce pgtag_ref_handle to abstract page tag references

2024-10-23 Thread Suren Baghdasaryan
On Wed, Oct 23, 2024 at 2:00 PM Andrew Morton wrote: > > On Wed, 23 Oct 2024 10:07:58 -0700 Suren Baghdasaryan > wrote: > > > To simplify later changes to page tag references, introduce new > > pgtag_ref_handle type. This allows easy replacement of page_ext > > as a storage of page allocation ta