Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp4443229img; Tue, 26 Mar 2019 09:29:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVcQvxCAY03UmmU6pfZ8U1KQWGBdZgSUqPJsvWBB7Jb3L8Vuzld9bTyQJph+A/GARTGNaj X-Received: by 2002:a17:902:ba85:: with SMTP id k5mr13755001pls.270.1553617742973; Tue, 26 Mar 2019 09:29:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553617742; cv=none; d=google.com; s=arc-20160816; b=0sVVXO75WPcS0ZJz5lFQB2HZsN+Qvn+Shs9wsL0LiKlzVTu0H1ZKnBvzjFpAwm1jWD N8pYNQpwI/y2EmG/ulK8/zktoo4DKAg2belok414mzJOjA+zfNOAF0uoS9qbbM8cT9xd 49qHZ0GXsSQRbgTG1EJfE1CJDKVn3MTJY8AeXRms4jCBuGNTkmV4Czl3Lujza4vpMr3L QsJ8I4+XWVWlH+ZeFfpKZrB1OTPz3+mXVrne7GMZg9spGypZJn81LQfSYbA08bks5G42 ytUVH6R1aFQpKBaJ0fDyTUHvYMdwwcTcuf9nSqfVcJcoWB+3w35ZR/hUCkCnNsq7AvnD 3eHg== 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=k8ovjfg/NnI5M+fBoDD3CUV2CdaF+gZ6sQF6wrUx2kTI9CxTjumafa37jTHRI7SA4Y j5mxLZvBNAeQBdvLMbpZ9ljVwJw93J3vXOIhhTCI1Z5xF6bzdhRM53KnGTWX9P5nY9Ur KdGYgLt59fuDCs+coRk0mELJN+mZK4L7UmXgr1/VXpGhOqdd1JF3b4fxE5mX6Qpmky45 6KU7jgRnkU+sGA/oYwCPY295ZnBUh2hanmxhtFNL5zChmaSi3zTkyOegMeq93sIyeDCK XJdr2hBIuE7B/Awy0HFm4s99vX608dubHvfpbAOBSxfq1k9KoIeVyPFzmZlJljV8Ke6o krPw== 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 31si18082512plc.190.2019.03.26.09.28.47; Tue, 26 Mar 2019 09:29:02 -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 S1732328AbfCZQ13 (ORCPT + 99 others); Tue, 26 Mar 2019 12:27:29 -0400 Received: from foss.arm.com ([217.140.101.70]:39972 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbfCZQ12 (ORCPT ); Tue, 26 Mar 2019 12:27:28 -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 4B9FD169E; Tue, 26 Mar 2019 09:27:27 -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 0B9103F614; Tue, 26 Mar 2019 09:27:23 -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" Subject: [PATCH v6 14/19] x86: mm: Don't display pages which aren't present in debugfs Date: Tue, 26 Mar 2019 16:26:19 +0000 Message-Id: <20190326162624.20736-15-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190326162624.20736-1-steven.price@arm.com> References: <20190326162624.20736-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