Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-04-07 Thread Michal Hocko
On Wed 01-04-15 08:46:51, Dave Chinner wrote: [...] > GFP_NOFS has also been required in the mapping mask in the past > because reclaim from page cache allocation points had a nasty habit > of blowing the stack. Yeah I remember some scary traces but we are talking about the page fault path and we

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-31 Thread Dave Chinner
On Mon, Mar 30, 2015 at 10:22:18AM +0200, Michal Hocko wrote: > On Fri 27-03-15 08:43:54, Dave Chinner wrote: > > On Thu, Mar 26, 2015 at 10:53:02AM +0100, Michal Hocko wrote: > > > On Fri 20-03-15 14:48:20, Dave Chinner wrote: > > > > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: >

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-30 Thread Michal Hocko
On Fri 27-03-15 08:43:54, Dave Chinner wrote: > On Thu, Mar 26, 2015 at 10:53:02AM +0100, Michal Hocko wrote: > > On Fri 20-03-15 14:48:20, Dave Chinner wrote: > > > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > > [...] > > > > Or did I miss your point? Are you concerned about som

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-26 Thread Dave Chinner
On Thu, Mar 26, 2015 at 10:53:02AM +0100, Michal Hocko wrote: > On Fri 20-03-15 14:48:20, Dave Chinner wrote: > > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > [...] > > > Or did I miss your point? Are you concerned about some fs overloading > > > filemap_fault and do some locking

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-26 Thread Michal Hocko
On Fri 20-03-15 14:48:20, Dave Chinner wrote: > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: [...] > > Or did I miss your point? Are you concerned about some fs overloading > > filemap_fault and do some locking before delegating to filemap_fault? > > The latter: > > https://git.k

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-23 Thread Michal Hocko
On Sat 21-03-15 09:51:39, Dave Chinner wrote: > On Fri, Mar 20, 2015 at 02:14:53PM +0100, Michal Hocko wrote: > > On Fri 20-03-15 14:48:20, Dave Chinner wrote: > > > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > > > > > allocations where the caller cannot pass a gfp_mask need to o

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-20 Thread Dave Chinner
On Fri, Mar 20, 2015 at 02:14:53PM +0100, Michal Hocko wrote: > On Fri 20-03-15 14:48:20, Dave Chinner wrote: > > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > > > > allocations where the caller cannot pass a gfp_mask need to obey > > > > the mapping_gfp_mask that is set by the ma

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-20 Thread Michal Hocko
On Fri 20-03-15 14:48:20, Dave Chinner wrote: > On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > > On Thu 19-03-15 18:14:39, Dave Chinner wrote: > > > On Wed, Mar 18, 2015 at 03:55:28PM +0100, Michal Hocko wrote: > > > > On Wed 18-03-15 10:44:11, Rik van Riel wrote: > > > > > On 03/1

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Dave Chinner
On Thu, Mar 19, 2015 at 02:55:58PM +0100, Michal Hocko wrote: > @@ -2701,13 +2701,24 @@ static int __do_fault(struct vm_area_struct *vma, > unsigned long address, > { > struct vm_fault vmf; > int ret; > + struct address_space *mapping = vma->vm_file->f_mapping; > + gfp_t mappi

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Dave Chinner
On Thu, Mar 19, 2015 at 01:44:41PM +0100, Michal Hocko wrote: > On Thu 19-03-15 18:14:39, Dave Chinner wrote: > > On Wed, Mar 18, 2015 at 03:55:28PM +0100, Michal Hocko wrote: > > > On Wed 18-03-15 10:44:11, Rik van Riel wrote: > > > > On 03/18/2015 10:09 AM, Michal Hocko wrote: > > > > > page_cach

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Michal Hocko
On Thu 19-03-15 14:55:58, Michal Hocko wrote: > On Thu 19-03-15 08:38:35, Neil Brown wrote: > [...] > > Nearly half the places in the kernel which call mapping_gfp_mask() remove > > the > > __GFP_FS bit. > > > > That suggests to me that it might make sense to have > >mapping_gfp_mask_fs() > >

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Michal Hocko
On Thu 19-03-15 08:38:35, Neil Brown wrote: [...] > Nearly half the places in the kernel which call mapping_gfp_mask() remove the > __GFP_FS bit. > > That suggests to me that it might make sense to have >mapping_gfp_mask_fs() > and >mapping_gfp_mask_nofs() > > and let the presence of __GFP

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Michal Hocko
On Thu 19-03-15 18:14:39, Dave Chinner wrote: > On Wed, Mar 18, 2015 at 03:55:28PM +0100, Michal Hocko wrote: > > On Wed 18-03-15 10:44:11, Rik van Riel wrote: > > > On 03/18/2015 10:09 AM, Michal Hocko wrote: > > > > page_cache_read has been historically using page_cache_alloc_cold to > > > > allo

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-19 Thread Dave Chinner
On Wed, Mar 18, 2015 at 03:55:28PM +0100, Michal Hocko wrote: > On Wed 18-03-15 10:44:11, Rik van Riel wrote: > > On 03/18/2015 10:09 AM, Michal Hocko wrote: > > > page_cache_read has been historically using page_cache_alloc_cold to > > > allocate a new page. This means that mapping_gfp_mask is use

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread NeilBrown
On Wed, 18 Mar 2015 16:45:40 +0100 Michal Hocko wrote: > What do you think about this v2? I cannot say I would like it but I > really dislike the whole mapping_gfp_mask API to be honest. > --- > >From d88010d6f5f59d7eb87b691e27e201d12cab9141 Mon Sep 17 00:00:00 2001 > From: Michal Hocko > Date:

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Michal Hocko
What do you think about this v2? I cannot say I would like it but I really dislike the whole mapping_gfp_mask API to be honest. --- >From d88010d6f5f59d7eb87b691e27e201d12cab9141 Mon Sep 17 00:00:00 2001 From: Michal Hocko Date: Wed, 18 Mar 2015 16:06:40 +0100 Subject: [PATCH] mm: Allow __GFP_FS f

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Michal Hocko
On Wed 18-03-15 10:44:11, Rik van Riel wrote: > On 03/18/2015 10:09 AM, Michal Hocko wrote: > > page_cache_read has been historically using page_cache_alloc_cold to > > allocate a new page. This means that mapping_gfp_mask is used as the > > base for the gfp_mask. Many filesystems are setting this

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Rik van Riel
On 03/18/2015 10:09 AM, Michal Hocko wrote: > page_cache_read has been historically using page_cache_alloc_cold to > allocate a new page. This means that mapping_gfp_mask is used as the > base for the gfp_mask. Many filesystems are setting this mask to > GFP_NOFS to prevent from fs recursion issues

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Michal Hocko
On Wed 18-03-15 14:38:47, Mel Gorman wrote: > On Wed, Mar 18, 2015 at 03:09:26PM +0100, Michal Hocko wrote: > > page_cache_read has been historically using page_cache_alloc_cold to > > allocate a new page. This means that mapping_gfp_mask is used as the > > base for the gfp_mask. Many filesystems a

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Mel Gorman
On Wed, Mar 18, 2015 at 03:09:26PM +0100, Michal Hocko wrote: > page_cache_read has been historically using page_cache_alloc_cold to > allocate a new page. This means that mapping_gfp_mask is used as the > base for the gfp_mask. Many filesystems are setting this mask to > GFP_NOFS to prevent from f

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Michal Hocko
On Wed 18-03-15 10:32:57, Rik van Riel wrote: > On 03/18/2015 10:09 AM, Michal Hocko wrote: > > > diff --git a/mm/filemap.c b/mm/filemap.c > > index 968cd8e03d2e..26f62ba79f50 100644 > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -1752,7 +1752,7 @@ static int page_cache_read(struct file *fil

Re: [PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Rik van Riel
On 03/18/2015 10:09 AM, Michal Hocko wrote: > diff --git a/mm/filemap.c b/mm/filemap.c > index 968cd8e03d2e..26f62ba79f50 100644 > --- a/mm/filemap.c > +++ b/mm/filemap.c > @@ -1752,7 +1752,7 @@ static int page_cache_read(struct file *file, pgoff_t > offset) > int ret; > > do { > -

[PATCH] mm: Use GFP_KERNEL allocation for the page cache in page_cache_read

2015-03-18 Thread Michal Hocko
page_cache_read has been historically using page_cache_alloc_cold to allocate a new page. This means that mapping_gfp_mask is used as the base for the gfp_mask. Many filesystems are setting this mask to GFP_NOFS to prevent from fs recursion issues. page_cache_read is, however, not called from the f