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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150325235603.GA14825@hori1.linux.bs1.fc.nec.co.jp>
Date:	Wed, 25 Mar 2015 23:56:03 +0000
From:	Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To:	David Rientjes <rientjes@...gle.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>,
	Tony Luck <tony.luck@...el.com>,
	Xie XiuQi <xiexiuqi@...wei.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Chen Gong <gong.chen@...ux.intel.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH] mm/memory-failure.c: define page types for
 action_result() in one place

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@...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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ