~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/bootmem_info.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __LINUX_BOOTMEM_INFO_H
  3 #define __LINUX_BOOTMEM_INFO_H
  4 
  5 #include <linux/mm.h>
  6 #include <linux/kmemleak.h>
  7 
  8 /*
  9  * Types for free bootmem stored in page->lru.next. These have to be in
 10  * some random range in unsigned long space for debugging purposes.
 11  */
 12 enum {
 13         MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 12,
 14         SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE,
 15         MIX_SECTION_INFO,
 16         NODE_INFO,
 17         MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
 18 };
 19 
 20 #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
 21 void __init register_page_bootmem_info_node(struct pglist_data *pgdat);
 22 
 23 void get_page_bootmem(unsigned long info, struct page *page,
 24                       unsigned long type);
 25 void put_page_bootmem(struct page *page);
 26 
 27 /*
 28  * Any memory allocated via the memblock allocator and not via the
 29  * buddy will be marked reserved already in the memmap. For those
 30  * pages, we can call this function to free it to buddy allocator.
 31  */
 32 static inline void free_bootmem_page(struct page *page)
 33 {
 34         unsigned long magic = page->index;
 35 
 36         /*
 37          * The reserve_bootmem_region sets the reserved flag on bootmem
 38          * pages.
 39          */
 40         VM_BUG_ON_PAGE(page_ref_count(page) != 2, page);
 41 
 42         if (magic == SECTION_INFO || magic == MIX_SECTION_INFO)
 43                 put_page_bootmem(page);
 44         else
 45                 VM_BUG_ON_PAGE(1, page);
 46 }
 47 #else
 48 static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
 49 {
 50 }
 51 
 52 static inline void put_page_bootmem(struct page *page)
 53 {
 54 }
 55 
 56 static inline void get_page_bootmem(unsigned long info, struct page *page,
 57                                     unsigned long type)
 58 {
 59 }
 60 
 61 static inline void free_bootmem_page(struct page *page)
 62 {
 63         kmemleak_free_part_phys(PFN_PHYS(page_to_pfn(page)), PAGE_SIZE);
 64         free_reserved_page(page);
 65 }
 66 #endif
 67 
 68 #endif /* __LINUX_BOOTMEM_INFO_H */
 69 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php