• Mike Kravetz's avatar
    mm/cma: change cma mutex to irq safe spinlock · 0ef7dcac
    Mike Kravetz authored
    Patch series "make hugetlb put_page safe for all calling contexts", v5.
    
    This effort is the result a recent bug report [1].  Syzbot found a
    potential deadlock in the hugetlb put_page/free_huge_page_path.  WARNING:
    SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected Since the
    free_huge_page_path already has code to 'hand off' page free requests to a
    workqueue, a suggestion was proposed to make the in_irq() detection
    accurate by always enabling PREEMPT_COUNT [2].  The outcome of that
    discussion was that the hugetlb put_page path (free_huge_page) path should
    be properly fixed and safe for all calling contexts.
    
    [1] https://lore.kernel.org/linux-mm/000000000000f1c03b05bc43aadc@google.com/
    [2] http://lkml.kernel.org/r/20210311021321.127500-1-mike.kravetz@oracle.com
    
    This patch (of 8):
    
    cma_release is currently a sleepable operatation because the bitmap
    manipulation is protected by cma->lock mutex.  Hugetlb code which relies
    on cma_release for CMA backed (giga) huget...
    0ef7dcac
cma_debug.c 4.53 KB