• Muchun Song's avatar
    mm: hugetlb: defer freeing of HugeTLB pages · b65d4adb
    Muchun Song authored
    In the subsequent patch, we should allocate the vmemmap pages when freeing
    a HugeTLB page.  But update_and_free_page() can be called under any
    context, so we cannot use GFP_KERNEL to allocate vmemmap pages.  However,
    we can defer the actual freeing in a kworker to prevent from using
    GFP_ATOMIC to allocate the vmemmap pages.
    
    The __update_and_free_page() is where the call to allocate vmemmmap pages
    will be inserted.
    
    Link: https://lkml.kernel.org/r/20210510030027.56044-6-songmuchun@bytedance.comSigned-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
    Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
    Reviewed-by: default avatarOscar Salvador <osalvador@suse.de>
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Anshuman Khandual <anshuman.khandual@arm.com>
    Cc: Balbir Singh <bsingharora@gmail.com>
    Cc: Barry Song <song.bao.hua@hisilicon.com>
    Cc: Bodeddula Balasubramaniam <bodeddub@amazon.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Chen Huang <chenhuang5@huawei.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: HORIGUCHI NAOYA <naoya.horiguchi@nec.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Joao Martins <joao.m.martins@oracle.com>
    Cc: Joerg Roedel <jroedel@suse.de>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mina Almasry <almasrymina@google.com>
    Cc: Oliver Neukum <oneukum@suse.com>
    Cc: Paul E. McKenney <paulmck@kernel.org>
    Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Randy Dunlap <rdunlap@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Xiongchun Duan <duanxiongchun@bytedance.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    b65d4adb
hugetlb_vmemmap.c 10.2 KB