Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-28 15:03:07
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:void set_pfnblock_flags_mask(struct page *page, unsigned long flags, unsigned long pfn, unsigned long end_bitidx, unsigned long mask)

Type:void

Parameter:

TypeParameterName
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 = bitidx / BITS_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_LONG - bitidx - 1
539  flags <<= BITS_PER_LONG - bitidx - 1
541  word = READ_ONCE(bitmap[word_bitidx])
542  cycle
543  old_word = cmpxchg( & bitmap[word_bitidx], word, (word & ~mask) | flags)
544  If word == old_word Then Break
546  word = old_word