linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.duyck@gmail.com>
To: Yunsheng Lin <linyunsheng@huawei.com>
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	 netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH net-next v12 01/14] mm: page_frag: add a test module for page_frag
Date: Wed, 31 Jul 2024 11:29:33 -0700	[thread overview]
Message-ID: <CAKgT0Udj5Jskjvvba345DFkySuZeg927OHQya0rCcynMtmGg8g@mail.gmail.com> (raw)
In-Reply-To: <20240731124505.2903877-2-linyunsheng@huawei.com>

On Wed, Jul 31, 2024 at 5:50 AM Yunsheng Lin <linyunsheng@huawei.com> wrote:
>
> Basing on the lib/objpool.c, change it to something like a
> ptrpool, so that we can utilize that to test the correctness
> and performance of the page_frag.
>
> The testing is done by ensuring that the fragment allocated
> from a frag_frag_cache instance is pushed into a ptrpool
> instance in a kthread binded to a specified cpu, and a kthread
> binded to a specified cpu will pop the fragment from the
> ptrpool and free the fragment.
>
> We may refactor out the common part between objpool and ptrpool
> if this ptrpool thing turns out to be helpful for other place.

This isn't a patch where you should be introducing stuff you hope to
refactor out and reuse later. Your objpoo/ptrpool stuff is just going
to add bloat and overhead as you are going to have to do pointer
changes to get them in and out of memory and you are having to scan
per-cpu lists. You would be better served using a simple array as your
threads should be stick to a consistent CPU anyway in terms of
testing.

I would suggest keeping this much more simple. Trying to pattern this
after something like the dmapool_test code would be a better way to go
for this. We don't need all this extra objpool overhead getting in the
way of testing the code you should be focused on. Just allocate your
array on one specific CPU and start placing and removing your pages
from there instead of messing with the push/pop semantics.

Lastly something that is a module only tester that always fails to
probe doesn't sound like it really makes sense as a standard kernel
module. I still think it would make more sense to move it to the
selftests tree and just have it build there as a module instead of
trying to force it into the mm tree. The example of dmapool_test makes
sense as it could be run at early boot to run the test and then it
just goes quiet. This module won't load and will always just return
-EAGAIN which doesn't sound like a valid kernel module to me.


  reply	other threads:[~2024-07-31 18:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240731124505.2903877-1-linyunsheng@huawei.com>
2024-07-31 12:44 ` Yunsheng Lin
2024-07-31 18:29   ` Alexander Duyck [this message]
2024-08-01 12:58     ` Yunsheng Lin
2024-08-01 14:50       ` Alexander Duyck
2024-08-02 10:02         ` Yunsheng Lin
2024-08-02 16:42           ` Alexander Duyck
2024-07-31 12:44 ` [PATCH net-next v12 02/14] mm: move the page fragment allocator from page_alloc into its own file Yunsheng Lin
2024-07-31 12:44 ` [PATCH net-next v12 03/14] mm: page_frag: use initial zero offset for page_frag_alloc_align() Yunsheng Lin
2024-07-31 12:44 ` [PATCH net-next v12 04/14] mm: page_frag: add '_va' suffix to page_frag API Yunsheng Lin
2024-07-31 13:36   ` Chuck Lever
2024-07-31 18:13   ` Alexander Duyck
2024-08-01 13:01     ` Yunsheng Lin
2024-08-01 15:21       ` Alexander Duyck
2024-08-02 10:05         ` Yunsheng Lin
2024-08-02 17:00           ` Alexander Duyck
     [not found]             ` <2a29ce61-7136-4b9b-9940-504228b10cba@gmail.com>
2024-08-06  0:52               ` Alexander Duyck
2024-08-06 11:37                 ` Yunsheng Lin
2024-08-04  6:44   ` Sagi Grimberg
2024-07-31 12:44 ` [PATCH net-next v12 05/14] mm: page_frag: avoid caller accessing 'page_frag_cache' directly Yunsheng Lin
2024-07-31 13:36   ` Chuck Lever
2024-07-31 12:44 ` [PATCH net-next v12 07/14] mm: page_frag: reuse existing space for 'size' and 'pfmemalloc' Yunsheng Lin
2024-07-31 12:44 ` [PATCH net-next v12 08/14] mm: page_frag: some minor refactoring before adding new API Yunsheng Lin
2024-07-31 12:44 ` [PATCH net-next v12 09/14] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Yunsheng Lin
2024-07-31 12:45 ` [PATCH net-next v12 11/14] mm: page_frag: introduce prepare/probe/commit API Yunsheng Lin
2024-07-31 12:45 ` [PATCH net-next v12 13/14] mm: page_frag: update documentation for page_frag Yunsheng Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKgT0Udj5Jskjvvba345DFkySuZeg927OHQya0rCcynMtmGg8g@mail.gmail.com \
    --to=alexander.duyck@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linyunsheng@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox