LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Konstantin Khlebnikov <koct9i@gmail.com>
Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: hide per-cpu lists in output of show_mem()
Date: Tue, 24 Feb 2015 14:31:19 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1502241428250.11324@chino.kir.corp.google.com> (raw)
In-Reply-To: <CALYGNiON2d9qLjov2B-kw1FmLfdNGwPKTWBqWBpC8Nf82d5oTQ@mail.gmail.com>

On Wed, 25 Feb 2015, Konstantin Khlebnikov wrote:

> >> @@ -3220,11 +3229,10 @@ void show_free_areas(unsigned int filter)
> >>
> >>       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"
> >> -             " free:%lu slab_reclaimable:%lu slab_unreclaimable:%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_cma:%lu\n",
> >> +             " free:%lu free_pcp:%lu free_cma:%lu\n",
> >
> > Why is "free:" itself moved?  It is unlikely, but I could imagine that
> > this might break something that is parsing the kernel log and it would be
> > better to just leave it where it is and add "free_pcp:" after "free_cma:"
> > since this is extending the message.
> 
> I think it looks better at the beginning of new line, like this:
> 
> [   44.452955] Mem-Info:
> [   44.453233] active_anon:2307 inactive_anon:36 isolated_anon:0
> [   44.453233]  active_file:4120 inactive_file:4623 isolated_file:0
> [   44.453233]  unevictable:0 dirty:6 writeback:0 unstable:0
> [   44.453233]  slab_reclaimable:3500 slab_unreclaimable:7441
> [   44.453233]  mapped:2113 shmem:45 pagetables:292 bounce:0
> [   44.453233]  free:456891 free_pcp:12179 free_cma:0
> 
> In this order fields at each line have something in common.
> 
> I'll spend some some time playing with this code and oom log,
> maybe I'll try to turn whole output into table or something.
> 

The problem is that oom logs are usually parsed only from the kernel log, 
there's no other userspace trigger that we can use to identify when the 
kernel has killed something unless we wait() on every possible victim.  
It's typical for systems software to parse this information and unless 
there is a compelling reason other than "looks better", I think messages 
should only be extended rather than rearranged.

Admittedly, scraping the kernel log for oom kill events could certainly be 
done better with a userspace notification, but we currently lack that 
support in the kernel and there might be parsers out there in the wild 
that would break because of this.  I agree removing the pcp counters is 
good for this output, though, so I'd love to see that patch without this 
change.

      reply	other threads:[~2015-02-24 22:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 14:39 Konstantin Khlebnikov
2015-02-20 14:40 ` Konstantin Khlebnikov
2015-02-20 21:45 ` Andrew Morton
2015-02-23 14:37 ` Michal Hocko
2015-02-24  9:03   ` Konstantin Khlebnikov
2015-02-25 21:44     ` Andrew Morton
2015-02-26  6:14       ` [PATCH] mm: completely remove dumping per-cpu lists from show_mem() Konstantin Khlebnikov
2015-02-26 23:14         ` Dave Hansen
2015-02-24 20:41 ` [PATCH] mm: hide per-cpu lists in output of show_mem() David Rientjes
2015-02-24 22:05   ` Konstantin Khlebnikov
2015-02-24 22:31     ` David Rientjes [this message]

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=alpine.DEB.2.10.1502241428250.11324@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=koct9i@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --subject='Re: [PATCH] mm: hide per-cpu lists in output of show_mem()' \
    /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

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).