All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: Joe Damato <jdamato@fastly.com>,
	netdev@vger.kernel.org, kuba@kernel.org, davem@davemloft.net,
	hawk@kernel.org, saeed@kernel.org, ttoukan.linux@gmail.com,
	brouer@redhat.com
Subject: Re: [net-next v7 1/4] page_pool: Add allocation stats
Date: Mon, 28 Feb 2022 09:28:33 +0200	[thread overview]
Message-ID: <CAC_iWjKnHt+PFsxxSXvWskHsVqB=bSzjfADdpbuviCgdz5BmOw@mail.gmail.com> (raw)
In-Reply-To: <8bcd9a94-6fb9-15ab-5a91-0b9d71cfa688@redhat.com>

On Mon, 28 Feb 2022 at 09:07, Jesper Dangaard Brouer <jbrouer@redhat.com> wrote:
>
>
> On 25/02/2022 18.41, Joe Damato wrote:
> > Add per-pool statistics counters for the allocation path of a page pool.
> > These stats are incremented in softirq context, so no locking or per-cpu
> > variables are needed.
> >
> > This code is disabled by default and a kernel config option is provided for
> > users who wish to enable them.
> >
> > The statistics added are:
> >       - fast: successful fast path allocations
> >       - slow: slow path order-0 allocations
> >       - slow_high_order: slow path high order allocations
> >       - empty: ptr ring is empty, so a slow path allocation was forced.
> >       - refill: an allocation which triggered a refill of the cache
> >       - waive: pages obtained from the ptr ring that cannot be added to
> >         the cache due to a NUMA mismatch.
> >
> > Signed-off-by: Joe Damato<jdamato@fastly.com>
> > ---
> >   include/net/page_pool.h | 18 ++++++++++++++++++
> >   net/Kconfig             | 13 +++++++++++++
> >   net/core/page_pool.c    | 24 ++++++++++++++++++++----
> >   3 files changed, 51 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/net/page_pool.h b/include/net/page_pool.h
> > index 97c3c19..1f27e8a4 100644
> > --- a/include/net/page_pool.h
> > +++ b/include/net/page_pool.h
> > @@ -84,6 +84,19 @@ struct page_pool_params {
> >       void *init_arg;
> >   };
> >
> > +#ifdef CONFIG_PAGE_POOL_STATS
> > +struct page_pool_alloc_stats {
> > +     u64 fast; /* fast path allocations */
> > +     u64 slow; /* slow-path order 0 allocations */
> > +     u64 slow_high_order; /* slow-path high order allocations */
> > +     u64 empty; /* failed refills due to empty ptr ring, forcing
> > +                 * slow path allocation
> > +                 */
> > +     u64 refill; /* allocations via successful refill */
> > +     u64 waive;  /* failed refills due to numa zone mismatch */
> > +};
> > +#endif
> > +
> >   struct page_pool {
> >       struct page_pool_params p;
> >
> > @@ -96,6 +109,11 @@ struct page_pool {
> >       unsigned int frag_offset;
> >       struct page *frag_page;
> >       long frag_users;
> > +
> > +#ifdef CONFIG_PAGE_POOL_STATS
> > +     /* these stats are incremented while in softirq context */
> > +     struct page_pool_alloc_stats alloc_stats;
> > +#endif
> >       u32 xdp_mem_id;
>
> I like the cache-line placement.
>
> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

  reply	other threads:[~2022-02-28  7:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 17:41 [net-next v7 0/4] page_pool: Add stats counters Joe Damato
2022-02-25 17:41 ` [net-next v7 1/4] page_pool: Add allocation stats Joe Damato
2022-02-28  7:07   ` Jesper Dangaard Brouer
2022-02-28  7:28     ` Ilias Apalodimas [this message]
2022-02-25 17:41 ` [net-next v7 2/4] page_pool: Add recycle stats Joe Damato
2022-02-28  7:20   ` Jesper Dangaard Brouer
2022-02-28  7:28     ` Ilias Apalodimas
2022-02-25 17:41 ` [net-next v7 3/4] page_pool: Add function to batch and return stats Joe Damato
2022-02-28  7:22   ` Jesper Dangaard Brouer
2022-02-28  7:29     ` Ilias Apalodimas
2022-02-25 17:41 ` [net-next v7 4/4] mlx5: add support for page_pool_get_stats Joe Damato
2022-02-28  7:28   ` Jesper Dangaard Brouer
2022-02-28  8:38     ` Joe Damato
2022-02-28  9:08       ` Toke Høiland-Jørgensen
2022-03-01  0:51         ` Joe Damato
2022-03-01 11:23           ` Toke Høiland-Jørgensen
2022-03-01 17:00             ` Joe Damato

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='CAC_iWjKnHt+PFsxxSXvWskHsVqB=bSzjfADdpbuviCgdz5BmOw@mail.gmail.com' \
    --to=ilias.apalodimas@linaro.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=jbrouer@redhat.com \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeed@kernel.org \
    --cc=ttoukan.linux@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.