Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7302290ybi; Mon, 22 Jul 2019 10:36:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0gGwT2NJY9f/4sGabfTpOKNcoiGPLVMrqWkHdQvz6/wONIJbWbiZs58IP0cVVk8m3JQ58 X-Received: by 2002:aa7:9254:: with SMTP id 20mr1405933pfp.212.1563816975390; Mon, 22 Jul 2019 10:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816975; cv=none; d=google.com; s=arc-20160816; b=F5dlsNAY6LySAX3ks1l3uNxxbg9pqdxQqMVzZHjeNjfyOCO1cUKyhGu0Vg5JNeKav2 kH+/6OakqaENTHV6vkEoix6HbGaV6tNG6KowXY53Zu0JGGupEQ/jP/5YfsgYvaRpGcID 7VhR+zh7iteYiXU7onbv1GS/AnJVnyfF7DnU5FR1MhpBUANQpQxWu3D0eKDWu7P/XFkJ H2Hgwv8RJi9g8w+pDlDOy7HZiot0U81bDtekZrKUXhek2OTGrU7jcXU1NId7nBI18wPJ 4tXKoMlM1SfxQbs4IHega4A3IC/i9Dt6bDEx68z2LATZ6yztAOY0POvI4458LPYhoQpB Gwqg== 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=x9omYML0fpa2kR4hvPDbBVUFNLXAt+KfSjpOjGilB2I=; b=cAWdWHd0lmdcwDYfSFutpwFIPjMtLNp9EA0FbNKnJH+7C+nAiQX33ktAyVIVqMTHiT 2OLGmte7k1w699bs/8bV4ka9ms1/T62f3oRTsgRsCETTk9K9IQzMdXotvnQ3+ZM+7e60 8cumjj8qLl6tT5wir6kbEucq5sSKVr9kGtwMUkGyiHeM8lrGZJ1v3YUBKeMy0oBY7Uz4 x8S06R5uT2Bg7cho5wlm+KDI6LSdgCJua0ywx8AFAyK+M/FRtVkw9zkVCBmWDKbLAbum v6sGAclr82DlgTp4SHvjS1WoAABhBv14JSFG0ZbSY+msml/kDkDJejv0y/p3e9ppVdNL isWA== 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 u9si10297145pgm.167.2019.07.22.10.35.59; Mon, 22 Jul 2019 10:36:15 -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 S1729972AbfGVPnI (ORCPT + 99 others); Mon, 22 Jul 2019 11:43:08 -0400 Received: from foss.arm.com ([217.140.110.172]:40416 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729966AbfGVPnF (ORCPT ); Mon, 22 Jul 2019 11:43:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C90AE15BF; Mon, 22 Jul 2019 08:43:04 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3192C3F694; Mon, 22 Jul 2019 08:43:02 -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 v9 14/21] x86: mm: Don't display pages which aren't present in debugfs Date: Mon, 22 Jul 2019 16:42:03 +0100 Message-Id: <20190722154210.42799-15-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190722154210.42799-1-steven.price@arm.com> References: <20190722154210.42799-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 ab67822fd2f4..95728027dd3b 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -301,8 +301,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, @@ -318,7 +318,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