[PATCH net-next v2 08/10] mm: page_frag: add testing for the newly added API

2024-12-06 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck CC: Andrew Morton CC: Linux-MM Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 76

[PATCH net-next v2] mm: page_frag: fix a compile error when kernel is not compiled

2024-11-18 Thread Yunsheng Lin
rk Brown Signed-off-by: Yunsheng Lin Tested-by: Mark Brown --- V2: Repost by adding net-next ML. Note, page_frag test module is only in the net-next tree for now, so target the net-next tree. --- tools/testing/selftests/mm/Makefile | 18 ++ tools/testing/selftests/mm/pag

Re: [PATCH net-next v23 1/7] mm: page_frag: add a test module for page_frag

2024-11-15 Thread Yunsheng Lin
On 11/15/2024 10:12 PM, Mark Brown wrote: ... make -C tools/testing/selftests/livepatch/test_modules/ Ah, this one is actually using some framework support for building modules - it's putting the modules in a separate directory and using TEST_GEN_MODS_DIR. Crucially, though, it has guards

Re: [PATCH net-next v23 1/7] mm: page_frag: add a test module for page_frag

2024-11-15 Thread Yunsheng Lin
On 11/16/2024 6:34 AM, Jakub Kicinski wrote: On Fri, 15 Nov 2024 14:12:09 + Mark Brown wrote: As above, I am not sure if there is some elegant way to avoid the above error in the selftest core, one possible way to avoid the above error is to skip compiling like below as tools/testing/selftes

Re: [PATCH net-next] mm: page_frag: fix a compile error when kernel is not compiled

2024-11-15 Thread Yunsheng Lin
It seemed that somehow I missed to add the netdev ML:( On 11/16/2024 12:23 PM, Yunsheng Lin wrote: page_frag test module is an out of tree module, but built using KDIR as the main kernel tree, the mm test suite is just getting skipped if newly added page_frag test module fails to compile due to

[PATCH net-next] mm: page_frag: fix a compile error when kernel is not compiled

2024-11-15 Thread Yunsheng Lin
rk Brown Signed-off-by: Yunsheng Lin --- Mote, page_frag test module is only in the net-next tree for now, so target the net-next tree. --- tools/testing/selftests/mm/Makefile | 18 ++ tools/testing/selftests/mm/page_frag/Makefile | 2 +- 2 files changed, 19 inser

Re: [PATCH net-next v23 1/7] mm: page_frag: add a test module for page_frag

2024-11-15 Thread Yunsheng Lin
On 2024/11/15 0:02, Mark Brown wrote: > On Mon, Oct 28, 2024 at 07:53:36PM +0800, Yunsheng Lin wrote: >> The testing is done by ensuring that the fragment allocated >> from a frag_frag_cache instance is pushed into a ptr_ring >> instance in a kthread binded to a specifi

[PATCH net-next v1 08/10] mm: page_frag: add testing for the newly added API

2024-11-14 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck CC: Andrew Morton CC: Linux-MM Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 76

Re: [PATCH net-next v1 2/7] net: page_pool: create page_pool_alloc_netmem

2024-11-03 Thread Yunsheng Lin
On 11/1/2024 9:10 PM, Mina Almasry wrote: ... Isn't it a little odd that old and new are not following the same pattern? Hi Yunsheng, The intention is that page_pool_alloc_pages is mirrored by page_pool_alloc_netmems. And page_pool_alloc is mirrored by page_pool_alloc_netmem. From your d

Re: [PATCH net-next v1 2/7] net: page_pool: create page_pool_alloc_netmem

2024-11-01 Thread Yunsheng Lin
On 2024/10/30 4:45, Mina Almasry wrote: > Create page_pool_alloc_netmem to be the mirror of page_pool_alloc. > > This enables drivers that want currently use page_pool_alloc to > transition to netmem by converting the call sites to > page_pool_alloc_netmem. For old API, page_pool_alloc_pages() al

[PATCH RFC 08/10] mm: page_frag: add testing for the newly added API

2024-10-28 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck CC: Andrew Morton CC: Linux-MM Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 76

[PATCH net-next v23 4/7] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-28 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck CC: Andrew Morton CC: Linux-MM Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +

[PATCH net-next v23 2/7] mm: move the page fragment allocator from page_alloc into its own file

2024-10-28 Thread Yunsheng Lin
w Morton CC: Linux-MM Signed-off-by: Yunsheng Lin Acked-by: Andrew Morton Reviewed-by: Alexander Duyck --- include/linux/gfp.h | 22 --- include/linux/mm_types.h | 18 --- include/linux/mm_types_task.h | 18 +++ i

[PATCH net-next v23 1/7] mm: page_frag: add a test module for page_frag

2024-10-28 Thread Yunsheng Lin
: Alexander Duyck CC: Linux-MM Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 198 ++ tools/testing/selftests/mm

[PATCH net-next v22 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-10-18 Thread Yunsheng Lin
1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowe...@redhat.com/ 2. https://lore.kernel.org/all/15623dac-9358-4597-b3ee-3694a5956...@gmail.com/ 3. https://lore.kernel.org/all/CAKgT0UdH1yD=LSCXFJ=ym_aia4oomd-2wxyko42bizawmt_...@mail.gmail.com/ CC: David Howells CC: Alexander Duyck Signed-

[PATCH net-next v22 11/14] mm: page_frag: add testing for the newly added prepare API

2024-10-18 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 76 +-- tools/testing/selftests/mm

[PATCH net-next v22 01/14] mm: page_frag: add a test module for page_frag

2024-10-18 Thread Yunsheng Lin
-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 198 ++ tools/testing/selftests/mm/run_vmtests.sh | 8

[PATCH net-next v22 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-18 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_fr

[PATCH net-next v21 11/14] mm: page_frag: add testing for the newly added prepare API

2024-10-12 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 76 +-- tools/testing/selftests/mm

[PATCH net-next v21 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-10-12 Thread Yunsheng Lin
1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowe...@redhat.com/ 2. https://lore.kernel.org/all/15623dac-9358-4597-b3ee-3694a5956...@gmail.com/ 3. https://lore.kernel.org/all/CAKgT0UdH1yD=LSCXFJ=ym_aia4oomd-2wxyko42bizawmt_...@mail.gmail.com/ CC: David Howells CC: Alexander Duyck Signed-

[PATCH net-next v21 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-12 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_fr

[PATCH net-next v21 01/14] mm: page_frag: add a test module for page_frag

2024-10-12 Thread Yunsheng Lin
-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 198 ++ tools/testing/selftests/mm/run_vmtests.sh | 8

Re: [PATCH net-next v20 01/14] mm: page_frag: add a test module for page_frag

2024-10-08 Thread Yunsheng Lin
On 2024/10/9 3:56, Shuah Khan wrote: > On 10/8/24 05:20, Yunsheng Lin wrote: >> The testing is done by ensuring that the fragment allocated >> from a frag_frag_cache instance is pushed into a ptr_ring >> instance in a kthread binded to a specified cpu, and a kthread >>

[PATCH net-next v20 11/14] mm: page_frag: add testing for the newly added prepare API

2024-10-08 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 66 +-- tools/testing/selftests/mm

[PATCH net-next v20 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-08 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_fr

[PATCH net-next v20 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-10-08 Thread Yunsheng Lin
1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowe...@redhat.com/ 2. https://lore.kernel.org/all/15623dac-9358-4597-b3ee-3694a5956...@gmail.com/ 3. https://lore.kernel.org/all/CAKgT0UdH1yD=LSCXFJ=ym_aia4oomd-2wxyko42bizawmt_...@mail.gmail.com/ CC: David Howells CC: Alexander Duyck Signed-

[PATCH net-next v20 01/14] mm: page_frag: add a test module for page_frag

2024-10-08 Thread Yunsheng Lin
-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 173 ++ tools/testing/selftests/mm/run_vmtests.sh | 8

[PATCH net-next v19 01/14] mm: page_frag: add a test module for page_frag

2024-10-01 Thread Yunsheng Lin
-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 173 ++ tools/testing/selftests/mm/run_vmtests.sh | 8

[PATCH net-next v19 11/14] mm: page_frag: add testing for the newly added prepare API

2024-10-01 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 66 +-- tools/testing/selftests/mm

[PATCH net-next v19 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-10-01 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_fr

[PATCH net-next v19 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-10-01 Thread Yunsheng Lin
1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowe...@redhat.com/ 2. https://lore.kernel.org/all/15623dac-9358-4597-b3ee-3694a5956...@gmail.com/ 3. https://lore.kernel.org/all/CAKgT0UdH1yD=LSCXFJ=ym_aia4oomd-2wxyko42bizawmt_...@mail.gmail.com/ CC: David Howells CC: Alexander Duyck Signed-

Re: [PATCH net-next] page_pool: add a test module for page_pool

2024-09-11 Thread Yunsheng Lin
On 2024/9/10 19:27, Jesper Dangaard Brouer wrote: ... >> >> The main issue I remembered was that it only support x86:( >> > > Yes, because I've added ASM code for reading TSC counter in a very > precise manor. Given we run many iterations, then I don't think we > need this precise reading.  I gue

Re: [PATCH net-next] page_pool: add a test module for page_pool

2024-09-10 Thread Yunsheng Lin
On 2024/9/10 1:28, Mina Almasry wrote: > On Mon, Sep 9, 2024 at 2:25 AM Yunsheng Lin wrote: >> >> The testing is done by ensuring that the page allocated from >> the page_pool instance is pushed into a ptr_ring instance in >> a kthread/napi binded to a specified cpu, a

[PATCH net-next] page_pool: add a test module for page_pool

2024-09-09 Thread Yunsheng Lin
: Yunsheng Lin --- tools/testing/selftests/net/Makefile | 3 + .../testing/selftests/net/page_pool/Makefile | 18 + .../selftests/net/page_pool/page_pool_test.c | 433 ++ tools/testing/selftests/net/test_page_pool.sh | 175 +++ 4 files changed, 629 insertions

[PATCH net-next v18 11/14] mm: page_frag: add testing for the newly added prepare API

2024-09-06 Thread Yunsheng Lin
Add testing for the newly added prepare API, for both aligned and non-aligned API, also probe API is also tested along with prepare API. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- .../selftests/mm/page_frag/page_frag_test.c | 66 +-- tools/testing/selftests/mm

[PATCH net-next v18 04/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-09-06 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_fr

[PATCH net-next v18 02/14] mm: move the page fragment allocator from page_alloc into its own file

2024-09-06 Thread Yunsheng Lin
1. https://lore.kernel.org/all/20230411160902.4134381-3-dhowe...@redhat.com/ 2. https://lore.kernel.org/all/15623dac-9358-4597-b3ee-3694a5956...@gmail.com/ 3. https://lore.kernel.org/all/CAKgT0UdH1yD=LSCXFJ=ym_aia4oomd-2wxyko42bizawmt_...@mail.gmail.com/ CC: David Howells CC: Alexander Duyck Signed-

[PATCH net-next v18 01/14] mm: page_frag: add a test module for page_frag

2024-09-06 Thread Yunsheng Lin
-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- tools/testing/selftests/mm/Makefile | 3 + tools/testing/selftests/mm/page_frag/Makefile | 18 ++ .../selftests/mm/page_frag/page_frag_test.c | 170 + tools/testing/selftests/mm/run_vmtests.sh | 8 + tools

Re: [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-08-06 Thread Yunsheng Lin
On 2024/8/6 8:52, Alexander Duyck wrote: > On Sun, Aug 4, 2024 at 10:00 AM Yunsheng Lin > wrote: >> >> On 8/3/2024 1:00 AM, Alexander Duyck wrote: >> >>>> >>>>> >>>>> As far as your API extension and naming maybe you should look

Re: [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-08-03 Thread Yunsheng Lin
On 8/3/2024 1:00 AM, Alexander Duyck wrote: As far as your API extension and naming maybe you should look like something like bio_vec and borrow the naming from that since that is essentially what you are passing back and forth is essentially that instead of a page frag which is normally a vi

Re: [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-08-02 Thread Yunsheng Lin
On 2024/8/1 23:21, Alexander Duyck wrote: > On Thu, Aug 1, 2024 at 6:01 AM Yunsheng Lin wrote: >> >> On 2024/8/1 2:13, Alexander Duyck wrote: >>> On Wed, Jul 31, 2024 at 5:50 AM Yunsheng Lin wrote: >>>> >>>> Currently the page_frag API is return

Re: [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-08-01 Thread Yunsheng Lin
On 2024/8/1 2:13, Alexander Duyck wrote: > On Wed, Jul 31, 2024 at 5:50 AM Yunsheng Lin wrote: >> >> Currently the page_frag API is returning 'virtual address' >> or 'va' when allocing and expecting 'virtual address' or >> 'va' as

[PATCH net-next v12 05/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-07-31 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c

[PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-07-31 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Subbaraya Sundeep --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_t

Re: [RFC v11 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-07-25 Thread Yunsheng Lin
On 2024/7/22 4:41, Alexander Duyck wrote: > On Fri, Jul 19, 2024 at 2:37 AM Yunsheng Lin wrote: >> >> Currently the page_frag API is returning 'virtual address' >> or 'va' when allocing and expecting 'virtual address' or >> 'va&#x

[RFC v11 05/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-07-19 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[RFC v11 04/14] mm: page_frag: add '_va' suffix to page_frag API

2024-07-19 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Subbaraya Sundeep --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_t

[PATCH net-next v10 05/15] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-07-09 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v10 04/15] mm: page_frag: add '_va' suffix to page_frag API

2024-07-09 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[PATCH net-next v9 05/13] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-06-25 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v9 04/13] mm: page_frag: add '_va' suffix to page_frag API

2024-06-25 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[PATCH net-next v8 05/13] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-06-17 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v8 04/13] mm: page_frag: add '_va' suffix to page_frag API

2024-06-17 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[PATCH net-next v7 07/15] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-06-07 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v7 06/15] mm: page_frag: add '_va' suffix to page_frag API

2024-06-07 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[PATCH net-next v6 06/15] mm: page_frag: add '_va' suffix to page_frag API

2024-06-05 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[PATCH net-next v6 07/15] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-06-05 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v5 07/13] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-05-28 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v5 06/13] mm: page_frag: add '_va' suffix to page_frag API

2024-05-28 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[RFC v4 06/13] mm: page_frag: add '_va' suffix to page_frag API

2024-05-15 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

[RFC v4 07/13] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-05-15 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v3 07/13] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-05-08 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h | 10 ++ mm/page_frag_test.c | 2 +- net/cor

[PATCH net-next v3 06/13] mm: page_frag: add '_va' suffix to page_frag API

2024-05-08 Thread Yunsheng Lin
h va, page or both va and page may call page_frag_alloc_va*, page_frag_alloc_pg*, or page_frag_alloc* API accordingly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drive

Re: [PATCH net-next v2 07/15] mm: page_frag: add '_va' suffix to page_frag API

2024-04-17 Thread Yunsheng Lin
On 2024/4/17 0:12, Alexander H Duyck wrote: > On Mon, 2024-04-15 at 21:19 +0800, Yunsheng Lin wrote: >> Currently most of the API for page_frag API is returning >> 'virtual address' as output or expecting 'virtual address' >> as input, in order to different

[PATCH net-next v2 07/15] mm: page_frag: add '_va' suffix to page_frag API

2024-04-15 Thread Yunsheng Lin
ding API mirroring the page_pool_alloc_va() API of the page_pool. Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx.h | 2 +- drivers/net/ethernet/intel/

[PATCH net-next v1 04/12] mm: page_frag: add '_va' suffix to page_frag API

2024-04-07 Thread Yunsheng Lin
ding API mirroring the page_pool_alloc_va() API of the page_pool. Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx.h | 2 +- drivers/net/ethernet/intel/

[PATCH RFC 04/10] mm: page_frag: add '_va' suffix to page_frag API

2024-03-28 Thread Yunsheng Lin
ding API mirroring the page_pool_alloc_va() API of the page_pool. Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_rx.c | 4 ++-- drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +- drivers/net/ethernet/intel/ice/ice_txrx.h | 2 +- drivers/net/ethernet/intel/

[PATCH net-next v6 4/5] vhost/net: remove vhost_net_page_frag_refill()

2024-02-28 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng Lin

[PATCH net-next v6 5/5] tools: virtio: introduce vhost_net_test

2024-02-28 Thread Yunsheng Lin
. Steps for vhost_net rx testing: 1. Prepare a in buf. 2. Do the sending in the tun side. 3. Kick the vhost_net to do rx processing. 4. verify the data received by vhost_net is correct. Signed-off-by: Yunsheng Lin --- tools/virtio/.gitignore| 1 + tools/virtio/Makefile

[PATCH net-next v6 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-02-28 Thread Yunsheng Lin
g for page frag implementation in sock.c for now as suggested by Paolo Abeni. Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck CC: Alexander Duyck --- drivers/vhost/net.c | 2 +- mm/page_alloc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c

Re: [PATCH net-next v5 5/5] tools: virtio: introduce vhost_net_test

2024-02-05 Thread Yunsheng Lin
On 2024/2/6 11:08, Jason Wang wrote: ... >> + >> +static void wait_for_interrupt(struct vq_info *vq) >> +{ >> + unsigned long long val; >> + >> + poll(&vq->fds, 1, -1); > > It's not good to wait indefinitely. How about a timeout value of 100ms as below? poll(&vq->fds, 1, 100); > >

[PATCH net-next v5 5/5] tools: virtio: introduce vhost_net_test

2024-02-05 Thread Yunsheng Lin
. Steps for vhost_net rx testing: 1. Prepare a in buf. 2. Do the sending in the tun side. 3. Kick the vhost_net to do rx processing. 4. verify the data received by vhost_net is correct. Signed-off-by: Yunsheng Lin --- tools/virtio/.gitignore| 1 + tools/virtio/Makefile

[PATCH net-next v5 4/5] vhost/net: remove vhost_net_page_frag_refill()

2024-02-05 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng Lin

[PATCH net-next v5 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-02-05 Thread Yunsheng Lin
g for page frag implementation in sock.c for now as suggested by Paolo Abeni. Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck CC: Alexander Duyck --- drivers/vhost/net.c | 2 +- mm/page_alloc.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c

Re: [PATCH net-next v4 5/5] tools: virtio: introduce vhost_net_test

2024-02-03 Thread Yunsheng Lin
On 2024/2/4 9:30, Jason Wang wrote: > On Fri, Feb 2, 2024 at 8:24 PM Yunsheng Lin wrote: >> >> On 2024/2/2 12:05, Jason Wang wrote: >>> On Tue, Jan 30, 2024 at 7:38 PM Yunsheng Lin wrote: >>>> >>>> introduce vhost_net_test basing on virtio_te

Re: [PATCH net-next v4 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-02-02 Thread Yunsheng Lin
On 2024/2/2 16:36, Paolo Abeni wrote: > On Fri, 2024-02-02 at 10:10 +0800, Yunsheng Lin wrote: >> On 2024/2/1 21:16, Paolo Abeni wrote: >> >>> from the __page_frag_cache_refill() allocator - which never accesses >>> the memory reserves. >> >> I am n

Re: [PATCH net-next v4 5/5] tools: virtio: introduce vhost_net_test

2024-02-02 Thread Yunsheng Lin
On 2024/2/2 12:05, Jason Wang wrote: > On Tue, Jan 30, 2024 at 7:38 PM Yunsheng Lin wrote: >> >> introduce vhost_net_test basing on virtio_test to test >> vhost_net changing in the kernel. > > Let's describe what kind of test is being done and how it is done here.

Re: [PATCH net-next v4 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-02-01 Thread Yunsheng Lin
On 2024/2/1 21:16, Paolo Abeni wrote: > On Tue, 2024-01-30 at 19:37 +0800, Yunsheng Lin wrote: >> Currently there seems to be three page frag implementions >> which all try to allocate order 3 page, if that fails, it >> then fail back to allocate order 0 page, and each of them

[PATCH net-next v4 5/5] tools: virtio: introduce vhost_net_test

2024-01-30 Thread Yunsheng Lin
introduce vhost_net_test basing on virtio_test to test vhost_net changing in the kernel. Signed-off-by: Yunsheng Lin --- tools/virtio/.gitignore | 1 + tools/virtio/Makefile | 8 +- tools/virtio/vhost_net_test.c | 576 ++ 3 files changed, 582

[PATCH net-next v4 4/5] vhost/net: remove vhost_net_page_frag_refill()

2024-01-30 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng Lin

[PATCH net-next v4 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-01-30 Thread Yunsheng Lin
(), but it is not masked off in __page_frag_cache_refill(). This patch unifies the gfp bits used between different implementions by or'ing __GFP_NOMEMALLOC and masking off __GFP_DIRECT_RECLAIM for order 3 page allocation to avoid possible pressure for mm. Signed-off-by: Yunsheng Lin Reviewe

[PATCH net-next v3 5/5] tools: virtio: introduce vhost_net_test

2024-01-23 Thread Yunsheng Lin
introduce vhost_net_test basing on virtio_test to test vhost_net changing in the kernel. Signed-off-by: Yunsheng Lin --- tools/virtio/.gitignore | 1 + tools/virtio/Makefile | 8 +- tools/virtio/vhost_net_test.c | 576 ++ 3 files changed, 582

[PATCH net-next v3 4/5] vhost/net: remove vhost_net_page_frag_refill()

2024-01-23 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng Lin

[PATCH net-next v3 2/5] page_frag: unify gfp bits for order 3 page allocation

2024-01-23 Thread Yunsheng Lin
(), but it is not masked off in __page_frag_cache_refill(). This patch unifies the gfp bits used between different implementions by or'ing __GFP_NOMEMALLOC and masking off __GFP_DIRECT_RECLAIM for order 3 page allocation to avoid possible pressure for mm. Signed-off-by: Yunsheng Lin Reviewe

Re: [PATCH net-next 4/6] vhost/net: remove vhost_net_page_frag_refill()

2024-01-08 Thread Yunsheng Lin
On 2024/1/6 0:06, Alexander H Duyck wrote: >> >> static void handle_tx_copy(struct vhost_net *net, struct socket *sock) >> @@ -1353,8 +1318,7 @@ static int vhost_net_open(struct inode *inode, struct >> file *f) >> vqs[VHOST_NET_VQ_RX]); >> >> f->private_data = n; >>

Re: [PATCH net-next 2/6] page_frag: unify gfp bits for order 3 page allocation

2024-01-08 Thread Yunsheng Lin
On 2024/1/5 23:35, Alexander H Duyck wrote: > On Wed, 2024-01-03 at 17:56 +0800, Yunsheng Lin wrote: >> Currently there seems to be three page frag implementions >> which all try to allocate order 3 page, if that fails, it >> then fail back to allocate order 0 page, and each

Re: [PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2024-01-04 Thread Yunsheng Lin
On 2024/1/5 0:17, Eugenio Perez Martin wrote: > On Wed, Jan 3, 2024 at 11:00 AM Yunsheng Lin wrote: ... >> + >> +static void run_tx_test(struct vdev_info *dev, struct vq_info *vq, >> + bool delayed, int batch, int bufs) >> +{ >> +

[PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2024-01-03 Thread Yunsheng Lin
introduce vhost_net_test basing on virtio_test to test vhost_net changing in the kernel. Signed-off-by: Yunsheng Lin --- tools/virtio/Makefile | 8 +- tools/virtio/vhost_net_test.c | 574 ++ 2 files changed, 579 insertions(+), 3 deletions(-) create

[PATCH net-next 5/6] net: introduce page_frag_cache_drain()

2024-01-03 Thread Yunsheng Lin
When draining a page_frag_cache, most user are doing the similar steps, so introduce an API to avoid code duplication. Signed-off-by: Yunsheng Lin Acked-by: Jason Wang --- drivers/net/ethernet/google/gve/gve_main.c | 11 ++- drivers/net/ethernet/mediatek/mtk_wed_wo.c | 17

[PATCH net-next 4/6] vhost/net: remove vhost_net_page_frag_refill()

2024-01-03 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng Lin

[PATCH net-next 2/6] page_frag: unify gfp bits for order 3 page allocation

2024-01-03 Thread Yunsheng Lin
(), but it is not masked off in __page_frag_cache_refill(). This patch unifies the gfp bits used between different implementions by or'ing __GFP_NOMEMALLOC and masking off __GFP_DIRECT_RECLAIM for order 3 page allocation to avoid possible pressure for mm. Signed-off-by: Yunsheng Lin CC:

Re: [PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2023-12-20 Thread Yunsheng Lin
On 2023/12/21 10:33, Jason Wang wrote: > On Wed, Dec 20, 2023 at 8:45 PM Yunsheng Lin wrote: >> >> On 2023/12/12 12:35, Jason Wang wrote:>>>> +done: >>>>>> + backend.fd = tun_alloc(); >>>>>> + assert

Re: [PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2023-12-20 Thread Yunsheng Lin
On 2023/12/12 12:35, Jason Wang wrote: +done: + backend.fd = tun_alloc(); + assert(backend.fd >= 0); + vdev_info_init(&dev, features); + vq_info_add(&dev, 256); + run_test(&dev, &dev.vqs[0], delayed, batch, reset, nbufs); >>> >>> I'd expect

Re: [PATCH net-next v2 3/3] net: add netmem_t to skb_frag_t

2023-12-18 Thread Yunsheng Lin
On 2023/12/17 16:09, Mina Almasry wrote: > Use netmem_t instead of page directly in skb_frag_t. Currently netmem_t > is always a struct page underneath, but the abstraction allows efforts > to add support for skb frags not backed by pages. > > There is unfortunately 1 instance where the skb_frag_t

Re: [PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2023-12-07 Thread Yunsheng Lin
On 2023/12/7 14:00, Jason Wang wrote: > On Tue, Dec 5, 2023 at 7:35 PM Yunsheng Lin wrote: ... >> + >> +static int tun_alloc(void) >> +{ >> + struct ifreq ifr; >> + int fd, e; >> + >> + fd = open("/dev/net/tun", O_RD

Re: [PATCH net-next 2/6] page_frag: unify gfp bit for order 3 page allocation

2023-12-07 Thread Yunsheng Lin
On 2023/12/7 11:15, Jakub Kicinski wrote: > On Tue, 5 Dec 2023 19:34:40 +0800 Yunsheng Lin wrote: >> __GFP_DIRECT_RECLAIM is xor'd to avoid >> direct reclaim in skb_page_frag_refill(), but it is not >> xor'd in __page_frag_cache_refill(). > > xor is not the

[PATCH net-next 6/6] tools: virtio: introduce vhost_net_test

2023-12-05 Thread Yunsheng Lin
introduce vhost_net_test basing on virtio_test to test vhost_net changing in the kernel. Signed-off-by: Yunsheng Lin --- tools/virtio/Makefile | 8 +- tools/virtio/vhost_net_test.c | 441 ++ 2 files changed, 446 insertions(+), 3 deletions(-) create

[PATCH net-next 5/6] net: introduce page_frag_cache_drain()

2023-12-05 Thread Yunsheng Lin
When draining a page_frag_cache, most user are doing the similar steps, so introduce an API to avoid code duplication. Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/google/gve/gve_main.c | 11 ++- drivers/net/ethernet/mediatek/mtk_wed_wo.c | 17 ++--- drivers/nvme

[PATCH net-next 4/6] vhost/net: remove vhost_net_page_frag_refill()

2023-12-05 Thread Yunsheng Lin
uct page_frag', and allocating frag using page_frag_alloc_align(). The added benefit is that not only unifying the page frag implementation a little, but also having about 0.5% performance boost testing by using the vhost_net_test introduced in the last patch. Signed-off-by: Yunsheng

[PATCH net-next 2/6] page_frag: unify gfp bit for order 3 page allocation

2023-12-05 Thread Yunsheng Lin
, but it is not xor'd in __page_frag_cache_refill(). This patch unifies the gfp bits used between different implementions by or'ing __GFP_NOMEMALLOC and xor'ing __GFP_DIRECT_RECLAIM for order 3 page allocation to avoid possible pressure for mm. Signed-off-by: Yunsheng Lin CC: Alexa

  1   2   3   4   >