Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Steven Whitehouse
Hi, On Thu, 2013-08-22 at 18:16 +0300, Kirill A. Shutemov wrote: > Steven Whitehouse wrote: > > Hi, > > > > On Thu, 2013-08-22 at 17:30 +0300, Kirill A. Shutemov wrote: > > [snip] > > > > Andrew's proposed solution makes sense to me, and is probably the > > > > easiest way to solve this. > > > >

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Kirill A. Shutemov
Steven Whitehouse wrote: > Hi, > > On Thu, 2013-08-22 at 17:30 +0300, Kirill A. Shutemov wrote: > [snip] > > > Andrew's proposed solution makes sense to me, and is probably the > > > easiest way to solve this. > > > > Move check to no_cached_page? > Yes > > > I don't see how it makes any differe

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Steven Whitehouse
Hi, On Thu, 2013-08-22 at 17:30 +0300, Kirill A. Shutemov wrote: [snip] > > Andrew's proposed solution makes sense to me, and is probably the > > easiest way to solve this. > > Move check to no_cached_page? Yes > I don't see how it makes any difference for > page cache miss case: we anyway exclu

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Kirill A. Shutemov
Steven Whitehouse wrote: > Hi, > > On Thu, 2013-08-22 at 16:05 +0300, Kirill A. Shutemov wrote: > > Steven Whitehouse wrote: > > > Hi, > > > > > > On Wed, 2013-08-21 at 13:58 -0700, Andrew Morton wrote: > > > > On Wed, 21 Aug 2013 17:42:12 +0100 Steven Whitehouse > > > > wrote: > > > > > > > >

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Steven Whitehouse
Hi, On Thu, 2013-08-22 at 16:05 +0300, Kirill A. Shutemov wrote: > Steven Whitehouse wrote: > > Hi, > > > > On Wed, 2013-08-21 at 13:58 -0700, Andrew Morton wrote: > > > On Wed, 21 Aug 2013 17:42:12 +0100 Steven Whitehouse > > > wrote: > > > > > > > > I don't think the change is harmful. The w

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Kirill A. Shutemov
Steven Whitehouse wrote: > Hi, > > On Wed, 2013-08-21 at 13:58 -0700, Andrew Morton wrote: > > On Wed, 21 Aug 2013 17:42:12 +0100 Steven Whitehouse > > wrote: > > > > > > I don't think the change is harmful. The worst case scenario is race > > > > with > > > > write or truncate, but it's valid

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-22 Thread Steven Whitehouse
Hi, On Wed, 2013-08-21 at 13:58 -0700, Andrew Morton wrote: > On Wed, 21 Aug 2013 17:42:12 +0100 Steven Whitehouse > wrote: > > > > I don't think the change is harmful. The worst case scenario is race with > > > write or truncate, but it's valid to return EOF in this case. > > > > > > What sce

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-21 Thread Andrew Morton
On Wed, 21 Aug 2013 17:42:12 +0100 Steven Whitehouse wrote: > > I don't think the change is harmful. The worst case scenario is race with > > write or truncate, but it's valid to return EOF in this case. > > > > What scenario do you have in mind? > > > > 1. File open on node A > 2. Someone up

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-21 Thread Steven Whitehouse
Hi, On Wed, 2013-08-21 at 19:08 +0300, Kirill A. Shutemov wrote: > Steven Whitehouse wrote: > > Hi, > > > > On Wed, 2013-08-21 at 18:37 +0300, Kirill A. Shutemov wrote: > > > I've noticed that we allocated unneeded page for cache on read beyond > > > i_size. Simple test case (I checked it on ramf

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-21 Thread Kirill A. Shutemov
Steven Whitehouse wrote: > Hi, > > On Wed, 2013-08-21 at 18:37 +0300, Kirill A. Shutemov wrote: > > I've noticed that we allocated unneeded page for cache on read beyond > > i_size. Simple test case (I checked it on ramfs): > > > > $ touch testfile > > $ cat testfile > > > > It triggers 'no_cach

Re: [PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-21 Thread Steven Whitehouse
Hi, On Wed, 2013-08-21 at 18:37 +0300, Kirill A. Shutemov wrote: > I've noticed that we allocated unneeded page for cache on read beyond > i_size. Simple test case (I checked it on ramfs): > > $ touch testfile > $ cat testfile > > It triggers 'no_cached_page' code path in do_generic_file_read().

[PATCH] mm, fs: avoid page allocation beyond i_size on read

2013-08-21 Thread Kirill A. Shutemov
I've noticed that we allocated unneeded page for cache on read beyond i_size. Simple test case (I checked it on ramfs): $ touch testfile $ cat testfile It triggers 'no_cached_page' code path in do_generic_file_read(). Looks like it's regression since commit a32ea1e. Let's fix it. Signed-off-by: