• Vlastimil Babka's avatar
    mm, slub: do initial checks in ___slab_alloc() with irqs enabled · 0b303fb4
    Vlastimil Babka authored
    As another step of shortening irq disabled sections in ___slab_alloc(), delay
    disabling irqs until we pass the initial checks if there is a cached percpu
    slab and it's suitable for our allocation.
    
    Now we have to recheck c->page after actually disabling irqs as an allocation
    in irq handler might have replaced it.
    
    Because we call pfmemalloc_match() as one of the checks, we might hit
    VM_BUG_ON_PAGE(!PageSlab(page)) in PageSlabPfmemalloc in case we get
    interrupted and the page is freed. Thus introduce a pfmemalloc_match_unsafe()
    variant that lacks the PageSlab check.
    Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
    0b303fb4
page-flags.h 28.7 KB