Skip to content
Commit bc38f30f authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Jakub Kicinski
Browse files

net: introduce common dev_page_is_reusable()



A bunch of drivers test the page before reusing/recycling for two
common conditions:
 - if a page was allocated under memory pressure (pfmemalloc page);
 - if a page was allocated at a distant memory node (to exclude
   slowdowns).

Introduce a new common inline for doing this, with likely() already
folded inside to make driver code a bit simpler.

Suggested-by: default avatarDavid Rientjes <rientjes@google.com>
Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
Reviewed-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 48f971c9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment