Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-16 Thread Fengwei Yin
On Fri, Oct 10, 2014 at 07:35:15AM -0700, Dave Hansen wrote: > On 10/10/2014 06:21 AM, Fengwei Yin wrote: > > @@ -787,6 +788,9 @@ check_pfn: > > return NULL; > > } > > > > + if (is_huge_zero_pfn(pfn)) > > + return NULL; > &g

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-16 Thread Fengwei Yin
On Fri, Oct 10, 2014 at 07:35:15AM -0700, Dave Hansen wrote: On 10/10/2014 06:21 AM, Fengwei Yin wrote: @@ -787,6 +788,9 @@ check_pfn: return NULL; } + if (is_huge_zero_pfn(pfn)) + return NULL; + That looks a lot better. One thing, why not put

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-14 Thread Fengwei Yin
On Tue, Oct 14, 2014 at 02:57:30PM +0300, Kirill A. Shutemov wrote: > On Fri, Oct 10, 2014 at 09:21:08PM +0800, Fengwei Yin wrote: > > On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: > > > On 10/09/2014 02:19 AM, Fengwei Yin wrote: > > > > diff --git

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-14 Thread Fengwei Yin
On Tue, Oct 14, 2014 at 02:57:30PM +0300, Kirill A. Shutemov wrote: On Fri, Oct 10, 2014 at 09:21:08PM +0800, Fengwei Yin wrote: On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: On 10/09/2014 02:19 AM, Fengwei Yin wrote: diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-10 Thread Fengwei Yin
On Fri, Oct 10, 2014 at 07:35:15AM -0700, Dave Hansen wrote: > On 10/10/2014 06:21 AM, Fengwei Yin wrote: > > @@ -787,6 +788,9 @@ check_pfn: > > return NULL; > > } > > > > + if (is_huge_zero_pfn(pfn)) > > + return NULL; > &g

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-10 Thread Fengwei Yin
On Fri, Oct 10, 2014 at 07:35:15AM -0700, Dave Hansen wrote: On 10/10/2014 06:21 AM, Fengwei Yin wrote: @@ -787,6 +788,9 @@ check_pfn: return NULL; } + if (is_huge_zero_pfn(pfn)) + return NULL; + That looks a lot better. One thing, why not put

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: > On 10/09/2014 02:19 AM, Fengwei Yin wrote: > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > > index 80ca4fb..8550b27 100644 > > --- a/fs/proc/task_mmu.c > > +++ b/fs/proc/task_mmu.c > >

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: > On 10/09/2014 02:19 AM, Fengwei Yin wrote: > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > > index 80ca4fb..8550b27 100644 > > --- a/fs/proc/task_mmu.c > > +++ b/fs/proc/task_mmu.c > >

[PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
Hi, Fengguang found that the RSS/PSS shown in smaps is not correct if the file is /dev/zero. Example: 7bea458b3000-7fea458b3000 r--p 00:13 39989 /dev/zero Size: 4294967296 kB Rss:10612736 kB Pss:10612736 kB Shared_Clean: 0 kB Shared_Dirty:

[PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
Hi, Fengguang found that the RSS/PSS shown in smaps is not correct if the file is /dev/zero. Example: 7bea458b3000-7fea458b3000 r--p 00:13 39989 /dev/zero Size: 4294967296 kB Rss:10612736 kB Pss:10612736 kB Shared_Clean: 0 kB Shared_Dirty:

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: On 10/09/2014 02:19 AM, Fengwei Yin wrote: diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 80ca4fb..8550b27 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -476,7 +476,7 @@ static void smaps_pte_entry

Re: [PATCH] smaps should deal with huge zero page exactly same as normal zero page

2014-10-09 Thread Fengwei Yin
On Thu, Oct 09, 2014 at 09:36:30AM -0700, Dave Hansen wrote: On 10/09/2014 02:19 AM, Fengwei Yin wrote: diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 80ca4fb..8550b27 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -476,7 +476,7 @@ static void smaps_pte_entry

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Fri, Apr 25, 2014 at 12:29 AM, Al Viro wrote: > On Thu, Apr 24, 2014 at 10:26:50PM +0800, Fengwei Yin wrote: >> On Thu, Apr 24, 2014 at 5:58 AM, Al Viro wrote: >> > On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: >> >> When dump /proc/xxx/maps, if d

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Thu, Apr 24, 2014 at 5:58 AM, Al Viro wrote: > On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: >> When dump /proc/xxx/maps, if d_path return error in seq_path, the >> buffer will be exhaust and trigger dead loop in seq_read. Till >> kmalloc fails with -ENOM

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Thu, Apr 24, 2014 at 5:58 AM, Al Viro v...@zeniv.linux.org.uk wrote: On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: When dump /proc/xxx/maps, if d_path return error in seq_path, the buffer will be exhaust and trigger dead loop in seq_read. Till kmalloc fails with -ENOMEM

Re: [PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-24 Thread Fengwei Yin
On Fri, Apr 25, 2014 at 12:29 AM, Al Viro v...@zeniv.linux.org.uk wrote: On Thu, Apr 24, 2014 at 10:26:50PM +0800, Fengwei Yin wrote: On Thu, Apr 24, 2014 at 5:58 AM, Al Viro v...@zeniv.linux.org.uk wrote: On Mon, Apr 21, 2014 at 10:12:42PM +0800, Fengwei Yin wrote: When dump /proc/xxx/maps

[PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-21 Thread Fengwei Yin
When dump /proc/xxx/maps, if d_path return error in seq_path, the buffer will be exhaust and trigger dead loop in seq_read. Till kmalloc fails with -ENOMEM. Saving and restoring the m->count to avoid the dead loop in seq_read if d_path return error. Signed-off-by: Fengwei Yin --- fs/p

[PATCH] Fix seq_read dead loop and trigger memory allocation failure.

2014-04-21 Thread Fengwei Yin
When dump /proc/xxx/maps, if d_path return error in seq_path, the buffer will be exhaust and trigger dead loop in seq_read. Till kmalloc fails with -ENOMEM. Saving and restoring the m-count to avoid the dead loop in seq_read if d_path return error. Signed-off-by: Fengwei Yin yfw.ker...@gmail.com

Re: About get_page for compound page

2007-07-19 Thread Fengwei Yin
On 7/20/07, Peter Zijlstra <[EMAIL PROTECTED]> wrote: On Thu, 2007-07-19 at 23:54 +0800, Fengwei Yin wrote: > Hi, > In get_page(), the parameter page is changed by > page = compound_head(page); > if the page is not the first page of compound pages. > > My qu

About get_page for compound page

2007-07-19 Thread Fengwei Yin
Hi, In get_page(), the parameter page is changed by page = compound_head(page); if the page is not the first page of compound pages. My question: is this behavior correct? Regards Yin, Fengwei - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a

About get_page for compound page

2007-07-19 Thread Fengwei Yin
Hi, In get_page(), the parameter page is changed by page = compound_head(page); if the page is not the first page of compound pages. My question: is this behavior correct? Regards Yin, Fengwei - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a

Re: About get_page for compound page

2007-07-19 Thread Fengwei Yin
On 7/20/07, Peter Zijlstra [EMAIL PROTECTED] wrote: On Thu, 2007-07-19 at 23:54 +0800, Fengwei Yin wrote: Hi, In get_page(), the parameter page is changed by page = compound_head(page); if the page is not the first page of compound pages. My question: is this behavior correct

Type error in drivers/input/tsdev.c?

2007-06-19 Thread Fengwei Yin
Hi, In function tsdev_event() of drivers/input/tsdev.c, conversion from usec to milisec is like: client->event[client->head].millisecs = time.tv_usec / 100; ~~ should be 1000? Regards Yin, Fengwei - To unsubscribe from this list: send the line

Type error in drivers/input/tsdev.c?

2007-06-19 Thread Fengwei Yin
Hi, In function tsdev_event() of drivers/input/tsdev.c, conversion from usec to milisec is like: client-event[client-head].millisecs = time.tv_usec / 100; ~~ should be 1000? Regards Yin, Fengwei - To unsubscribe from this list: send the line