linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks
Date: Thu, 16 Mar 2017 11:37:56 -0700	[thread overview]
Message-ID: <1489689476.13953.3.camel@perches.com> (raw)
In-Reply-To: <20170316113056.GG464@jagdpanzerIV.localdomain>

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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-03-16 18:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  1:43 [PATCH 0/3] mm: page_alloc: Object code reductions and logging fix Joe Perches
2017-03-16  1:43 ` [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks Joe Perches
2017-03-16 10:56   ` Michal Hocko
2017-03-16 20:32     ` Joe Perches
2017-03-17  7:39       ` Michal Hocko
2017-03-16 11:30   ` Sergey Senozhatsky
2017-03-16 18:37     ` Joe Perches [this message]
2017-03-16 22:53       ` Andrew Morton
2017-03-17  1:56       ` Sergey Senozhatsky
2017-03-18 19:31         ` Joe Perches
2017-03-20 13:00           ` Petr Mladek
2017-03-16  1:43 ` [PATCH 2/3] mm: page_alloc: Fix misordered logging output, reduce code size Joe Perches
2017-03-16 10:57   ` Michal Hocko
2017-03-16  1:43 ` [PATCH 3/3] mm: page_alloc: Break up a long single-line printk Joe Perches
2017-03-16 10:58   ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489689476.13953.3.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).