Skip to content

Commit

Permalink
page_pool: use relaxed atomic for release side accounting
Browse files Browse the repository at this point in the history
There is no need to synchronize the account updating, so
use the relaxed atomic to avoid some memory barrier in the
data path.

Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yunsheng Lin authored and David S. Miller committed Aug 24, 2021
1 parent 669f047 commit 7fb9b66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/page_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ void page_pool_release_page(struct page_pool *pool, struct page *page)
/* This may be the last page returned, releasing the pool, so
* it is not safe to reference pool afterwards.
*/
count = atomic_inc_return(&pool->pages_state_release_cnt);
count = atomic_inc_return_relaxed(&pool->pages_state_release_cnt);
trace_page_pool_state_release(pool, page, count);
}
EXPORT_SYMBOL(page_pool_release_page);
Expand Down

0 comments on commit 7fb9b66

Please sign in to comment.