Re: [PATCH 2/2] kselftests: mm: Fail the test if userfaultfd syscall isn't found

2024-09-15 Thread Muhammad Usama Anjum
On 9/12/24 10:28 PM, Shuah Khan wrote: > On 9/12/24 10:10, Shuah Khan wrote: >> On 9/12/24 04:31, Muhammad Usama Anjum wrote: >>> The userfaultfd is enabled in the config fragment of mm selftest suite. >>> It must always be present. If it isn't present, we should throw error >>> and not just skip.

Re: [PATCH 1/2] kselftests: mm: Fix wrong __NR_userfaultfd value

2024-09-15 Thread Muhammad Usama Anjum
On 9/12/24 8:44 PM, Shuah Khan wrote: > On 9/12/24 04:31, Muhammad Usama Anjum wrote: >> The value of __NR_userfaultfd was changed to 282 when >> asm-generic/unistd.h was included. It makes the test to fail every time >> as the correct number of this syscall on x86_64 is 323. Fix the header >> to a

Re: BUG: WARNING in kvfree_rcu_bulk

2024-09-15 Thread Juefei Pu
After several tests, I found that the same PoC can cause multiple different crashes for some unknown reason. Thus, I suspect that the bug is capable of performing unintended memory writing without being caught by KASAN. I tested the PoC on the latest kernel, Linux 6.11 rc7 and it can still cause cr

Re: [PATCH] selftests: mm: Fix build errors on armhf

2024-09-15 Thread Muhammad Usama Anjum
On 9/14/24 3:33 AM, Jeff Xu wrote: > On Mon, Aug 19, 2024 at 3:05 AM Muhammad Usama Anjum > wrote: >> >> On 8/14/24 3:29 AM, Jeff Xu wrote: >>> Hi Muhammad >>> >>> On Fri, Aug 9, 2024 at 1:25 AM Muhammad Usama Anjum >>> wrote: The __NR_mmap isn't found on armhf. The mmap() is commonly a

[RFC 6/6] apparmor: Switch labels to percpu ref managed mode

2024-09-15 Thread Neeraj Upadhyay
Nginx performance testing with Apparmor enabled (with Nginx running in unconfined profile), on kernel versions 6.1 and 6.5 show significant drop in throughput scalability when Nginx workers are scaled to use higher number of CPUs across various L3 cache domains. Below is one sample data on the thr

[RFC 5/6] apparmor: Switch labels to percpu refcount in atomic mode

2024-09-15 Thread Neeraj Upadhyay
In preparation of using percpu refcount for labels, replace label kref with percpu ref. The percpu ref is initialized to atomic mode, as using percpu mode requires tracking ref kill points. As the atomic counter is in a different cacheline now, rearrange some of the fields in aa_label struct - flag

[RFC 4/6] percpu-refcount-torture: Extend test with runtime mode switches

2024-09-15 Thread Neeraj Upadhyay
Extend the test to exercise runtime switching from managed mode to other reinitable active modes. Signed-off-by: Neeraj Upadhyay --- lib/percpu-refcount-torture.c | 41 +-- lib/percpu-refcount.c | 12 +- 2 files changed, 50 insertions(+), 3 deletio

[RFC 3/6] percpu-refcount: Extend managed mode to allow runtime switching

2024-09-15 Thread Neeraj Upadhyay
Provide more flexibility in terms of runtime mode switch for a managed percpu ref. This can be useful for cases when in some scenarios, a managed ref's object enters shutdown phase. Instead of waiting for manager thread to process the ref, user can dirctly invoke percpu_ref_kill() for the ref. The

[RFC 2/6] percpu-refcount: Add torture test for percpu refcount

2024-09-15 Thread Neeraj Upadhyay
Add torture test to verify percpu managed mode operations, verifying that a percpu ref does not have non-zero count when all users have dropped their reference and that there is no early release of the ref while users hold references to it. Signed-off-by: Neeraj Upadhyay --- .../admin-guide/kern

[RFC 1/6] percpu-refcount: Add managed mode for RCU released objects

2024-09-15 Thread Neeraj Upadhyay
Add a new "managed mode" to percpu refcounts, to track initial reference drop for refs which use RCU grace period for their object reclaims. Typical usage pattern for such refs is: // Called with elevated refcount get() p = get_ptr(); kref_get(&p->count); return p; get() rcu_read_

[RFC 0/6] Managed Percpu Refcount

2024-09-15 Thread Neeraj Upadhyay
Introduction This patch series adds a new "managed mode" to percpu-refcounts for managing references for objects that are released after an RCU grace period has passed since their last reference drop. Typical usage pattern looks like below // Called with elevated refcount get()

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-09-15 Thread Dev Jain
On 9/9/24 23:24, Shuah Khan wrote: On 9/8/24 23:16, Dev Jain wrote: On 9/7/24 01:29, Shuah Khan wrote: On 9/4/24 23:56, Dev Jain wrote: On 9/4/24 22:35, Shuah Khan wrote: On 9/3/24 22:52, Dev Jain wrote: On 9/4/24 03:14, Shuah Khan wrote: On 8/30/24 10:29, Dev Jain wrote: On 8/27/24

[PATCH bpf-next v2 2/2] bpf: selftests: verifier: Add nullness elision tests

2024-09-15 Thread Daniel Xu
Test that nullness elision works for common use cases. For example, we want to check that both full and subreg stack slots are recognized. As well as when there's both const and non-const values of R2 leading up to a lookup. And obviously some bound checks. Signed-off-by: Daniel Xu --- .../bpf/p

[PATCH bpf-next v2 1/2] bpf: verifier: Support eliding map lookup nullness

2024-09-15 Thread Daniel Xu
This commit allows progs to elide a null check on statically known map lookup keys. In other words, if the verifier can statically prove that the lookup will be in-bounds, allow the prog to drop the null check. This is useful for two reasons: 1. Large numbers of nullness checks (especially when t

[PATCH bpf-next v2 0/2] Support eliding map lookup nullness

2024-09-15 Thread Daniel Xu
This patch allows progs to elide a null check on statically known map lookup keys. In other words, if the verifier can statically prove that the lookup will be in-bounds, allow the prog to drop the null check. This is useful for two reasons: 1. Large numbers of nullness checks (especially when th

[ANNOUNCE] 5.10.225-rt117

2024-09-15 Thread Luis Claudio R. Goncalves
Hello RT-list! I'm pleased to announce the 5.10.225-rt117 stable release. This release is just an update to the new stable 5.10.225 version and no RT-specific changes have been made. You can get this release via the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt

Re: BUG: WARNING in kvfree_rcu_bulk

2024-09-15 Thread Xingyu Li
Juefei will answer this. I already Cc'd him. On Thu, Sep 12, 2024 at 9:08 AM Uladzislau Rezki wrote: > > > > > > > > > Here is the config file: > > > > https://gist.github.com/TomAPU/64f5db0fe976a3e94a6dd2b621887cdd > > > > > I tested your "reproducer" on 6.11.0-rc2. I see some panics and they a

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-09-15 Thread Jason Gunthorpe
On Wed, Sep 11, 2024 at 08:39:57PM -0700, Nicolin Chen wrote: > You mentioned that actually only the iommufd selftest might hit such > a corner case, so perhaps we should do something in the selftest code > v.s. the iommu core. What do you think? Maybe, if there were viommu allocation callbacks m

Re: [PATCH] selftests: Makefile: add missing 'net/lib' to targets

2024-09-15 Thread Jakub Kicinski
On Sun, 15 Sep 2024 09:36:10 +0200 Willem de Bruijn wrote: > > You’re right, the patch is incorrect, I could have explained better. > > I’m seeing an issue with an out-of-tree cross compilation build of > > kselftest and can’t figure out what’s wrong. > > > > make --keep-going --jobs=32 O=/tmp/buil

Re: [PATCH 1/1] remoteproc: Use iommu_paging_domain_alloc()

2024-09-15 Thread Jason Gunthorpe
On Thu, Aug 22, 2024 at 01:24:25PM -0300, Jason Gunthorpe wrote: > On Thu, Aug 22, 2024 at 10:17:56AM -0600, Mathieu Poirier wrote: > > > > - domain = iommu_domain_alloc(dev->bus); > > > - if (!domain) { > > > + domain = iommu_paging_domain_alloc(dev); > > > > I'm a little hesitant here. Functio

Re: [PATCH] selftests: Makefile: add missing 'net/lib' to targets

2024-09-15 Thread Willem de Bruijn
On Sun, Sep 15, 2024 at 8:45 AM Anders Roxell wrote: > > On Thu, 12 Sept 2024 at 17:23, Jakub Kicinski wrote: > > > > On Thu, 12 Sep 2024 08:31:18 +0200 Anders Roxell wrote: > > > Fixes: 1d0dc857b5d8 ("selftests: drv-net: add checksum tests") > > > Signed-off-by: Anders Roxell > > > --- > > > t