Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 03:38:41PM +0800, Fengguang Wu wrote: > On Wed, Sep 26, 2012 at 02:06:08AM -0400, Naoya Horiguchi wrote: > > On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: > > ... > > > > > + * page is a thp, not a non-huge compound page. > > > > > + */ > > > >

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Fengguang Wu
On Wed, Sep 26, 2012 at 02:06:08AM -0400, Naoya Horiguchi wrote: > On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: > ... > > > > +* page is a thp, not a non-huge compound page. > > > > +*/ > > > > + else if (PageTransCompound(page) && !PageSlab(page)) > > > >

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: ... > > > + * page is a thp, not a non-huge compound page. > > > + */ > > > + else if (PageTransCompound(page) && !PageSlab(page)) > > > u |= 1 << KPF_THP; > > > > Good catch! > > > > Will this report THP for the

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: ... + * page is a thp, not a non-huge compound page. + */ + else if (PageTransCompound(page) !PageSlab(page)) u |= 1 KPF_THP; Good catch! Will this report THP for the various drivers that do

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Fengguang Wu
On Wed, Sep 26, 2012 at 02:06:08AM -0400, Naoya Horiguchi wrote: On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: ... +* page is a thp, not a non-huge compound page. +*/ + else if (PageTransCompound(page) !PageSlab(page)) u

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-26 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 03:38:41PM +0800, Fengguang Wu wrote: On Wed, Sep 26, 2012 at 02:06:08AM -0400, Naoya Horiguchi wrote: On Wed, Sep 26, 2012 at 12:02:34AM -0400, Naoya Horiguchi wrote: ... + * page is a thp, not a non-huge compound page. + */ + else if

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 10:47:54AM +0800, Fengguang Wu wrote: > On Tue, Sep 25, 2012 at 10:06:08PM -0400, Naoya Horiguchi wrote: > > On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: > > > On Tue, 25 Sep 2012, Naoya Horiguchi wrote: > > > > > > > KPF_THP can be set on non-huge

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Fengguang Wu
On Tue, Sep 25, 2012 at 10:06:08PM -0400, Naoya Horiguchi wrote: > On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: > > On Tue, 25 Sep 2012, Naoya Horiguchi wrote: > > > > > KPF_THP can be set on non-huge compound pages like slab pages, because > > > PageTransCompound only sees

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread David Rientjes
On Tue, 25 Sep 2012, Naoya Horiguchi wrote: > KPF_THP can be set on non-huge compound pages like slab pages, because > PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug > and breaks user space applications which look for thp via /proc/kpageflags. > This patch rules out

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: > On Tue, 25 Sep 2012, Naoya Horiguchi wrote: > > > KPF_THP can be set on non-huge compound pages like slab pages, because > > PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug > > and breaks user space

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread David Rientjes
On Tue, 25 Sep 2012, Naoya Horiguchi wrote: > KPF_THP can be set on non-huge compound pages like slab pages, because > PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug > and breaks user space applications which look for thp via /proc/kpageflags. > Currently thp is

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread KOSAKI Motohiro
ageAnon and PageTransCompound are true. >> >> Indeed. Please add some comment too. > > Sure. I send revised one. > > Thanks, > Naoya > --- > From: Naoya Horiguchi > Date: Mon, 24 Sep 2012 16:28:30 -0400 > Subject: [PATCH v2] pagemap: fix wrong KPF_THP on slab p

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
Sure. I send revised one. Thanks, Naoya --- From: Naoya Horiguchi Date: Mon, 24 Sep 2012 16:28:30 -0400 Subject: [PATCH v2] pagemap: fix wrong KPF_THP on slab pages KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this i

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread KOSAKI Motohiro
On Tue, Sep 25, 2012 at 9:56 AM, Naoya Horiguchi wrote: > KPF_THP can be set on non-huge compound pages like slab pages, because > PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug > and breaks user space applications which look for thp via /proc/kpageflags. > Currently thp

[PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications which look for thp via /proc/kpageflags. Currently thp is constructed only on anonymous pages, so this patch makes

[PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications which look for thp via /proc/kpageflags. Currently thp is constructed only on anonymous pages, so this patch makes

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread KOSAKI Motohiro
On Tue, Sep 25, 2012 at 9:56 AM, Naoya Horiguchi n-horigu...@ah.jp.nec.com wrote: KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications which look for thp via

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
, Naoya --- From: Naoya Horiguchi n-horigu...@ah.jp.nec.com Date: Mon, 24 Sep 2012 16:28:30 -0400 Subject: [PATCH v2] pagemap: fix wrong KPF_THP on slab pages KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread KOSAKI Motohiro
are true. Indeed. Please add some comment too. Sure. I send revised one. Thanks, Naoya --- From: Naoya Horiguchi n-horigu...@ah.jp.nec.com Date: Mon, 24 Sep 2012 16:28:30 -0400 Subject: [PATCH v2] pagemap: fix wrong KPF_THP on slab pages KPF_THP can be set on non-huge compound pages like

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread David Rientjes
On Tue, 25 Sep 2012, Naoya Horiguchi wrote: KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications which look for thp via /proc/kpageflags. Currently thp is constructed

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: On Tue, 25 Sep 2012, Naoya Horiguchi wrote: KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread David Rientjes
On Tue, 25 Sep 2012, Naoya Horiguchi wrote: KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and PG_tail. Obviously this is a bug and breaks user space applications which look for thp via /proc/kpageflags. This patch rules out setting

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Fengguang Wu
On Tue, Sep 25, 2012 at 10:06:08PM -0400, Naoya Horiguchi wrote: On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: On Tue, 25 Sep 2012, Naoya Horiguchi wrote: KPF_THP can be set on non-huge compound pages like slab pages, because PageTransCompound only sees PG_head and

Re: [PATCH] pagemap: fix wrong KPF_THP on slab pages

2012-09-25 Thread Naoya Horiguchi
On Wed, Sep 26, 2012 at 10:47:54AM +0800, Fengguang Wu wrote: On Tue, Sep 25, 2012 at 10:06:08PM -0400, Naoya Horiguchi wrote: On Tue, Sep 25, 2012 at 05:20:48PM -0700, David Rientjes wrote: On Tue, 25 Sep 2012, Naoya Horiguchi wrote: KPF_THP can be set on non-huge compound pages