lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220301235810.ywhifu27sbco67bd@sx1>
Date:   Tue, 1 Mar 2022 15:58:10 -0800
From:   Saeed Mahameed <saeed@...nel.org>
To:     Joe Damato <jdamato@...tly.com>
Cc:     netdev@...r.kernel.org, kuba@...nel.org,
        ilias.apalodimas@...aro.org, davem@...emloft.net, hawk@...nel.org,
        ttoukan.linux@...il.com, brouer@...hat.com, leon@...nel.org,
        linux-rdma@...r.kernel.org, saeedm@...dia.com
Subject: Re: [net-next v8 2/4] page_pool: Add recycle stats

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;   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ