[PATCH v3] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages()

2024-06-06 Thread Donet Tom
Commit 1b151e2435fc ("block: Remove special-casing of compound pages") caused a change in behaviour when releasing the pages if the buffer does not start at the beginning of the page. This was because the calculation of the number of pages to release was incorrect. This was fixed by commit

[PATCH net-next v11 13/13] selftests: add ncdevmem, netcat for devmem TCP

2024-06-06 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support,

[PATCH net-next v11 12/13] net: add devmem TCP documentation

2024-06-06 Thread Mina Almasry
Add documentation outlining the usage and details of devmem TCP. Signed-off-by: Mina Almasry Reviewed-by: Bagas Sanjaya --- v9: https://lore.kernel.org/netdev/20240403002053.2376017-14-almasrym...@google.com/ - Bagas doc suggestions. v8: - Applied docs suggestions (Randy). Thanks! v7: -

[PATCH net-next v11 10/13] tcp: RX path for devmem TCP

2024-06-06 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a

[PATCH net-next v11 11/13] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2024-06-06 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for reuse. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry ---

[PATCH net-next v11 09/13] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[PATCH net-next v11 07/13] memory-provider: dmabuf devmem memory provider

2024-06-06 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem in the form of net_iov. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the net_iov. The provider obtains a reference on the

[PATCH net-next v11 08/13] net: support non paged skb frags

2024-06-06 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Signed-off-by: Mina Almasry --- v10: - Fixed newly generated kdoc warnings found by patchwork. While we're at it, fix the Return section of the functions I

[PATCH net-next v11 05/13] page_pool: convert to use netmem

2024-06-06 Thread Mina Almasry
Abstrace the memory type from the page_pool so we can later add support for new memory types. Convert the page_pool to use the new netmem type abstraction, rather than use struct page directly. As of this patch the netmem type is a no-op abstraction: it's always a struct page underneath. All the

[PATCH net-next v11 06/13] page_pool: devmem support

2024-06-06 Thread Mina Almasry
Convert netmem to be a union of struct page and struct netmem. Overload the LSB of struct netmem* to indicate that it's a net_iov, otherwise it's a page. Currently these entries in struct page are rented by the page_pool and used exclusively by the net stack: struct { unsigned long

[PATCH net-next v11 04/13] netdev: netdevice devmem allocator

2024-06-06 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates net_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a net_iov struct. Signed-off-by:

[PATCH net-next v11 03/13] netdev: support binding dma-buf to netdevice

2024-06-06 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a

[PATCH net-next v11 02/13] net: netdev netlink api to bind dma-buf to a net device

2024-06-06 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- v7: - Use flags: [ admin-perm ] instead of a CAP_NET_ADMIN check. Changes in v1: - Add rx-queue-type

[PATCH net-next v11 01/13] netdev: add netdev_rx_queue_restart()

2024-06-06 Thread Mina Almasry
Add netdev_rx_queue_restart() function to netdev_rx_queue.h Signed-off-by: David Wei Signed-off-by: Mina Almasry --- v11: - Fix not checking dev->queue_mgmt_ops (Pavel). - Fix ndo_queue_mem_free call that passed the wrong pointer (David). v9:

[PATCH net-next v11 00/13] Device Memory TCP

2024-06-06 Thread Mina Almasry
v11: https://patchwork.kernel.org/project/netdevbpf/list/?series=857457=* Major Changes: -- v11 addresses feedback received in v10. The major change is the removal of the memory provider ops as requested by Christoph. We still accomplish the same thing, but utilizing direct

Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-06 Thread Reinette Chatre
Hi Babu, On 6/6/24 4:09 PM, Moger, Babu wrote: Hi Reinette, On 6/6/2024 3:33 PM, Reinette Chatre wrote: Hi Babu, On 6/5/24 2:36 PM, Babu Moger wrote: The selftest noncont_cat_run_test fails on AMD with the warnings. Reason is, AMD supports non contiguous CBM masks but does not report it

Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-06 Thread Moger, Babu
Hi Reinette, On 6/6/2024 3:33 PM, Reinette Chatre wrote: Hi Babu, On 6/5/24 2:36 PM, Babu Moger wrote: The selftest noncont_cat_run_test fails on AMD with the warnings. Reason is, AMD supports non contiguous CBM masks but does not report it via CPUID. Update noncont_cat_run_test to check

Re: [PATCH 0/2] Modify the watchdog selftest for execution with

2024-06-06 Thread Shuah Khan
On 6/6/24 03:57, Laura Nao wrote: Hi Shuah, On 5/6/24 13:13, Laura Nao wrote: The watchdog selftest script supports various parameters for testing different IOCTLs. The watchdog ping functionality is validated by starting a loop where the watchdog device is periodically pet, which can only be

Re: [PATCH] selftests: seccomp: fix format-zero-length warnings

2024-06-06 Thread Shuah Khan
On 6/3/24 05:54, Amer Al Shanawany wrote: seccomp_benchmark.c:197:24: warning: zero-length gnu_printf format string [-Wformat-zero-length] 197 | ksft_print_msg(""); |^~ seccomp_benchmark.c:202:24: warning: zero-length gnu_printf format string

Re: [PATCH bpf-next v3 01/11] bpf, lsm: Annotate lsm hook return value range

2024-06-06 Thread Paul Moore
On Thu, Apr 11, 2024 at 8:24 AM Xu Kuohai wrote: > > From: Xu Kuohai > > Add macro LSM_RET_INT to annotate lsm hook return integer type and the > default return value, and the expected return range. > > The LSM_RET_INT is declared as: > > LSM_RET_INT(defval, min, max) > > where > > - defval is

[PATCH] selftests: net: Add on/off checks for network interface non fixed features

2024-06-06 Thread Abhinav Jain
This patch addresses the present TODO in the file. I have tested it manually on my system and added relevant filtering to ensure that the correct feature list is being checked. Signed-off-by: Abhinav Jain --- tools/testing/selftests/net/netdevice.sh | 21 +++-- 1 file changed,

Re: [PATCH bpf-next 0/5] use network helpers, part 6

2024-06-06 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Daniel Borkmann : On Thu, 30 May 2024 15:41:07 +0800 you wrote: > From: Geliang Tang > > For moving dctcp test dedicated code out of do_test() into test_dctcp(). > This patchset adds a new helper start_test() in bpf_tcp_ca.c to

Re: [PATCH v3] selftests/mm: use asm volatile to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 22:36, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was

Re: [PATCH v3] selftests/mm: use asm volatile to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 13:36, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > variable dummy to perform mmap read. > > However, this test was skipped even on XFS which has large folio > support. The issue was compiler (gcc

[PATCH v3] selftests/mm: use asm volatile to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizing out the dummy variable, therefore, not creating

Re: [PATCH] selftests/resctrl: Fix noncont_cat_run_test for AMD

2024-06-06 Thread Reinette Chatre
Hi Babu, On 6/5/24 2:36 PM, Babu Moger wrote: The selftest noncont_cat_run_test fails on AMD with the warnings. Reason is, AMD supports non contiguous CBM masks but does not report it via CPUID. Update noncont_cat_run_test to check for the vendor when verifying CPUID. Fixes: ae638551ab64

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 10:21:51PM +0200, David Hildenbrand wrote: > On 06.06.24 22:18, Pankaj Raghav (Samsung) wrote: > > On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: > > > On 06.06.24 17:56, David Hildenbrand wrote: > > > > On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote:

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 22:18, Pankaj Raghav (Samsung) wrote: On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: On 06.06.24 17:56, David Hildenbrand wrote: On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 05:57:21PM +0200, David Hildenbrand wrote: > On 06.06.24 17:56, David Hildenbrand wrote: > > On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: > > > From: Pankaj Raghav > > > > > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > > > variable dummy to

Re: [PATCH] selftests/livepatch: define max test-syscall processes

2024-06-06 Thread Marcos Paulo de Souza
On Thu, 2024-06-06 at 09:53 -0400, Ryan Sullivan wrote: > Define a maximum allowable number of pids that can be livepatched in > test-syscall.sh as with extremely large machines the output from a > large number of processes overflows the dev/kmsg "expect" buffer in > the "check_result" function

Re: [PATCH] selftests/livepatch: define max test-syscall processes

2024-06-06 Thread Joel Savitz
On Thu, Jun 6, 2024 at 9:54 AM Ryan Sullivan wrote: > > Define a maximum allowable number of pids that can be livepatched in > test-syscall.sh as with extremely large machines the output from a > large number of processes overflows the dev/kmsg "expect" buffer in > the "check_result" function and

[PATCH 07/10] selftests/pidfd: Fix wrong expectation

2024-06-06 Thread Okan Tümüklü
From: Mickaël Salaün Replace a wrong EXPECT_GT(self->child_pid_exited, 0) with EXPECT_GE(), which will be actually tested on the parent and child sides with a following commit. Cc: Shuah Khan Reviewed-by: Kees Cook Reviewed-by: Christian Brauner Link:

Re: [PATCH v2 8/8] Docs/admin-guide/mm/workingset_report: document sysfs and memcg interfaces

2024-06-06 Thread Randy Dunlap
Hi, Just a couple of nits below: On 6/3/24 7:05 PM, Yuanchu Xie wrote: > Add workingset reporting documentation for better discoverability of > its sysfs and memcg interfaces. Also document the required kernel > config to enable workingset reporting. > > Signed-off-by: Yuanchu Xie > --- >

Re: [PATCH net-next v10 10/14] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
On Thu, Jun 6, 2024 at 9:49 AM Mina Almasry wrote: > > On Tue, Jun 4, 2024 at 3:46 AM Paolo Abeni wrote: > > > > On Thu, 2024-05-30 at 20:16 +, Mina Almasry wrote: > > > diff --git a/net/core/gro.c b/net/core/gro.c > > > index 26f09c3e830b7..7b9d018f552bd 100644 > > > --- a/net/core/gro.c >

Re: [PATCH net-next v10 10/14] net: add support for skbs with unreadable frags

2024-06-06 Thread Mina Almasry
On Tue, Jun 4, 2024 at 3:46 AM Paolo Abeni wrote: > > On Thu, 2024-05-30 at 20:16 +, Mina Almasry wrote: > > diff --git a/net/core/gro.c b/net/core/gro.c > > index 26f09c3e830b7..7b9d018f552bd 100644 > > --- a/net/core/gro.c > > +++ b/net/core/gro.c > > @@ -422,6 +422,9 @@ static void

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 17:56, David Hildenbrand wrote: On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support.

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread David Hildenbrand
On 06.06.24 15:58, Pankaj Raghav (Samsung) wrote: From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was

Re: [PATCH v2] selftests/mm: use global variable to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 8:44, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > variable dummy to perform mmap read. > > However, this test was skipped even on XFS which has large folio > support. The issue was compiler (gcc

[PATCH v2] selftests/mm: use global variable to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizing out the dummy variable, therefore, not creating

Re: [PATCH net 0/3] selftests: net: lib: small fixes

2024-06-06 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by Jakub Kicinski : On Wed, 05 Jun 2024 11:21:15 +0200 you wrote: > While looking at using 'lib.sh' for the MPTCP selftests [1], we found > some small issues with 'lib.sh'. Here they are: > > - Patch 1: fix 'errexit' (set -e) support with

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
On Thu, Jun 06, 2024 at 03:35:31PM +0100, Matthew Wilcox wrote: > On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: > > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > > @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, > > size_t fd_size,

Re: [PATCH v5 05/11] of: Add a KUnit test for overlays and test managed APIs

2024-06-06 Thread Stephen Boyd
Quoting Rob Herring (2024-06-05 16:47:20) > On Mon, Jun 03, 2024 at 03:38:02PM -0700, Stephen Boyd wrote: > > diff --git a/drivers/of/Makefile b/drivers/of/Makefile > > index 2ae909adde49..abd9c578343b 100644 > > diff --git a/drivers/of/overlay_test.c b/drivers/of/overlay_test.c > > new file mode

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 7:35, Matthew Wilcox wrote: > On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: >> +++ b/tools/testing/selftests/mm/split_huge_page_test.c >> @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, >> size_t fd_size, int *fd, >>

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Matthew Wilcox
On Thu, Jun 06, 2024 at 01:58:35PM +, Pankaj Raghav (Samsung) wrote: > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > @@ -300,7 +300,7 @@ int create_pagecache_thp_and_fd(const char *testfile, > size_t fd_size, int *fd, > char **addr) > { > size_t i; > - int

Re: [PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Zi Yan
On 6 Jun 2024, at 6:58, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > create_pagecache_thp_and_fd() in split_huge_page_test.c used the > variable dummy to perform mmap read. > > However, this test was skipped even on XFS which has large folio > support. The issue was compiler (gcc

Re: [PATCH] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages()

2024-06-06 Thread Donet Tom
On 6/6/24 18:44, Pankaj Raghav wrote: +void run_dio_using_hugetlb(unsigned int start_off, unsigned int end_off) +{ + int fd; + char *buffer = NULL; + char *orig_buffer = NULL; + size_t h_pagesize = 0; + size_t writesize; + int free_hpage_b = 0; + int

[PATCH] selftests/mm: use volatile keyword to not optimize mmap read variable

2024-06-06 Thread Pankaj Raghav (Samsung)
From: Pankaj Raghav create_pagecache_thp_and_fd() in split_huge_page_test.c used the variable dummy to perform mmap read. However, this test was skipped even on XFS which has large folio support. The issue was compiler (gcc 13.2.0) was optimizing out the dummy variable, therefore, not creating

[PATCH] selftests/livepatch: define max test-syscall processes

2024-06-06 Thread Ryan Sullivan
Define a maximum allowable number of pids that can be livepatched in test-syscall.sh as with extremely large machines the output from a large number of processes overflows the dev/kmsg "expect" buffer in the "check_result" function and causes a false error. Reported-by: CKI Project

Re: [PATCH] selftest: mm: Test if hugepage does not get leaked during __bio_release_pages()

2024-06-06 Thread Pankaj Raghav
> +void run_dio_using_hugetlb(unsigned int start_off, unsigned int end_off) > +{ > + int fd; > + char *buffer = NULL; > + char *orig_buffer = NULL; > + size_t h_pagesize = 0; > + size_t writesize; > + int free_hpage_b = 0; > + int free_hpage_a = 0; > + > +

Re: [PATCH] selftests: mm: Make map_fixed_noreplace test names stable

2024-06-06 Thread Muhammad Usama Anjum
On 6/6/24 3:36 AM, Mark Brown wrote: > KTAP parsers interpret the output of ksft_test_result_*() as being the > name of the test. The map_fixed_noreplace test uses a dynamically > allocated base address for the mmap()s that it tests and currently > includes this in the test names that it logs so

Re: [PATCH 0/2] Modify the watchdog selftest for execution with

2024-06-06 Thread Laura Nao
Hi Shuah, On 5/6/24 13:13, Laura Nao wrote: > The watchdog selftest script supports various parameters for testing > different IOCTLs. The watchdog ping functionality is validated by > starting > a loop where the watchdog device is periodically pet, which can only > be > stopped by the user

Re: [PATCH net-next 1/2] selftests: openvswitch: fix action formatting

2024-06-06 Thread Adrián Moreno
On Mon, Jun 03, 2024 at 03:00:03PM GMT, Aaron Conole wrote: > Adrian Moreno writes: > > > In the action formatting function ("dpstr"), the iteration is made over > > the nla_map, so if there are more than one attribute from the same type > > we only print the first one. > > > > Fix this by