Function report |
Source Code:mm\slub.c |
Create Date:2022-07-28 15:47:32 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:allocate_slab
Proto:static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
Type:struct page
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct kmem_cache * | s | |
| gfp_t | flags | |
| int | node |
| 1626 | flags &= gfp_allowed_mask |
| 1628 | If gfpflags_allow_blocking(flags) Then The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.() |
| 1631 | flags |= gfp flags to use on each alloc |
| 1638 | If alloc_gfp & Caller can reclaim && oo_order(oo) > oo_order(min) Then alloc_gfp = (alloc_gfp | __GFP_NOMEMALLOC) & ~(__GFP_RECLAIM | __GFP_NOFAIL) |
| 1641 | page = Slab allocation and freeing |
| 1642 | If Value for the false possibility is greater at compile time(!page) Then |
| 1649 | page = Slab allocation and freeing |
| 1650 | If Value for the false possibility is greater at compile time(!page) Then Go to out |
| 1655 | objects = oo_objects(oo) |
| 1658 | __SetPageSlab(page) |
| 1659 | If Return true only if the page has been allocated with* ALLOC_NO_WATERMARKS and the low watermark was not* met implying that the system is under some pressure. Then SetPageSlabPfmemalloc(page) |
| 1662 | kasan_poison_slab(page) |
| 1664 | start = page_address(page) |
| 1666 | setup_page_debug(s, page, start) |
| 1668 | shuffle = shuffle_freelist(s, page) |
| 1670 | If Not shuffle Then |
| 1671 | start = fixup_red_left(s, start) |
| 1672 | start = setup_object(s, page, start) |
| 1673 | first free object = start |
| 1676 | next = setup_object(s, page, next) |
| 1677 | set_freepointer(s, p, next) |
| 1680 | set_freepointer(s, p, NULL) |
| 1684 | frozen = 1 |
| 1686 | out : |
| 1687 | If gfpflags_allow_blocking(flags) Then local_irq_disable() |
| 1689 | If Not page Then Return NULL |
| 1692 | inc_slabs_node(s, page_to_nid(page), objects) |
| 1694 | Return page |
| Name | Describe |
|---|---|
| new_slab |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |