Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55900C04AB4 for ; Tue, 14 May 2019 19:04:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2705A2168B for ; Tue, 14 May 2019 19:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557860660; bh=WFnDcqZS2TsnUcXAOFRAKAOhsf5cvKYcE7PsEJDyb/Y=; h=Date:From:To:Subject:List-ID:From; b=RagwdbPs1bewMUPRDZhqZSPwaPosneEF2AJ1sNHZscsbjS1kNAex7a1MdHMeP84Vv IZQM9Kz9SjPR7Sw3VLxcOiyLlBvCdIEQArXqIf2SEtx+IfReIg5O76O1fqgjJn+tZk VeE+mu7DMnq2F4rx/Pebw8LttO5ms3XlDeU59VxQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbfENTET (ORCPT ); Tue, 14 May 2019 15:04:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57562 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726261AbfENTET (ORCPT ); Tue, 14 May 2019 15:04:19 -0400 Received: from localhost.localdomain (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C266420881; Tue, 14 May 2019 19:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557860659; bh=WFnDcqZS2TsnUcXAOFRAKAOhsf5cvKYcE7PsEJDyb/Y=; h=Date:From:To:Subject:From; b=Dfb5W2YgYBMjvndE7zYGbVF50AGD01q2N3Qil/Pu0tMo3fb/ysbmYIoVxrJh1PmLs yTEoQPzuDlNnfn2LCKrFtwffF6g+9OkIksguUM6BIuzubWq82xGI3GkYR13+hYUFiQ RBnFLXVBAzulLvcMd28t0TaLyF+mTURwri3BxgeY= Date: Tue, 14 May 2019 12:04:18 -0700 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, linfeilong@huawei.com, mhocko@suse.com, mike.kravetz@oracle.com, mm-commits@vger.kernel.org, osalvador@suse.de, shenkai8@huawei.com, stable@vger.kernel.org, wangwang2@huawei.com Subject: [merged] mm-hugetlb-dont-put_page-in-lock-of-hugetlb_lock.patch removed from -mm tree Message-ID: <20190514190418.CYnymtuaE%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch titled Subject: mm/hugetlb.c: don't put_page in lock of hugetlb_lock has been removed from the -mm tree. Its filename was mm-hugetlb-dont-put_page-in-lock-of-hugetlb_lock.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Kai Shen Subject: mm/hugetlb.c: don't put_page in lock of hugetlb_lock spinlock recursion happened when do LTP test: #!/bin/bash ./runltp -p -f hugetlb & ./runltp -p -f hugetlb & ./runltp -p -f hugetlb & ./runltp -p -f hugetlb & ./runltp -p -f hugetlb & The dtor returned by get_compound_page_dtor in __put_compound_page may be the function of free_huge_page which will lock the hugetlb_lock, so don't put_page in lock of hugetlb_lock. BUG: spinlock recursion on CPU#0, hugemmap05/1079 lock: hugetlb_lock+0x0/0x18, .magic: dead4ead, .owner: hugemmap05/1079, .owner_cpu: 0 Call trace: dump_backtrace+0x0/0x198 show_stack+0x24/0x30 dump_stack+0xa4/0xcc spin_dump+0x84/0xa8 do_raw_spin_lock+0xd0/0x108 _raw_spin_lock+0x20/0x30 free_huge_page+0x9c/0x260 __put_compound_page+0x44/0x50 __put_page+0x2c/0x60 alloc_surplus_huge_page.constprop.19+0xf0/0x140 hugetlb_acct_memory+0x104/0x378 hugetlb_reserve_pages+0xe0/0x250 hugetlbfs_file_mmap+0xc0/0x140 mmap_region+0x3e8/0x5b0 do_mmap+0x280/0x460 vm_mmap_pgoff+0xf4/0x128 ksys_mmap_pgoff+0xb4/0x258 __arm64_sys_mmap+0x34/0x48 el0_svc_common+0x78/0x130 el0_svc_handler+0x38/0x78 el0_svc+0x8/0xc Link: http://lkml.kernel.org/r/b8ade452-2d6b-0372-32c2-703644032b47@huawei.com Fixes: 9980d744a0 ("mm, hugetlb: get rid of surplus page accounting tricks") Signed-off-by: Kai Shen Signed-off-by: Feilong Lin Reported-by: Wang Wang Reviewed-by: Oscar Salvador Reviewed-by: Mike Kravetz Reviewed-by: Andrew Morton Acked-by: Michal Hocko Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/hugetlb.c~mm-hugetlb-dont-put_page-in-lock-of-hugetlb_lock +++ a/mm/hugetlb.c @@ -1574,8 +1574,9 @@ static struct page *alloc_surplus_huge_p */ if (h->surplus_huge_pages >= h->nr_overcommit_huge_pages) { SetPageHugeTemporary(page); + spin_unlock(&hugetlb_lock); put_page(page); - page = NULL; + return NULL; } else { h->surplus_huge_pages++; h->surplus_huge_pages_node[page_to_nid(page)]++; _ Patches currently in -mm which might be from shenkai8@huawei.com are