netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: Don't return pfmemalloc pages to the page pool.
@ 2018-12-19 20:06 Jonathan Lemon
  2018-12-20 13:03 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Lemon @ 2018-12-19 20:06 UTC (permalink / raw)
  To: netdev; +Cc: brouer, Jonathan Lemon

Return pfmemalloc pages back to the page allocator, instead of holding them
in the page pool.  While here, also use the __page_pool_return_page() API.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
---
 net/core/page_pool.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/core/page_pool.c b/net/core/page_pool.c
index 43a932cb609b..091007ff14a3 100644
--- a/net/core/page_pool.c
+++ b/net/core/page_pool.c
@@ -233,7 +233,7 @@ void __page_pool_put_page(struct page_pool *pool,
 	 *
 	 * refcnt == 1 means page_pool owns page, and can recycle it.
 	 */
-	if (likely(page_ref_count(page) == 1)) {
+	if (likely(page_ref_count(page) == 1 && !page_is_pfmemalloc(page))) {
 		/* Read barrier done in page_ref_count / READ_ONCE */
 
 		if (allow_direct && in_serving_softirq())
@@ -259,8 +259,7 @@ void __page_pool_put_page(struct page_pool *pool,
 	 * doing refcnt based recycle tricks, meaning another process
 	 * will be invoking put_page.
 	 */
-	__page_pool_clean_page(pool, page);
-	put_page(page);
+	__page_pool_return_page(pool, page);
 }
 EXPORT_SYMBOL(__page_pool_put_page);
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-12-21 14:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19 20:06 [PATCH net-next] net: Don't return pfmemalloc pages to the page pool Jonathan Lemon
2018-12-20 13:03 ` Jesper Dangaard Brouer
2018-12-20 22:11   ` Jonathan Lemon
2018-12-20 23:41     ` Saeed Mahameed
2018-12-21  0:56       ` Jonathan Lemon
2018-12-21  2:13         ` Saeed Mahameed
2018-12-21  2:26           ` Saeed Mahameed
2018-12-21 14:42     ` Jesper Dangaard Brouer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).