Compound Page
/*
* Higher-order pages are called "compound pages". They are structured thusly:
*
* The first PAGE_SIZE page is called the "head page" and have PG_head set.
*
* The remaining PAGE_SIZE pages are called "tail pages". PageTail() is encoded
* in bit 0 of page->compound_head. The rest of bits is pointer to head page.
*
* The first tail page's ->compound_order holds the order of allocation.
* This usage means that zero-order pages may not be compound.
*/ page[0] page[1] page[2] page[3]
+----------------+ +----------------+ +----------------+ +----------------+
|PG_HEAD | |_flags_1(order) | | | | |
| | | | | | | |
| | | | | | | |
| | |compound_head + | |compound_head + | |compound_head + |
+----------------+ +--------------|-+ +--------------|-+ +--------------|-+
^ | | |
| | | |
+------------------------------------+---------------------+---------------------+组合页的判断
头页面
尾页面
是组合页
获取头页面
组合页的分配和释放
分配流程
释放流程
Last updated