Lines Matching refs:pfn
31 static inline off64_t pfn_to_idle_bitmap_offset(uint64_t pfn) { in pfn_to_idle_bitmap_offset() argument
32 return static_cast<off64_t>((pfn >> 6) << 3); in pfn_to_idle_bitmap_offset()
77 bool PageAcct::PageFlags(uint64_t pfn, uint64_t* flags) { in PageFlags() argument
84 if (pread64(kpageflags_fd_, flags, sizeof(uint64_t), pfn * sizeof(uint64_t)) != in PageFlags()
86 PLOG(ERROR) << "Failed to read page flags for page " << pfn; in PageFlags()
92 bool PageAcct::PageMapCount(uint64_t pfn, uint64_t* mapcount) { in PageMapCount() argument
99 if (pread64(kpagecount_fd_, mapcount, sizeof(uint64_t), pfn * sizeof(uint64_t)) != in PageMapCount()
101 PLOG(ERROR) << "Failed to read map count for page " << pfn; in PageMapCount()
107 int PageAcct::IsPageIdle(uint64_t pfn) { in IsPageIdle() argument
112 int idle_status = MarkPageIdle(pfn); in IsPageIdle()
115 return GetPageIdle(pfn); in IsPageIdle()
118 int PageAcct::MarkPageIdle(uint64_t pfn) const { in MarkPageIdle()
119 off64_t offset = pfn_to_idle_bitmap_offset(pfn); in MarkPageIdle()
121 uint64_t idle_bits = 1ULL << (pfn % 64); in MarkPageIdle()
124 PLOG(ERROR) << "Failed to write page idle bitmap for page " << pfn; in MarkPageIdle()
131 int PageAcct::GetPageIdle(uint64_t pfn) const { in GetPageIdle()
132 off64_t offset = pfn_to_idle_bitmap_offset(pfn); in GetPageIdle()
136 PLOG(ERROR) << "Failed to read page idle bitmap for page " << pfn; in GetPageIdle()
140 return !!(idle_bits & (1ULL << (pfn % 64))); in GetPageIdle()