#author("2025-10-31T18:19:24+09:00","default:guest","guest") #author("2025-10-31T18:19:45+09:00","default:guest","guest") *参照元 [#w9c20fae] #backlinks *説明 [#r16e3d2d] -パス: [[linux-5.15/mm/internal.h]] -FIXME: これは何? --説明 **引数 [#tac568e9] -struct page *page -- --[[linux-5.15/page]] **返り値 [#ab1a8788] -unsigned int -- **参考 [#w2d661c8] *実装 [#r2827d15] /* * This function returns the order of a free page in the buddy system. In * general, page_zone(page)->lock must be held by the caller to prevent the * page from being allocated in parallel and returning garbage as the order. * If a caller does not hold page_zone(page)->lock, it must guarantee that the * page cannot be allocated or merged in parallel. Alternatively, it must * handle invalid values gracefully, and use buddy_order_unsafe() below. */ static inline unsigned int buddy_order(struct page *page) { /* PageBuddy() must be checked by the caller */ return page_private(page); } -PageBuddy()がtrueの場合、page->privateにorderがセットされているのでorderを返す。 --[[linux-5.15/page_private()]] --[[linux-5.15/PageBuddy()]] -orderを設定している箇所はset_buddy_order()関数。 --[[linux-5.15/set_buddy_order()]] *コメント [#e4d94c70]