Re: [PATCH] tools/perf/tests/expr: Make the system_tsc_freq test only for intel

2024-11-03 Thread Athira Rajeev
> On 30 Oct 2024, at 5:29 AM, Namhyung Kim wrote: > > Hello, > > On Tue, Oct 22, 2024 at 07:31:56PM +0530, Athira Rajeev wrote: >> The "Simple expression parser" test fails on powerpc >> as below: >> >> parsing metric: #system_tsc_freq >> Unrecognized literal '#system_tsc_freq'literal: #syst

Re: [PATCH] tools/perf/tests/base_probe: Fix check for the count of existing probes in test_adding_kernel

2024-11-03 Thread Athira Rajeev
> On 17 Oct 2024, at 3:44 PM, Michael Petlan wrote: > > On Mon, 14 Oct 2024, Athira Rajeev wrote: >> perftool-testsuite_probe fails in test_adding_kernel as below: >> Regexp not found: "probe:inode_permission_11" >> -- [ FAIL ] -- perf_probe :: test_adding_kernel :: force-adding probes :: >> s

Re: [resend PATCH 1/2] dim: make dim_calc_stats() inputs const pointers

2024-11-03 Thread Xuan Zhuo
On Wed, 30 Oct 2024 18:23:25 -0600, Caleb Sander Mateos wrote: > Make the start and end arguments to dim_calc_stats() const pointers > to clarify that the function does not modify their values. > > Signed-off-by: Caleb Sander Mateos Reviewed-by: Xuan Zhuo > --- > include/linux/dim.h | 3 ++-

Re: [PATCH v2 06/18] loongarch/crc32: expose CRC32 functions through lib

2024-11-03 Thread WangYuli
On 2024/11/3 21:57, Eric Biggers wrote: On Sun, Nov 03, 2024 at 09:36:55PM +0800, WangYuli wrote: Even though the narrower CRC instructions doesn't require GRLEN=64, they still *aren't* part of LA32 (LoongArch reference manual v1.10, Volume 1, Table 2-1). Link: https://lore.kernel.org/all/0a7

Re: [resend PATCH 2/2] dim: pass dim_sample to net_dim() by reference

2024-11-03 Thread Xuan Zhuo
On Wed, 30 Oct 2024 18:23:26 -0600, Caleb Sander Mateos wrote: > net_dim() is currently passed a struct dim_sample argument by value. > struct dim_sample is 24 bytes. Since this is greater 16 bytes, x86-64 > passes it on the stack. All callers have already initialized dim_sample > on the stack, s

[PATCH V2] tools/perf/tests/shell/base_probe: Enhance print_overall_results to print summary information

2024-11-03 Thread Athira Rajeev
Currently print_overall_results prints the number of fails in the summary, example from base_probe tests in testsuite_probe: ## [ FAIL ] ## perf_probe :: test_invalid_options SUMMARY :: 11 failures found test_invalid_options contains multiple tests and out of that 11 failed. Sometimes it

[PATCH v2 00/10] sysfs: constify struct bin_attribute (Part 1)

2024-11-03 Thread Thomas Weißschuh
struct bin_attribute contains a bunch of pointer members, which when overwritten by accident or malice can lead to system instability and security problems. Moving the definitions of struct bin_attribute to read-only memory makes these modifications impossible. The same change has been performed fo

[PATCH v2 08/10] sysfs: implement all BIN_ATTR_* macros in terms of __BIN_ATTR()

2024-11-03 Thread Thomas Weißschuh
The preparations for the upcoming constification of struct bin_attribute requires some logic in the structure definition macros. To avoid duplication of that logic in multiple macros, reimplement all other macros in terms of __BIN_ATTR(). Signed-off-by: Thomas Weißschuh --- include/linux/sysfs.h

[PATCH v2 05/10] sysfs: treewide: constify attribute callback of bin_is_visible()

2024-11-03 Thread Thomas Weißschuh
The is_bin_visible() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- drivers/cxl/port.c

[PATCH v2 09/10] sysfs: bin_attribute: add const read/write callback variants

2024-11-03 Thread Thomas Weißschuh
To make it possible to put struct bin_attribute into read-only memory, the sysfs core has to stop passing mutable pointers to the read() and write() callbacks. As there are numerous implementors of these callbacks throughout the tree it's not possible to change all of them at once. To enable a step

[PATCH v2 01/10] sysfs: explicitly pass size to sysfs_add_bin_file_mode_ns()

2024-11-03 Thread Thomas Weißschuh
Upcoming changes to the sysfs core require the size of the created file to be overridable by the caller. Add a parameter to enable this. For now keep using attr->size in all cases. Signed-off-by: Thomas Weißschuh --- fs/sysfs/file.c | 8 fs/sysfs/group.c | 3 ++- fs/sysfs/sysfs.h | 2 +

[PATCH v2 06/10] sysfs: treewide: constify attribute callback of bin_attribute::mmap()

2024-11-03 Thread Thomas Weißschuh
The mmap() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- arch/alpha/kernel/pci-sysfs.c

[PATCH v2 03/10] PCI/sysfs: Calculate bin_attribute size through bin_size()

2024-11-03 Thread Thomas Weißschuh
Stop abusing the is_bin_visible() callback to calculate the attribute size. Instead use the new, dedicated bin_size() one. Signed-off-by: Thomas Weißschuh --- drivers/pci/pci-sysfs.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/pci/pc

[PATCH v2 10/10] driver core: Constify attribute arguments of binary attributes

2024-11-03 Thread Thomas Weißschuh
As preparation for the constification of struct bin_attribute, constify the arguments of the read and write callbacks. Signed-off-by: Thomas Weißschuh --- drivers/base/node.c | 4 ++-- drivers/base/topology.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/ba

[PATCH v2 02/10] sysfs: introduce callback attribute_group::bin_size

2024-11-03 Thread Thomas Weißschuh
Several drivers need to dynamically calculate the size of an binary attribute. Currently this is done by assigning attr->size from the is_bin_visible() callback. This has drawbacks: * It is not documented. * A single attribute can be instantiated multiple times, overwriting the shared size field

[PATCH v2 07/10] sysfs: treewide: constify attribute callback of bin_attribute::llseek()

2024-11-03 Thread Thomas Weißschuh
The llseek() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- drivers/pci/pci-sysfs.c | 2 +- i

[PATCH v2 04/10] nvmem: core: calculate bin_attribute size through bin_size()

2024-11-03 Thread Thomas Weißschuh
Stop abusing the is_bin_visible() callback to calculate the attribute size. Instead use the new, dedicated bin_size() one. Signed-off-by: Thomas Weißschuh --- drivers/nvmem/core.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nv

[PATCH v3 07/18] mips/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the mips CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the ar

[PATCH v3 02/18] lib/crc32: improve support for arch-specific overrides

2024-11-03 Thread Eric Biggers
From: Eric Biggers Currently the CRC32 library functions are defined as weak symbols, and the arm64 and riscv architectures override them. This method of arch-specific overrides has the limitation that it only works when both the base and arch code is built-in. Also, it makes the arch-specific

[PATCH v3 05/18] arm/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the arm CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the arc

[PATCH v3 03/18] lib/crc32: expose whether the lib is really optimized at runtime

2024-11-03 Thread Eric Biggers
From: Eric Biggers Make the CRC32 library export a function crc32_optimizations() which returns flags that indicate which CRC32 functions are actually executing optimized code at runtime. This will be used to determine whether the crc32[c]-$arch shash algorithms should be registered in the crypt

[PATCH v3 00/18] Wire up CRC32 library functions to arch-optimized code

2024-11-03 Thread Eric Biggers
This patchset is also available in git via: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git crc32-lib-v3 CRC32 is a family of common non-cryptographic integrity check algorithms that are fairly fast with a portable C implementation and become far faster still wit

[PATCH v3 01/18] lib/crc32: drop leading underscores from __crc32c_le_base

2024-11-03 Thread Eric Biggers
From: Eric Biggers Remove the leading underscores from __crc32c_le_base(). This is in preparation for adding crc32c_le_arch() and eventually renaming __crc32c_le() to crc32c_le(). Reviewed-by: Ard Biesheuvel Signed-off-by: Eric Biggers --- arch/arm64/lib/crc32-glue.c | 2 +- arch/riscv/lib/c

[PATCH v3 04/18] crypto: crc32 - don't unnecessarily register arch algorithms

2024-11-03 Thread Eric Biggers
From: Eric Biggers Instead of registering the crc32-$arch and crc32c-$arch algorithms if the arch-specific code was built, only register them when that code was built *and* is not falling back to the base implementation at runtime. This avoids confusing users like btrfs which checks the shash dr

[PATCH v3 06/18] loongarch/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the loongarch CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all t

[PATCH v3 08/18] powerpc/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the powerpc CRC32C assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all th

[PATCH v3 15/18] ext4: switch to using the crc32c library

2024-11-03 Thread Eric Biggers
From: Eric Biggers Now that the crc32c() library function directly takes advantage of architecture-specific optimizations, it is unnecessary to go through the crypto API. Just use crc32c(). This is much simpler, and it improves performance due to eliminating the crypto API overhead. Reviewed-b

[PATCH v3 14/18] lib/crc32: make crc32c() go directly to lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Now that the lower level __crc32c_le() library function is optimized for each architecture, make crc32c() just call that instead of taking an inefficient and error-prone detour through the shash API. Note: a future cleanup should make crc32c_le() be the actual library function

[PATCH v3 12/18] x86/crc32: update prototype for crc32_pclmul_le_16()

2024-11-03 Thread Eric Biggers
From: Eric Biggers - Change the len parameter from unsigned int to size_t, so that the library function which takes a size_t can safely use this code. - Move the crc parameter to the front, as this is the usual convention. Reviewed-by: Ard Biesheuvel Signed-off-by: Eric Biggers --- arch/x8

[PATCH v3 09/18] s390/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the s390 CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the ar

[PATCH v3 10/18] sparc/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the sparc CRC32C assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the

[PATCH v3 13/18] x86/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
From: Eric Biggers Move the x86 CRC32 assembly code into the lib directory and wire it up to the library interface. This allows it to be used without going through the crypto API. It remains usable via the crypto API too via the shash algorithms that use the library interface. Thus all the arc

[PATCH v3 18/18] scsi: target: iscsi: switch to using the crc32c library

2024-11-03 Thread Eric Biggers
From: Eric Biggers Now that the crc32c() library function directly takes advantage of architecture-specific optimizations, it is unnecessary to go through the crypto API. Just use crc32c(). This is much simpler, and it improves performance due to eliminating the crypto API overhead. Reviewed-b

[PATCH v3 11/18] x86/crc32: update prototype for crc_pcl()

2024-11-03 Thread Eric Biggers
From: Eric Biggers - Change the len parameter from unsigned int to size_t, so that the library function which takes a size_t can safely use this code. - Rename to crc32c_x86_3way() which is much clearer. - Move the crc parameter to the front, as this is the usual convention. Reviewed-by: Ard

[PATCH v3 16/18] jbd2: switch to using the crc32c library

2024-11-03 Thread Eric Biggers
From: Eric Biggers Now that the crc32c() library function directly takes advantage of architecture-specific optimizations, it is unnecessary to go through the crypto API. Just use crc32c(). This is much simpler, and it improves performance due to eliminating the crypto API overhead. Reviewed-b

[PATCH v3 17/18] f2fs: switch to using the crc32 library

2024-11-03 Thread Eric Biggers
From: Eric Biggers Now that the crc32() library function takes advantage of architecture-specific optimizations, it is unnecessary to go through the crypto API. Just use crc32(). This is much simpler, and it improves performance due to eliminating the crypto API overhead. Reviewed-by: Ard Bies

Re: [resend PATCH 2/2] dim: pass dim_sample to net_dim() by reference

2024-11-03 Thread Caleb Sander
On Sun, Nov 3, 2024 at 12:21 PM Jakub Kicinski wrote: > > On Wed, 30 Oct 2024 18:23:26 -0600 Caleb Sander Mateos wrote: > > In a heavy TCP workload, mlx5e_handle_rx_dim() consumes 3% of CPU time, > > 94% of which is attributed to the first push instruction to copy > > dim_sample on the stack for t

Re: [PATCH v2 06/10] sysfs: treewide: constify attribute callback of bin_attribute::mmap()

2024-11-03 Thread Andrew Donnellan
On Sun, 2024-11-03 at 17:03 +, Thomas Weißschuh wrote: > The mmap() callbacks should not modify the struct > bin_attribute passed as argument. > Enforce this by marking the argument as const. > > As there are not many callback implementers perform this change > throughout the tree at once. >

Re: [PATCH v2 06/18] loongarch/crc32: expose CRC32 functions through lib

2024-11-03 Thread Eric Biggers
On Sun, Nov 03, 2024 at 09:36:55PM +0800, WangYuli wrote: > Even though the narrower CRC instructions doesn't require GRLEN=64, they > still *aren't* part of LA32 (LoongArch reference manual v1.10, Volume 1, > Table 2-1). > Link: > https://lore.kernel.org/all/0a7d0a9e-c56e-4ee2-a83b-00164a450...

Re: [PATCH v2 00/10] sysfs: constify struct bin_attribute (Part 1)

2024-11-03 Thread Krzysztof Wilczyński
Hello, > struct bin_attribute contains a bunch of pointer members, which when > overwritten by accident or malice can lead to system instability and > security problems. > Moving the definitions of struct bin_attribute to read-only memory > makes these modifications impossible. > The same change h

Re: [resend PATCH 2/2] dim: pass dim_sample to net_dim() by reference

2024-11-03 Thread Jakub Kicinski
On Wed, 30 Oct 2024 18:23:26 -0600 Caleb Sander Mateos wrote: > In a heavy TCP workload, mlx5e_handle_rx_dim() consumes 3% of CPU time, > 94% of which is attributed to the first push instruction to copy > dim_sample on the stack for the call to net_dim(): Change itself looks fine, so we can apply,

Re: [PATCH v2 06/18] loongarch/crc32: expose CRC32 functions through lib

2024-11-03 Thread WangYuli
Even though the narrower CRC instructions doesn't require GRLEN=64, they still *aren't* part of LA32 (LoongArch reference manual v1.10, Volume 1, Table 2-1). Link: https://lore.kernel.org/all/0a7d0a9e-c56e-4ee2-a83b-00164a450...@xen0n.name/ Therefore, we could not directly add ARCH_HAS_CRC32 to