lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Mar 2017 11:37:56 -0700
From:   Joe Perches <joe@...ches.com>
To:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening
 printks

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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ