Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602207

Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks
Date 2017-03-16 12:40 +0100
Message-ID <tlBV7-62w-1@gated-at.bofh.it> (permalink)
References <tlsI9-7Ou-3@gated-at.bofh.it> <tlsI9-7Ou-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

just a notice. up to MM people to decide.

	-ss

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] mm: page_alloc: Object code reductions and logging fix Joe Perches <joe@perches.com> - 2017-03-16 02:50 +0100
  [PATCH 2/3] mm: page_alloc: Fix misordered logging output, reduce code size Joe Perches <joe@perches.com> - 2017-03-16 02:50 +0100
    Re: [PATCH 2/3] mm: page_alloc: Fix misordered logging output,  reduce code size Michal Hocko <mhocko@kernel.org> - 2017-03-16 12:00 +0100
  [PATCH 1/3] mm: page_alloc: Reduce object size by neatening printks Joe Perches <joe@perches.com> - 2017-03-16 02:50 +0100
    Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Michal Hocko <mhocko@kernel.org> - 2017-03-16 12:00 +0100
      Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Joe Perches <joe@perches.com> - 2017-03-16 21:40 +0100
        Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Michal Hocko <mhocko@kernel.org> - 2017-03-17 08:40 +0100
    Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-03-16 12:40 +0100
      Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Joe Perches <joe@perches.com> - 2017-03-16 19:40 +0100
        Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Andrew Morton <akpm@linux-foundation.org> - 2017-03-17 00:00 +0100
        Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2017-03-17 03:10 +0100
          Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Joe Perches <joe@perches.com> - 2017-03-18 20:40 +0100
            Re: [PATCH 1/3] mm: page_alloc: Reduce object size by neatening  printks Petr Mladek <pmladek@suse.com> - 2017-03-20 14:30 +0100

csiph-web