Commit e830dee5 authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Zheng Zengkai
Browse files

net: introduce common dev_page_is_reusable()

mainline inclusion
from mainline-v5.12-rc1-dontuse
commit bc38f30f
category: feature
bugzilla: 173966
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bc38f30f8dbce0afb8af05d917bee084b1329418



----------------------------------------------------------------------

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>
Reviewed-by: default avatarYongxin Li <liyongxin1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2ff3f991
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment