Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: Joe Damato <jdamato@fastly.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org,
	ilias.apalodimas@linaro.org, davem@davemloft.net,
	hawk@kernel.org, ttoukan.linux@gmail.com, brouer@redhat.com,
	leon@kernel.org, linux-rdma@vger.kernel.org, saeedm@nvidia.com
Subject: Re: [net-next v8 2/4] page_pool: Add recycle stats
Date: Tue, 1 Mar 2022 15:58:10 -0800	[thread overview]
Message-ID: <20220301235810.ywhifu27sbco67bd@sx1> (raw)
In-Reply-To: <1646172610-129397-3-git-send-email-jdamato@fastly.com>

On 01 Mar 14:10, Joe Damato wrote:
>Add per-cpu stats tracking page pool recycling events:
>	- cached: recycling placed page in the page pool cache
>	- cache_full: page pool cache was full
>	- ring: page placed into the ptr ring
>	- ring_full: page released from page pool because the ptr ring was full
>	- released_refcnt: page released (and not recycled) because refcnt > 1
>

Kernel documentation.

[...]

>
>@@ -410,6 +423,11 @@ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
> 	else
> 		ret = ptr_ring_produce_bh(&pool->ring, page);
>
>+#ifdef CONFIG_PAGE_POOL_STATS
>+	if (ret == 0)
>+		recycle_stat_inc(pool, ring);
>+#endif
>+
> 	return (ret == 0) ? true : false;
> }
>

To avoid the ifdef, it makes more sense to refactor to:

if (!ret) {
	recycle_stat_inc(pool, ring);
         return true;
}

return false;   



  reply	other threads:[~2022-03-01 23:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01 22:10 [net-next v8 0/4] page_pool: Add stats counters Joe Damato
2022-03-01 22:10 ` [net-next v8 1/4] page_pool: Add allocation stats Joe Damato
2022-03-01 23:50   ` Saeed Mahameed
2022-03-02  1:51     ` Joe Damato
2022-03-02  4:32       ` Saeed Mahameed
2022-03-01 22:10 ` [net-next v8 2/4] page_pool: Add recycle stats Joe Damato
2022-03-01 23:58   ` Saeed Mahameed [this message]
2022-03-01 22:10 ` [net-next v8 3/4] page_pool: Add function to batch and return stats Joe Damato
2022-03-01 22:10 ` [net-next v8 4/4] mlx5: add support for page_pool_get_stats Joe Damato
2022-03-02  1:02   ` Saeed Mahameed
2022-03-02  1:50     ` Joe Damato
2022-03-02  4:36       ` Saeed Mahameed

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=20220301235810.ywhifu27sbco67bd@sx1 \
    --to=saeed@kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox