#author("2025-09-13T01:32:14+09:00","default:guest","guest") #author("2025-09-13T01:33:30+09:00","default:guest","guest") *参照元 [#a52ec13c] #backlinks *説明 [#tfd57c9c] -パス: [[linux-5.15/]] -パス: [[linux-5.15/mm/page_alloc.c]] -FIXME: これは何? --説明 **引数 [#f8a5d39b] - -struct zone *preferred_zone -- --[[linux-5.15/zone]] -struct zone *zone -- --[[linux-5.15/zone]] -unsigned int order -- -gfp_t gfp_flags -- --[[linux-5.15/gfp_t]] -int migratetype -- -unsigned int alloc_flags -- **返り値 [#n03d1e20] - -struct page * -- --[[linux-5.15/page]] **参考 [#z5eb9679] *実装 [#g08b66e1] /* Lock and remove page from the per-cpu list */ static struct page *rmqueue_pcplist(struct zone *preferred_zone, struct zone *zone, unsigned int order, gfp_t gfp_flags, int migratetype, unsigned int alloc_flags) { struct per_cpu_pages *pcp; struct list_head *list; struct page *page; unsigned long flags; local_lock_irqsave(&pagesets.lock, flags); - --[[linux-5.15/per_cpu_pages]] --[[linux-5.15/list_head]] --[[linux-5.15/page]] --[[linux-5.15/local_lock_irqsave()]] /* * On allocation, reduce the number of pages that are batch freed. * See nr_pcp_free() where free_factor is increased for subsequent * frees. */ pcp = this_cpu_ptr(zone->per_cpu_pageset); pcp->free_factor >>= 1; list = &pcp->lists[order_to_pindex(migratetype, order)]; page = __rmqueue_pcplist(zone, order, migratetype, alloc_flags, pcp, list); local_unlock_irqrestore(&pagesets.lock, flags); if (page) { __count_zid_vm_events(PGALLOC, page_zonenum(page), 1); zone_statistics(preferred_zone, zone, 1); } return page; } - --[[linux-5.15/this_cpu_ptr()]] --[[linux-5.15/order_to_pindex()]] --[[linux-5.15/__rmqueue_pcplist()]] --[[linux-5.15/local_unlock_irqrestore()]] --[[linux-5.15/__count_zid_vm_events()]] --[[linux-5.15/page_zonenum()]] --[[linux-5.15/zone_statistics()]] *コメント [#nddd711d]