linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, Tony Luck <tony.luck@intel.com>,
	Xie XiuQi <xiexiuqi@huawei.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Chen Gong <gong.chen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>
Subject: Re: [PATCH] mm/memory-failure.c: define page types for action_result() in one place
Date: Wed, 25 Mar 2015 23:56:03 +0000	[thread overview]
Message-ID: <20150325235603.GA14825@hori1.linux.bs1.fc.nec.co.jp> (raw)
In-Reply-To: <alpine.DEB.2.10.1503242058300.20696@chino.kir.corp.google.com>

On Tue, Mar 24, 2015 at 09:02:13PM -0700, David Rientjes wrote:
> On Thu, 19 Mar 2015, Naoya Horiguchi wrote:
> 
> > This cleanup patch moves all strings passed to action_result() into a single
> > array action_page_type so that a reader can easily find which kind of action
> > results are possible. And this patch also fixes the odd lines to be printed
> > out, like "unknown page state page" or "free buddy, 2nd try page".
> > 
> > Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
> > ---
> >  mm/memory-failure.c | 107 +++++++++++++++++++++++++++++++++++++---------------
> >  1 file changed, 76 insertions(+), 31 deletions(-)
> > 
> > diff --git v3.19.orig/mm/memory-failure.c v3.19/mm/memory-failure.c
> > index d487f8dc6d39..afb740e1c8b0 100644
> > --- v3.19.orig/mm/memory-failure.c
> > +++ v3.19/mm/memory-failure.c
> > @@ -521,6 +521,52 @@ static const char *action_name[] = {
> >  	[RECOVERED] = "Recovered",
> >  };
> >  
> > +enum page_type {
> > +	KERNEL,
> > +	KERNEL_HIGH_ORDER,
> > +	SLAB,
> > +	DIFFERENT_COMPOUND,
> > +	POISONED_HUGE,
> > +	HUGE,
> > +	FREE_HUGE,
> > +	UNMAP_FAILED,
> > +	DIRTY_SWAPCACHE,
> > +	CLEAN_SWAPCACHE,
> > +	DIRTY_MLOCKED_LRU,
> > +	CLEAN_MLOCKED_LRU,
> > +	DIRTY_UNEVICTABLE_LRU,
> > +	CLEAN_UNEVICTABLE_LRU,
> > +	DIRTY_LRU,
> > +	CLEAN_LRU,
> > +	TRUNCATED_LRU,
> > +	BUDDY,
> > +	BUDDY_2ND,
> > +	UNKNOWN,
> > +};
> > +
> 
> I like the patch because of the consistency in output and think it's worth 
> the extra 1% .text size.
> 
> My only concern is the generic naming of the enum members.  
> memory-failure.c is already an offender with "enum outcome" and the naming 
> of its members.
>
> Would you mind renaming these to be prefixed with "MSG_"?

no, your naming is clearer and represents better what it is, so I agree with it.

> These enums should be anonymous, too, nothing is referencing enum outcome 
> or your new enum page_type.
> 

Or the type of action_result()'s 2nd parameter can be "enum page_type".

Thanks,
Naoya Horiguchi
--
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:[~2015-03-26  0:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  6:24 Naoya Horiguchi
2015-03-19 19:26 ` Andi Kleen
2015-03-25  4:02 ` David Rientjes
2015-03-25 23:56   ` Naoya Horiguchi [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=20150325235603.GA14825@hori1.linux.bs1.fc.nec.co.jp \
    --to=n-horiguchi@ah.jp.nec.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.com \
    --cc=xiexiuqi@huawei.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