From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751625AbdHaSwD (ORCPT ); Thu, 31 Aug 2017 14:52:03 -0400 Received: from smtprelay0012.hostedemail.com ([216.40.44.12]:33528 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751237AbdHaSwC (ORCPT ); Thu, 31 Aug 2017 14:52:02 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2691:2828:2901:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3871:3874:4321:5007:6117:6119:7576:7914:9545:10004:10400:10848:10967:11026:11232:11473:11658:11783:11914:12043:12048:12262:12296:12438:12555:12679:12740:12895:12986:13095:13161:13181:13229:13439:13894:14181:14659:14721:21080:21433:21451:21611:21627:30003:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: water86_4b8a044126b3f X-Filterd-Recvd-Size: 4604 Message-ID: <1504205513.2786.43.camel@perches.com> Subject: Re: [PATCH v2] x86: use pr_cont() in dump_pagetable() From: Joe Perches To: Jan Beulich , mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com Cc: linux-kernel@vger.kernel.org Date: Thu, 31 Aug 2017 11:51:53 -0700 In-Reply-To: <59A7D72B0200007800175E4E@prv-mh.provo.novell.com> References: <59A7D72B0200007800175E4E@prv-mh.provo.novell.com> <59A7D72B0200007800175E4E@prv-mh.provo.novell.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-08-31 at 01:30 -0600, Jan Beulich wrote: > The lack of newlines in preceding format strings is a clear indication > that these were meant to be continuations of one another, and indeed > output ends up quite a bit more compact (and readable) that way. > > Switch other plain printk()-s in the function instances to pr_info(), > as requested. I think this is incorrect as the functions immediately preceding this dump_pagetable emit at KERN_ALERT and the pr_info("BAD") use pr_info incorrectly. I believe the appropriate conversion is: --- >>From f8127e18e0a466dd9a1393a4964eb9297cf39cb2 Mon Sep 17 00:00:00 2001 Message-Id: From: Joe Perches Date: Thu, 31 Aug 2017 11:48:02 -0700 Subject: [PATCH] x86: mm: fault: Use appropriate printk KERN_ output printks without KERN_CONT are emitted on separate lines. Emit the first line at KERN_ALERT and the continuations at KERN_CONT as necessary. Signed-off-by: Joe Perches ---  arch/x86/mm/fault.c | 24 ++++++++++++++----------  1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 2a1fa10c6a98..4b6125ed216e 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -396,14 +396,18 @@ static void dump_pagetable(unsigned long address)   pte_t *pte;    #ifdef CONFIG_X86_PAE - printk("*pdpt = %016Lx ", pgd_val(*pgd)); + printk(KERN_ALERT "*pdpt = %016Lx ", pgd_val(*pgd));   if (!low_pfn(pgd_val(*pgd) >> PAGE_SHIFT) || !pgd_present(*pgd))   goto out;  #endif   p4d = p4d_offset(pgd, address);   pud = pud_offset(p4d, address);   pmd = pmd_offset(pud, address); +#ifdef CONFIG_X86_PAE   printk(KERN_CONT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd)); +#else + printk(KERN_ALERT "*pde = %0*Lx ", sizeof(*pmd) * 2, (u64)pmd_val(*pmd)); +#endif     /*    * We must not directly access the pte in the highpte @@ -415,9 +419,9 @@ static void dump_pagetable(unsigned long address)   goto out;     pte = pte_offset_kernel(pmd, address); - printk("*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte)); + printk(KERN_CONT "*pte = %0*Lx ", sizeof(*pte) * 2, (u64)pte_val(*pte));  out: - printk("\n"); + printk(KERN_CONT "\n");  }    #else /* CONFIG_X86_64: */ @@ -565,7 +569,7 @@ static void dump_pagetable(unsigned long address)   if (bad_address(pgd))   goto bad;   - printk("PGD %lx ", pgd_val(*pgd)); + printk(KERN_ALERT "PGD %lx ", pgd_val(*pgd));     if (!pgd_present(*pgd))   goto out; @@ -574,7 +578,7 @@ static void dump_pagetable(unsigned long address)   if (bad_address(p4d))   goto bad;   - printk("P4D %lx ", p4d_val(*p4d)); + printk(KERN_CONT "P4D %lx ", p4d_val(*p4d));   if (!p4d_present(*p4d) || p4d_large(*p4d))   goto out;   @@ -582,7 +586,7 @@ static void dump_pagetable(unsigned long address)   if (bad_address(pud))   goto bad;   - printk("PUD %lx ", pud_val(*pud)); + printk(KERN_CONT "PUD %lx ", pud_val(*pud));   if (!pud_present(*pud) || pud_large(*pud))   goto out;   @@ -590,7 +594,7 @@ static void dump_pagetable(unsigned long address)   if (bad_address(pmd))   goto bad;   - printk("PMD %lx ", pmd_val(*pmd)); + printk(KERN_CONT "PMD %lx ", pmd_val(*pmd));   if (!pmd_present(*pmd) || pmd_large(*pmd))   goto out;   @@ -598,12 +602,12 @@ static void dump_pagetable(unsigned long address)   if (bad_address(pte))   goto bad;   - printk("PTE %lx", pte_val(*pte)); + printk(KERN_CONT "PTE %lx", pte_val(*pte));  out: - printk("\n"); + printk(KERN_CONT "\n");   return;  bad: - printk("BAD\n"); + printk(KERN_CONT "BAD\n");  }    #endif /* CONFIG_X86_64 */ --  2.10.0.rc2.1.g053435c