From patchwork Tue Nov 13 12:38:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongkai Wu X-Patchwork-Id: 10680541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F0421709 for ; Tue, 13 Nov 2018 12:38:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67FAD21EEB for ; Tue, 13 Nov 2018 12:38:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 583872223E; Tue, 13 Nov 2018 12:38:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 395462A7AF for ; Tue, 13 Nov 2018 12:38:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 978CF6B0003; Tue, 13 Nov 2018 07:38:28 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 926D36B0006; Tue, 13 Nov 2018 07:38:28 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 817EF6B0007; Tue, 13 Nov 2018 07:38:28 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by kanga.kvack.org (Postfix) with ESMTP id 54D416B0003 for ; Tue, 13 Nov 2018 07:38:28 -0500 (EST) Received: by mail-io1-f69.google.com with SMTP id y14-v6so12407547ioa.22 for ; Tue, 13 Nov 2018 04:38:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:mime-version:from:date:message-id :subject:to:cc; bh=qIxbFDuDorh1mkcVPN/dM3fOaLgap3ilCqw5H06HwpY=; b=VFmi0RGte0IcRKE8EZwJGTqqCBxP+TQDxbHcfpbrT8Q982JueQO2dnCcTvQhz0QP7Y uWPjyeCHCtr4K3zIBW48+PC4ufqFRfVGJQlfxS4wj0iUR4iOg/ejYnvyPIPpSfqeyAUv XbaPmD+NhkrekgESGVQGILZQXAPQBOrKvoxH3nko7AvnGpt+9VB+ANRtwHVSuV0iy1mK cNp8DwPxvKx/3/3y8/xO2AeFDzEgV/YpuUfoo5H9VBPdSPy4Fg8sOOWn47da9isw/2DY LP9NzY1uwwx5xCfF5wYCJ1x4KLBCXjXQ8z7ejS3QIoLn4UbK2LGC8RFHWwz5jk2YnR4Y oPaw== X-Gm-Message-State: AGRZ1gLDPIsfJ53oLeYOW3lS3uxnqbOM2iKc1UU2MU4F9s0XjpIFB8qD 3pPGlY3wwRsYoTTlQj9Zey46AidG+NUsPtU4nrZw4cQsEe3lb0GlLCU2CjNgxej7Xs0A7dtajdP PA82Yt3NGb/n/GfI64PV8rF8pxsbp1QGkJfDjEtsfxxGvI19Nrfywhjhy/ViPblss3t5L6mWmdk yusg61HCLGZNXEJ6I0QoL0T1JUqua2sRX7nER4CmEMLN9rPHYpOax9jNTbaV6kjWqxZxuuALlN8 +dciYFXBJaRkKS4EC5Y9wRTQeC1FZxjsOk6CbcSU3FFNgn2WU1deCdIwNAablvypuQK/wExIe3M GcgmaC/OUD46BgRZD9UcH0JCOxMy1xsXGt+Tr5FyG66DTaB2dfiEZz73rcDFf8M7rmgdEGzvpWv V X-Received: by 2002:a6b:620d:: with SMTP id f13-v6mr3870817iog.11.1542112708036; Tue, 13 Nov 2018 04:38:28 -0800 (PST) X-Received: by 2002:a6b:620d:: with SMTP id f13-v6mr3870787iog.11.1542112707118; Tue, 13 Nov 2018 04:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542112707; cv=none; d=google.com; s=arc-20160816; b=B8aX7vkQYIyw5+9PSKa8df9JMnFMasLouuAGBjvfPYaxNGYat00L+gY0S7PD62u0F8 FiVxuAo8rNHtsDTBacl3MldkQJr+n1m06ts2XLotmn+Rw6MGEN0KvL50xH+1bvT/nDl6 rsLWi7e0pMisp9IgeXAhwt1JzSTCz8EWkgc+noph+2bxSRkNHXtZBaJqQ3zg7PN9hphE KZa8odalX7TcOVaRKCR4AcLrHpjyIc9yzBlT2gtSbN7fOTFKxt+fiR7nm7fK4a2T0L3E 0dkB3kuYJc9iAaBglANQ3LfLmkffr2Wj/MFLDuDqBw2PgzVoD1J++9M69lydV3dUIM6S h7bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=qIxbFDuDorh1mkcVPN/dM3fOaLgap3ilCqw5H06HwpY=; b=CZXotBw3boKBa90iQrR3Qwt/kY4wdyG/CUc4IFKOmVRKzg3Kms/IvNK2b2xYSNjj3B 3EZ6E+Hd6M3g6jHcg2Wf5HnYhGxpl4W2GHp3CzyAhZKZGtIlcotpfv3WR90duqYohPnq wyMsMyr8kIuKFLPaG2fMudmOtoKjIsORjN1QouabSUM2MnA0jj9twi5i1QffD+eZxnd/ BxCKRPgWrsXozlGlhVt5rZ1Xplm55AF3GCa/TYSS1o7bAIbsivhiGeVpCYpFxOmgeFXp +x8pCATSjhb4TSG7I7bYrVSbVJOFH56UhY3jzZbzJiM7xUT72RxnR9HuzMA5kF/a4yMq Rimg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WuFicoma; spf=pass (google.com: domain of nic.wuyk@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nic.wuyk@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id j79sor16032507jad.11.2018.11.13.04.38.26 for (Google Transport Security); Tue, 13 Nov 2018 04:38:27 -0800 (PST) Received-SPF: pass (google.com: domain of nic.wuyk@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WuFicoma; spf=pass (google.com: domain of nic.wuyk@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nic.wuyk@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=qIxbFDuDorh1mkcVPN/dM3fOaLgap3ilCqw5H06HwpY=; b=WuFicomaYWfk6jgesOmWmUNLsK05gCT+cTSCRbaJdA7jtTlBstVW/QYvl4Y2PNMBH4 Gvj261Idn4VjDTTSMEyHVr4ATYa1TJ0e/iTO9YxAdgCRson9m4Y0KRM93KjLqgylGMWm x2GsDkztyhuIvD6aXu/r4Saec2wOFf6OEQWqI3DK4ApShStOvjz3hlCni5GHrRd6F87q oNKnzuNkEwK7aG70xneN/9P2VDZO3B8QN7IImRdK2gCdXqK/nViq1DMDyVDEAP6NtiJ9 E7x6d2EA5I3gaRAGGlOZ/QFK3q3HoHQQJrMljmxxSCvTOCmjAM6t6RJxAW/mMoPOouFk tmow== X-Google-Smtp-Source: AJdET5csZ//1KHeHaZveJfWQapPHRjOOtBN80Vx6g0dZQFI6znwwc1Y//faDVCXY2yFbTk3/UJCzJCpNfDcb8Vv9MsI= X-Received: by 2002:a02:2b29:: with SMTP id h41-v6mr4266081jaa.12.1542112706799; Tue, 13 Nov 2018 04:38:26 -0800 (PST) MIME-Version: 1.0 From: Yongkai Wu Date: Tue, 13 Nov 2018 20:38:16 +0800 Message-ID: Subject: [PATCH] mm/hugetl.c: keep the page mapping info when free_huge_page() hit the VM_BUG_ON_PAGE To: mike.kravetz@oracle.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP It is better to keep page mapping info when free_huge_page() hit the VM_BUG_ON_PAGE, so we can get more infomation from the coredump for further analysis. Signed-off-by: Yongkai Wu Acked-by: Michal Hocko --- mm/hugetlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c007fb5..ba693bb 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1248,10 +1248,11 @@ void free_huge_page(struct page *page) (struct hugepage_subpool *)page_private(page); bool restore_reserve; + VM_BUG_ON_PAGE(page_count(page), page); + VM_BUG_ON_PAGE(page_mapcount(page), page); + set_page_private(page, 0); page->mapping = NULL; - VM_BUG_ON_PAGE(page_count(page), page); - VM_BUG_ON_PAGE(page_mapcount(page), page); restore_reserve = PagePrivate(page); ClearPagePrivate(page);