函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-27 16:33:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:set_pfnblock_flags_mask - Set the requested group of flags for a pageblock_nr_pages block of pages*@page: The page within the block of interest*@flags: The flags to set*@pfn: The target page frame number*@end_bitidx: The last bit of interest*@mask: mask

函数原型:void set_pfnblock_flags_mask(struct page *page, unsigned long flags, unsigned long pfn, unsigned long end_bitidx, unsigned long mask)

返回类型:void

参数:

类型参数名称
struct page *page
unsigned longflags
unsigned longpfn
unsigned longend_bitidx
unsigned longmask
527  BUILD_BUG_ON - break compile if a condition is true(NR_PAGEBLOCK_BITS != 4)
528  BUILD_BUG_ON - break compile if a condition is true(MIGRATE_TYPES > (1 << PB_migratetype_bits))
530  bitmap等于Return a pointer to the bitmap storing bits affecting a block of pages
531  bitidx等于pfn_to_bitidx(page, pfn)
532  word_bitidx等于bitidxBITS_PER_LONG
533  bitidx与等于BITS_PER_LONG减1
535  VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page)
537  bitidx加等于end_bitidx
538  mask左移等于BITS_PER_LONGbitidx减1位
539  flags左移等于BITS_PER_LONGbitidx减1位
541  word等于READ_ONCE(bitmap[word_bitidx])
542  循环
543  old_word等于cmpxchg( & bitmap[word_bitidx], word, (word & ~mask) | flags)
544  如果word恒等于old_word退出
546  word等于old_word