From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f72.google.com (mail-it0-f72.google.com [209.85.214.72]) by kanga.kvack.org (Postfix) with ESMTP id C6A0E6B0389 for ; Thu, 16 Mar 2017 14:38:04 -0400 (EDT) Received: by mail-it0-f72.google.com with SMTP id y18so63757692itc.5 for ; Thu, 16 Mar 2017 11:38:04 -0700 (PDT) Received: from smtprelay.hostedemail.com (smtprelay0163.hostedemail.com. [216.40.44.163]) by mx.google.com with ESMTPS id j90si6935061ioi.119.2017.03.16.11.38.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Mar 2017 11:38:03 -0700 (PDT) Message-ID: <1489689476.13953.3.camel@perches.com> Subject: Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks From: Joe Perches Date: Thu, 16 Mar 2017 11:37:56 -0700 In-Reply-To: <20170316113056.GG464@jagdpanzerIV.localdomain> References: <880b3172b67d806082284d80945e4a231a5574bb.1489628459.git.joe@perches.com> <20170316113056.GG464@jagdpanzerIV.localdomain> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Thu, 2017-03-16 at 20:30 +0900, Sergey Senozhatsky wrote: > On (03/15/17 18:43), Joe Perches wrote: > [..] > > - printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n" > > - " active_file:%lu inactive_file:%lu isolated_file:%lu\n" > > - " unevictable:%lu dirty:%lu writeback:%lu unstable:%lu\n" > > - " slab_reclaimable:%lu slab_unreclaimable:%lu\n" > > - " mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n" > > - " free:%lu free_pcp:%lu free_cma:%lu\n", > > - global_node_page_state(NR_ACTIVE_ANON), > > - global_node_page_state(NR_INACTIVE_ANON), > > - global_node_page_state(NR_ISOLATED_ANON), > > - global_node_page_state(NR_ACTIVE_FILE), > > - global_node_page_state(NR_INACTIVE_FILE), > > - global_node_page_state(NR_ISOLATED_FILE), > > - global_node_page_state(NR_UNEVICTABLE), > > - global_node_page_state(NR_FILE_DIRTY), > > - global_node_page_state(NR_WRITEBACK), > > - global_node_page_state(NR_UNSTABLE_NFS), > > - global_page_state(NR_SLAB_RECLAIMABLE), > > - global_page_state(NR_SLAB_UNRECLAIMABLE), > > - global_node_page_state(NR_FILE_MAPPED), > > - global_node_page_state(NR_SHMEM), > > - global_page_state(NR_PAGETABLE), > > - global_page_state(NR_BOUNCE), > > - global_page_state(NR_FREE_PAGES), > > - free_pcp, > > - global_page_state(NR_FREE_CMA_PAGES)); > > + printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n", > > + global_node_page_state(NR_ACTIVE_ANON), > > + global_node_page_state(NR_INACTIVE_ANON), > > + global_node_page_state(NR_ISOLATED_ANON)); > > + printk("active_file:%lu inactive_file:%lu isolated_file:%lu\n", > > + global_node_page_state(NR_ACTIVE_FILE), > > + global_node_page_state(NR_INACTIVE_FILE), > > + global_node_page_state(NR_ISOLATED_FILE)); > > + printk("unevictable:%lu dirty:%lu writeback:%lu unstable:%lu\n", > > + global_node_page_state(NR_UNEVICTABLE), > > + global_node_page_state(NR_FILE_DIRTY), > > + global_node_page_state(NR_WRITEBACK), > > + global_node_page_state(NR_UNSTABLE_NFS)); > > + printk("slab_reclaimable:%lu slab_unreclaimable:%lu\n", > > + global_page_state(NR_SLAB_RECLAIMABLE), > > + global_page_state(NR_SLAB_UNRECLAIMABLE)); > > + printk("mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n", > > + global_node_page_state(NR_FILE_MAPPED), > > + global_node_page_state(NR_SHMEM), > > + global_page_state(NR_PAGETABLE), > > + global_page_state(NR_BOUNCE)); > > + printk("free:%lu free_pcp:%lu free_cma:%lu\n", > > + global_page_state(NR_FREE_PAGES), > > + free_pcp, > > + global_page_state(NR_FREE_CMA_PAGES)); > > a side note: > > this can make it harder to read, in _the worst case_. one printk() > guaranteed that we would see a single line in the serial log/etc. > the sort of a problem with multiple printks is that printks coming > from other CPUs will split that "previously single" line. Not true. Note the multiple \n uses in the original code. > just a notice. up to MM people to decide. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdCPSiM (ORCPT ); Thu, 16 Mar 2017 14:38:12 -0400 Received: from smtprelay0045.hostedemail.com ([216.40.44.45]:55082 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751954AbdCPSiL (ORCPT ); Thu, 16 Mar 2017 14:38:11 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:421:541:599:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3870:3871:3872:3874:4250:4321:4385:4605:5007:6691:7653:7901:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12043:12438:12740:12760:12895:13439:14659:14721:19904:19999:21067:21080:30012:30054:30056: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: back70_45f9ec70e8854 X-Filterd-Recvd-Size: 4089 Message-ID: <1489689476.13953.3.camel@perches.com> Subject: Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks From: Joe Perches To: Sergey Senozhatsky Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Thu, 16 Mar 2017 11:37:56 -0700 In-Reply-To: <20170316113056.GG464@jagdpanzerIV.localdomain> References: <880b3172b67d806082284d80945e4a231a5574bb.1489628459.git.joe@perches.com> <20170316113056.GG464@jagdpanzerIV.localdomain> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 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 On Thu, 2017-03-16 at 20:30 +0900, Sergey Senozhatsky wrote: > On (03/15/17 18:43), Joe Perches wrote: > [..] > > - printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n" > > - " active_file:%lu inactive_file:%lu isolated_file:%lu\n" > > - " unevictable:%lu dirty:%lu writeback:%lu unstable:%lu\n" > > - " slab_reclaimable:%lu slab_unreclaimable:%lu\n" > > - " mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n" > > - " free:%lu free_pcp:%lu free_cma:%lu\n", > > - global_node_page_state(NR_ACTIVE_ANON), > > - global_node_page_state(NR_INACTIVE_ANON), > > - global_node_page_state(NR_ISOLATED_ANON), > > - global_node_page_state(NR_ACTIVE_FILE), > > - global_node_page_state(NR_INACTIVE_FILE), > > - global_node_page_state(NR_ISOLATED_FILE), > > - global_node_page_state(NR_UNEVICTABLE), > > - global_node_page_state(NR_FILE_DIRTY), > > - global_node_page_state(NR_WRITEBACK), > > - global_node_page_state(NR_UNSTABLE_NFS), > > - global_page_state(NR_SLAB_RECLAIMABLE), > > - global_page_state(NR_SLAB_UNRECLAIMABLE), > > - global_node_page_state(NR_FILE_MAPPED), > > - global_node_page_state(NR_SHMEM), > > - global_page_state(NR_PAGETABLE), > > - global_page_state(NR_BOUNCE), > > - global_page_state(NR_FREE_PAGES), > > - free_pcp, > > - global_page_state(NR_FREE_CMA_PAGES)); > > + printk("active_anon:%lu inactive_anon:%lu isolated_anon:%lu\n", > > + global_node_page_state(NR_ACTIVE_ANON), > > + global_node_page_state(NR_INACTIVE_ANON), > > + global_node_page_state(NR_ISOLATED_ANON)); > > + printk("active_file:%lu inactive_file:%lu isolated_file:%lu\n", > > + global_node_page_state(NR_ACTIVE_FILE), > > + global_node_page_state(NR_INACTIVE_FILE), > > + global_node_page_state(NR_ISOLATED_FILE)); > > + printk("unevictable:%lu dirty:%lu writeback:%lu unstable:%lu\n", > > + global_node_page_state(NR_UNEVICTABLE), > > + global_node_page_state(NR_FILE_DIRTY), > > + global_node_page_state(NR_WRITEBACK), > > + global_node_page_state(NR_UNSTABLE_NFS)); > > + printk("slab_reclaimable:%lu slab_unreclaimable:%lu\n", > > + global_page_state(NR_SLAB_RECLAIMABLE), > > + global_page_state(NR_SLAB_UNRECLAIMABLE)); > > + printk("mapped:%lu shmem:%lu pagetables:%lu bounce:%lu\n", > > + global_node_page_state(NR_FILE_MAPPED), > > + global_node_page_state(NR_SHMEM), > > + global_page_state(NR_PAGETABLE), > > + global_page_state(NR_BOUNCE)); > > + printk("free:%lu free_pcp:%lu free_cma:%lu\n", > > + global_page_state(NR_FREE_PAGES), > > + free_pcp, > > + global_page_state(NR_FREE_CMA_PAGES)); > > a side note: > > this can make it harder to read, in _the worst case_. one printk() > guaranteed that we would see a single line in the serial log/etc. > the sort of a problem with multiple printks is that printks coming > from other CPUs will split that "previously single" line. Not true. Note the multiple \n uses in the original code. > just a notice. up to MM people to decide.