This patch adds a new page allocator interface via alloc_pages_bulk, and
__alloc_pages_bulk_nodemask. A caller requests a number of pages to be
allocated and added to a list.
The API is not guaranteed to return the requested number of pages and
may fail if the preferred allocation zone has limited free memory, the
cpuset changes during the allocation or page debugging decides to fail
an allocation. It's up to the caller to request more pages in batch if
necessary.
Note that this implementation is not very efficient and could be
improved but it would require refactoring. The intent is to make it
available early to determine what semantics are required by different
callers. Once the full semantics are nailed down, it can be refactored.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
来自主线新的相关bugfix补丁:
mm/page_alloc: avoid page allocator recursion with pagesets.lock held
mainline inclusion
from mainline-5.14-rc2
commit 187ad460b8413e863c951998cb321a117a717868
该补丁主要是修复在page_owner打开时导致死锁的问题,因为打开page_owner时会在set_page_owner之后获取同一个锁,虽然引入死锁bug的补丁 dbbee9d5cd83 ("mm/page_alloc: convert per-cpu list protection to local_lock)并未合入,但出现了重复关闭中断的问题以及关了中断会调用可能会睡眠的函数的问题,因此建议合入该补丁。合入该补丁后在打开page_onwer之后将使用普通alloc_pages接口分配内存,主线正在讨论开启page_owner之后正常使用alloc_pages_bulk的特性。等稳定之后将回合。
mm/page_alloc: correct return value when failing at preparing
mainline inclusion
from mainline-5.14-rc2
commit e5c15cea339115edf99dc92282865f173cf84510
该补丁主要修了一个返回值错误的问题。
mm/page_alloc: further fix __alloc_pages_bulk() return value
mainline inclusion
from mainline-5.14-rc2
commit 061478438d04779181c2ce4d7ffeeca343a70a98
该补丁主要是做了一个clean up。将相同的错误返回值放到固定位置并使用goto,便于后续bug fix的合入。
登录 后才可以发表评论