Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp207387yba; Wed, 3 Apr 2019 07:19:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/6oTcvZvgGQd2pFp7QYtYk4hMGFFbLHEfyrbQeUH1WA4yC18OEsXy9Tnms/LbJozu2VJf X-Received: by 2002:a62:565c:: with SMTP id k89mr75296004pfb.175.1554301173854; Wed, 03 Apr 2019 07:19:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554301173; cv=none; d=google.com; s=arc-20160816; b=C0VmXDQ1aSj3esIzeNdiuNAKRIsHbNpM2f0tWbg64iVuyA0NNQIZnJnYU516jb29rY jE4G/ml7CeTcV296GHnR5JOHUs5gXUbwvhbUD/vLjcTrNZfsfgAzyDvCiKY+0Bq9LnKR zGXOYt3WemklvRdoX94aduHSfopXPYmVtuOZiMHlI+fuo4vXWR1e4hNXET95oQQhD0rR K1+gWgdi01Od+wRT4ocvpJiUQmF8ascqLh/TEg/qLZ6SBQwF1vB9lx1+PA3eJd+EtLbg vQy/hBgg/lT0Bcen+OZDl1W5Qon5hquUpGoZHYnjPWyRnMYPSRTXiFrP+wmSAKvregQJ lPXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VefPUADSnZrha76TxVHSwbw6LrT1e+Tmwp23y0+XUXU=; b=olJb0kOsqIXErjwUBI7uuVQOjaIjPC1RV7xxl1S3dhQ9EVdaBftOvht4KTp1VEftfy pGt8hKCiBbTx4s9WQ/MzH4x99wLzRmwtYEHL+TlXmEKwdnF1Mg6/zsCgCYzKlEQ3V61n hp4a7R84IqhArV/wsMpjzJmq1QRNrc41uOauElx1KPqiPSP+VUi4Rg3v6EWlK5vDCKWB yl6Wt+UdD/QJW7AjzIMJsUWqTA6UeFWV0JSndU43jC3L3PhbzNoT3GJe0RXp+iP6pkwJ NlEcdT8+6k8rhebxo8/G7jJgEyB+Ne3CNWp8WylYnd7XbckkKvVInop7eUFDUBDJzZdq L9Og== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g74si13973941pfd.221.2019.04.03.07.19.18; Wed, 03 Apr 2019 07:19:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbfDCOSM (ORCPT + 99 others); Wed, 3 Apr 2019 10:18:12 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:41908 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfDCOSK (ORCPT ); Wed, 3 Apr 2019 10:18:10 -0400 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 C93351684; Wed, 3 Apr 2019 07:18:09 -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 6A25C3F68F; Wed, 3 Apr 2019 07:18:06 -0700 (PDT) From: Steven Price To: linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" , Andrew Morton Subject: [PATCH v8 15/20] x86: mm: Don't display pages which aren't present in debugfs Date: Wed, 3 Apr 2019 15:16:22 +0100 Message-Id: <20190403141627.11664-16-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403141627.11664-1-steven.price@arm.com> References: <20190403141627.11664-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, -- 2.20.1