Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	<linux-rdma@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Eric Dumazet <edumazet@google.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Leon Romanovsky <leon@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	Simon Horman <horms@kernel.org>, Tariq Toukan <tariqt@nvidia.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH net-next 2/2] page_pool: Convert page_pool_alloc_stats to u64_stats_t.
Date: Sat, 22 Feb 2025 16:13:47 +0800	[thread overview]
Message-ID: <c7b52d18-430c-4a00-908a-9279bc77db50@huawei.com> (raw)
In-Reply-To: <20250221115221.291006-3-bigeasy@linutronix.de>

On 2025/2/21 19:52, Sebastian Andrzej Siewior wrote:

...
						\
> @@ -88,19 +95,30 @@ static const char pp_stats[][ETH_GSTRING_LEN] = {
>  bool page_pool_get_stats(const struct page_pool *pool,
>  			 struct page_pool_stats *stats)
>  {
> +	const struct page_pool_alloc_stats *alloc_stats;
>  	unsigned int start;
>  	int cpu = 0;
>  
>  	if (!stats)
>  		return false;
>  
> +	alloc_stats = &pool->alloc_stats;
>  	/* The caller is responsible to initialize stats. */
> -	stats->alloc_stats.fast += pool->alloc_stats.fast;
> -	stats->alloc_stats.slow += pool->alloc_stats.slow;
> -	stats->alloc_stats.slow_high_order += pool->alloc_stats.slow_high_order;
> -	stats->alloc_stats.empty += pool->alloc_stats.empty;
> -	stats->alloc_stats.refill += pool->alloc_stats.refill;
> -	stats->alloc_stats.waive += pool->alloc_stats.waive;
> +	do {
> +		start = u64_stats_fetch_begin(&alloc_stats->syncp);
> +		u64_stats_add(&stats->alloc_stats.fast,
> +			      u64_stats_read(&alloc_stats->fast));
> +		u64_stats_add(&stats->alloc_stats.slow,
> +			      u64_stats_read(&alloc_stats->slow));
> +		u64_stats_add(&stats->alloc_stats.slow_high_order,
> +			      u64_stats_read(&alloc_stats->slow_high_order));
> +		u64_stats_add(&stats->alloc_stats.empty,
> +			      u64_stats_read(&alloc_stats->empty));
> +		u64_stats_add(&stats->alloc_stats.refill,
> +			      u64_stats_read(&alloc_stats->refill));
> +		u64_stats_add(&stats->alloc_stats.waive,
> +			      u64_stats_read(&alloc_stats->waive));

similar comment as patch 1.

> +	} while (u64_stats_fetch_retry(&alloc_stats->syncp, start));
>  


  parent reply	other threads:[~2025-02-22  8:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 11:52 [PATCH net-next 0/2] page_pool: Convert stats to u64_stats_t Sebastian Andrzej Siewior
2025-02-21 11:52 ` [PATCH net-next 1/2] page_pool: Convert page_pool_recycle_stats " Sebastian Andrzej Siewior
2025-02-21 17:21   ` Joe Damato
2025-02-26 12:06     ` Sebastian Andrzej Siewior
2025-02-22  8:13   ` Yunsheng Lin
2025-02-25 11:27     ` Paolo Abeni
2025-02-26  9:28     ` Sebastian Andrzej Siewior
2025-02-21 11:52 ` [PATCH net-next 2/2] page_pool: Convert page_pool_alloc_stats " Sebastian Andrzej Siewior
2025-02-21 17:30   ` Joe Damato
2025-02-22  8:13   ` Yunsheng Lin [this message]
2025-02-21 17:10 ` [PATCH net-next 0/2] page_pool: Convert stats " Joe Damato
2025-02-26 10:27   ` Sebastian Andrzej Siewior

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=c7b52d18-430c-4a00-908a-9279bc77db50@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=tglx@linutronix.de \
    /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