From patchwork Thu Mar 21 14:19:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 10863835 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 0B8C115AC for ; Thu, 21 Mar 2019 15:31:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB12628CE1 for ; Thu, 21 Mar 2019 15:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC8202A1A0; Thu, 21 Mar 2019 15:31:19 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7850428CE1 for ; Thu, 21 Mar 2019 15:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BnFdb/6yCoYhIdwXROZS6wvIpuQ18YVe6MQtawP5RF8=; b=M4XBLk3EhUqagf WANPIQ0azGQB/zYTTTFuMQEOIwagWr6SY/3lC7ajt/qbQt7SJekEmGbPzB/+2bWU9f8sqrwgmEtBY UTzfierOO1Xo9ukNAnmPlrf6SS23VxSI11FlvUQC4vdlBIrWxFd29gp1eDWbPCUUr4iUCOpI6OPTD r4x7/jw8bMIjYJtCuTfTXCJ011MnuL6qdnYmo3Yx7ghqMsAQDu4drhZAhIVzguhKESTIYjugRcIBo 1wIWlEZrgKuQxqH89D+DecShIClR4Y3tGKjyatT0+Rl63ezgwQgoWlbKbUxY/LLnX0q84htLeIUhY 3lM+4UQDYum/d95KT8fQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6zey-0002NC-F3; Thu, 21 Mar 2019 15:31:12 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6zek-000250-QW for linux-arm-kernel@bombadil.infradead.org; Thu, 21 Mar 2019 15:30:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VefPUADSnZrha76TxVHSwbw6LrT1e+Tmwp23y0+XUXU=; b=0+8KbpDuJF4MPorvr0/Ql04qJK TabrSIhe9fgxJBOOfsEDHnDe6G3T1xSSKa45D8K4JAa1qALbEKzlfVh+KmkbEge9O317Stfx2GOWq MnXNb3bp2VrMusVac6jXgUzXLzZSULTUtGzdeMSct1m2rLsUEJCzQwC+0TzOY3XOT91qarB3Y42Qv Vkd1swqxJ0xZyOorLKg+ARmNKK7hcIdSfWCIoa66Fj7nwCRJwuPO+rMjUM+pw7YYYgQlthsc4LI5r cXxu01MdIeNQ2XVP3L4sGmOxc4asFHdZgy2RSVu+dwyXtHYxfCY+ULWNv9GvIcbBv3e3AedQFVtQd 61w/f16A==; Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by merlin.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6yYz-00035Q-Tw for linux-arm-kernel@lists.infradead.org; Thu, 21 Mar 2019 14:20:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C274880D; Thu, 21 Mar 2019 07:20:57 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 85B413F575; Thu, 21 Mar 2019 07:20:54 -0700 (PDT) From: Steven Price To: linux-mm@kvack.org Subject: [PATCH v5 14/19] x86: mm: Don't display pages which aren't present in debugfs Date: Thu, 21 Mar 2019 14:19:48 +0000 Message-Id: <20190321141953.31960-15-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190321141953.31960-1-steven.price@arm.com> References: <20190321141953.31960-1-steven.price@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190321_102058_117639_58992A52 X-CRM114-Status: GOOD ( 15.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , x86@kernel.org, Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Dave Hansen , Will Deacon , linux-kernel@vger.kernel.org, Steven Price , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, "Liang, Kan" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP For the /sys/kernel/debug/page_tables/ files, rather than outputing a mostly empty line when a block of memory isn't present just skip the line. This keeps the output shorter and will help with a future change switching to using the generic page walk code as we no longer care about the 'level' that the page table holes are at. Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index ca270fb00805..e2b53db92c34 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -304,8 +304,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, /* * Now print the actual finished series */ - if (!st->marker->max_lines || - st->lines < st->marker->max_lines) { + if ((cur & _PAGE_PRESENT) && (!st->marker->max_lines || + st->lines < st->marker->max_lines)) { pt_dump_seq_printf(m, st->to_dmesg, "0x%0*lx-0x%0*lx ", width, st->start_address, @@ -321,7 +321,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, printk_prot(m, st->current_prot, st->level, st->to_dmesg); } - st->lines++; + if (cur & _PAGE_PRESENT) + st->lines++; /* * We print markers for special areas of address space,