From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932807AbcJLKh3 (ORCPT ); Wed, 12 Oct 2016 06:37:29 -0400 Received: from smtprelay0119.hostedemail.com ([216.40.44.119]:42287 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932615AbcJLKhV (ORCPT ); Wed, 12 Oct 2016 06:37:21 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:541:599:800:901:960:966:967:973:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2194:2196:2198:2199:2200:2201:2393:2525:2560:2563:2682:2685:2691:2693:2731:2828:2859:2898:2899:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3865:3867:3868:3870:3871:3872:3873:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:4605:5007:6117:6691:7903:8599:9025:10004:10394:10400:10450:10455:10848:10913:11026:11232:11473:11658:11914:12043:12050:12296:12438:12555:12696:12737:12740:12760:12783:13071:13161:13229:13439:14180:14181:14659:14721:14849:19904:19999:21060:21080:21220:21433:21451:30012:30029:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: edge43_5d1c0bb8a2419 X-Filterd-Recvd-Size: 3974 Message-ID: <1476268638.16823.5.camel@perches.com> Subject: Re: [PATCH] mm: page_alloc: Use KERN_CONT where appropriate From: Joe Perches To: Michal Hocko Cc: linux-mm , LKML Date: Wed, 12 Oct 2016 03:37:18 -0700 In-Reply-To: <20161012091013.GB9523@dhcp22.suse.cz> References: <20161012091013.GB9523@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.0-2ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (resending as lkml bounced) On Wed, 2016-10-12 at 11:10 +0200, Michal Hocko wrote: > On Tue 11-10-16 19:24:55, Joe Perches wrote: > > Recent changes to printk require KERN_CONT uses to continue logging > > messages. So add KERN_CONT where necessary. > > > > I was really wondering what happened when Aaron reported an allocation > failure http://lkml.kernel.org/r/20161012065423.GA16092@aaronlu.sh.intel.com > See the attached log got the current Linus' tree > > Fixes: 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines") > > Signed-off-by: Joe Perches > > > > Acked-by: Michal Hocko > > I believe we can simplify the code a bit as well. What do you think > about the following on top? Hi Michal I think the show_node to show_zone_node renaming is superfluous, but if it makes you happy, it doesn't bother me. This recent change to printk logging making KERN_CONT necessary to continue a line might be reverted when it's better known just how many instances in the kernel tree will need to be changed. For now, I'd rather keep the KERN_CONT "\n" and trailing "\n" as there are _very_ few missing newlines in logging messages today and removing them now might be a bit early process-wise. Dunno. > --- > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 6f8c356140a0..7e1b74ee79cb 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -4078,10 +4078,12 @@ unsigned long nr_free_pagecache_pages(void) > return nr_free_zone_pages(gfp_zone(GFP_HIGHUSER_MOVABLE)); > } > > -static inline void show_node(struct zone *zone) > +static inline void show_zone_node(struct zone *zone) > { > if (IS_ENABLED(CONFIG_NUMA)) > - printk("Node %d ", zone_to_nid(zone)); > + printk("Node %d %s", zone_to_nid(zone), zone->name); > + else > + printk("%s: ", zone->name); > } > > long si_mem_available(void) > @@ -4329,9 +4331,8 @@ void show_free_areas(unsigned int filter) > for_each_online_cpu(cpu) > free_pcp += per_cpu_ptr(zone->pageset, cpu)->pcp.count; > > - show_node(zone); > + show_zone_node(zone); > printk(KERN_CONT > - "%s" > " free:%lukB" > " min:%lukB" > " low:%lukB" > @@ -4354,7 +4355,6 @@ void show_free_areas(unsigned int filter) > " local_pcp:%ukB" > " free_cma:%lukB" > "\n", > - zone->name, > K(zone_page_state(zone, NR_FREE_PAGES)), > K(min_wmark_pages(zone)), > K(low_wmark_pages(zone)), > @@ -4379,7 +4379,6 @@ void show_free_areas(unsigned int filter) > printk("lowmem_reserve[]:"); > for (i = 0; i < MAX_NR_ZONES; i++) > printk(KERN_CONT " %ld", zone->lowmem_reserve[i]); > - printk(KERN_CONT "\n"); > } > > for_each_populated_zone(zone) { > @@ -4389,8 +4388,7 @@ void show_free_areas(unsigned int filter) > > if (skip_free_areas_node(filter, zone_to_nid(zone))) > continue; > - show_node(zone); > - printk(KERN_CONT "%s: ", zone->name); > + show_zone_node(zone); > > spin_lock_irqsave(&zone->lock, flags); > for (order = 0; order < MAX_ORDER; order++) {