From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 544CAC35242 for ; Wed, 12 Feb 2020 02:10:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19A152073C for ; Wed, 12 Feb 2020 02:10:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="KPfg4MOb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19A152073C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B36776B038B; Tue, 11 Feb 2020 21:10:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE76D6B038D; Tue, 11 Feb 2020 21:10:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D5556B038E; Tue, 11 Feb 2020 21:10:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 821916B038B for ; Tue, 11 Feb 2020 21:10:55 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1C030181AC9B6 for ; Wed, 12 Feb 2020 02:10:55 +0000 (UTC) X-FDA: 76479846870.21.game51_41f695b2f0063 X-HE-Tag: game51_41f695b2f0063 X-Filterd-Recvd-Size: 5860 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Feb 2020 02:10:53 +0000 (UTC) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 11 Feb 2020 18:09:47 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 11 Feb 2020 18:10:51 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 11 Feb 2020 18:10:51 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 12 Feb 2020 02:10:51 +0000 Subject: Re: [PATCH v6 12/12] mm: dump_page(): additional diagnostics for huge pinned pages To: "Kirill A. Shutemov" CC: Andrew Morton , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Ira Weiny , Jan Kara , Jason Gunthorpe , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka , Matthew Wilcox , , , , , , LKML , "Kirill A . Shutemov" References: <20200211001536.1027652-1-jhubbard@nvidia.com> <20200211001536.1027652-13-jhubbard@nvidia.com> <20200211132159.pii2x5pssifemgaz@box> From: John Hubbard X-Nvconfidentiality: public Message-ID: <909f4ad5-128f-b4bd-e4cb-787885167a97@nvidia.com> Date: Tue, 11 Feb 2020 18:10:50 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200211132159.pii2x5pssifemgaz@box> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1581473388; bh=zCZhatfwPo+VLNp+cEurTVm8c4ASNzi1xPIVnn9hsG4=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=KPfg4MObEIiKHoeHFaJJrWQ8njdIGT3atUWt2b4jjTApxYejTmazQdE0YwMrBuFKU 3i/G5o9jjd6ioP0Qi2W/rUjSr00msSRFXATO/5rNEQ7DmoOJMKI37ZOJVs8SZHCmVU blSLD+y8cV0ai0JTOpf3gRqP3613aMkN7Wiqb69HyX0DDCJPPKFj/TYL7jfNr87yWY q37kkzihJidOZqNjw1XmMcIbjHjswPB2bRGry8NZkq9bXL4NReTx1MJk/Z1MLjIDdG YKIMBb2eV93ApkPqaCI7R9IFDMlf3cKAs3qmM6FxY0PkH5G8/SVcHRa8M4LKHCtWB+ EblOFHEBRSltw== 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: On 2/11/20 5:21 AM, Kirill A. Shutemov wrote: ... >> diff --git a/mm/debug.c b/mm/debug.c >> index f5ffb0784559..2189357f0987 100644 >> --- a/mm/debug.c >> +++ b/mm/debug.c >> @@ -85,11 +85,22 @@ void __dump_page(struct page *page, const char *reason) >> mapcount = PageSlab(head) ? 0 : page_mapcount(page); >> >> if (compound) >> - pr_warn("page:%px refcount:%d mapcount:%d mapping:%p " >> - "index:%#lx head:%px order:%u compound_mapcount:%d\n", >> - page, page_ref_count(head), mapcount, >> - mapping, page_to_pgoff(page), head, >> - compound_order(head), compound_mapcount(page)); >> + if (hpage_pincount_available(page)) { >> + pr_warn("page:%px refcount:%d mapcount:%d mapping:%p " >> + "index:%#lx head:%px order:%u " >> + "compound_mapcount:%d compound_pincount:%d\n", >> + page, page_ref_count(head), mapcount, >> + mapping, page_to_pgoff(page), head, >> + compound_order(head), compound_mapcount(page), >> + compound_pincount(page)); >> + } else { >> + pr_warn("page:%px refcount:%d mapcount:%d mapping:%p " >> + "index:%#lx head:%px order:%u " >> + "compound_mapcount:%d\n", >> + page, page_ref_count(head), mapcount, >> + mapping, page_to_pgoff(page), head, >> + compound_order(head), compound_mapcount(page)); >> + } > > Have you considered using pr_cont() here. I guess it would be easier to > read. Yes, and it does have the advantage of removing some of the code duplication above. On the other hand, though, it leaves the end result (the long lines being printed) the same, and introduces a window in which the output can get garbled by another thread that is printk'-ing. And actually, what I'd really like is to shorten the printed output lines, as I mentioned in [1]. So overall, given that this series has been fairly difficult to get finalized, and it's now in Andrew's tree at last, I'd *really* like to leave it as-is right now, and build on top of it. So I will submit a follow-on patch to formally propose shortening the printed lines, and that can live or die independently of this series, which is hopefully over now. > > You can use my Ack anyway. Thanks, and I appreciate all of your reviews and bug spotting and ideas for improvements on this series, it's been really helpful. > > >> else >> pr_warn("page:%px refcount:%d mapcount:%d mapping:%p index:%#lx\n", >> page, page_ref_count(page), mapcount, >> -- >> 2.25.0 >> > [1] https://lore.kernel.org/r/96e1f693-0e7b-2817-f13d-1946ff7654a1@nvidia.com thanks, -- John Hubbard NVIDIA