linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] splice: use mapping_gfp_mask
@ 2008-04-03 22:35 Hugh Dickins
  2008-04-04 11:46 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Hugh Dickins @ 2008-04-03 22:35 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Andrew Morton, Linus Torvalds, linux-kernel

The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
mapping_gfp_mask, to avoid hangs under memory pressure.  But nowadays
it uses splice, usually going through __generic_file_splice_read.  That
must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---
Ought to go into 2.6.25.  For 2.6.23 and 2.6.24 stable?  Well, I've
not actually seen this hang on any of these, though presumably it's
lurking there.  Where I did see it, and test the fix, was 2.6.25-rc5-mm1:
whose SLUB had a disturbing predilection (since corrected) for order-4
allocations, even when allocating radix tree nodes.

 fs/splice.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 2.6.25-rc8/fs/splice.c	2008-03-05 10:47:40.000000000 +0000
+++ linux/fs/splice.c	2008-04-01 22:28:41.000000000 +0100
@@ -320,7 +320,7 @@ __generic_file_splice_read(struct file *
 				break;
 
 			error = add_to_page_cache_lru(page, mapping, index,
-					      GFP_KERNEL);
+						mapping_gfp_mask(mapping));
 			if (unlikely(error)) {
 				page_cache_release(page);
 				if (error == -EEXIST)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] splice: use mapping_gfp_mask
  2008-04-03 22:35 [PATCH] splice: use mapping_gfp_mask Hugh Dickins
@ 2008-04-04 11:46 ` Jens Axboe
  2008-04-04 20:54   ` Oliver Pinter
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2008-04-04 11:46 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Andrew Morton, Linus Torvalds, linux-kernel

On Thu, Apr 03 2008, Hugh Dickins wrote:
> The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
> mapping_gfp_mask, to avoid hangs under memory pressure.  But nowadays
> it uses splice, usually going through __generic_file_splice_read.  That
> must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.
> 
> Signed-off-by: Hugh Dickins <hugh@veritas.com>
> ---
> Ought to go into 2.6.25.  For 2.6.23 and 2.6.24 stable?  Well, I've
> not actually seen this hang on any of these, though presumably it's
> lurking there.  Where I did see it, and test the fix, was 2.6.25-rc5-mm1:
> whose SLUB had a disturbing predilection (since corrected) for order-4
> allocations, even when allocating radix tree nodes.

Thanks Hugh, definitely correct! I see it's already merged, so all is
well.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] splice: use mapping_gfp_mask
  2008-04-04 11:46 ` Jens Axboe
@ 2008-04-04 20:54   ` Oliver Pinter
  2008-04-05  7:23     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Pinter @ 2008-04-04 20:54 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Hugh Dickins, Andrew Morton, Linus Torvalds, linux-kernel

hi all!

this patch for 2.6.22.y ?

if i good see, the __generic_file_splice_read bring out to 2.6.22 ..

http://repo.or.cz/w/linux-2.6.22.y-op-patches.git
http://repo.or.cz/w/linux-2.6.22.y-op.git

On 4/4/08, Jens Axboe <jens.axboe@oracle.com> wrote:
> On Thu, Apr 03 2008, Hugh Dickins wrote:
> > The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
> > mapping_gfp_mask, to avoid hangs under memory pressure.  But nowadays
> > it uses splice, usually going through __generic_file_splice_read.  That
> > must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.
> >
> > Signed-off-by: Hugh Dickins <hugh@veritas.com>
> > ---
> > Ought to go into 2.6.25.  For 2.6.23 and 2.6.24 stable?  Well, I've
> > not actually seen this hang on any of these, though presumably it's
> > lurking there.  Where I did see it, and test the fix, was 2.6.25-rc5-mm1:
> > whose SLUB had a disturbing predilection (since corrected) for order-4
> > allocations, even when allocating radix tree nodes.
>
> Thanks Hugh, definitely correct! I see it's already merged, so all is
> well.
>
> --
> Jens Axboe
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>


-- 
Thanks,
Oliver

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] splice: use mapping_gfp_mask
  2008-04-04 20:54   ` Oliver Pinter
@ 2008-04-05  7:23     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2008-04-05  7:23 UTC (permalink / raw)
  To: Oliver Pinter; +Cc: Hugh Dickins, Andrew Morton, Linus Torvalds, linux-kernel

On Fri, Apr 04 2008, Oliver Pinter wrote:
> hi all!
> 
> this patch for 2.6.22.y ?
> 
> if i good see, the __generic_file_splice_read bring out to 2.6.22 ..
> 
> http://repo.or.cz/w/linux-2.6.22.y-op-patches.git
> http://repo.or.cz/w/linux-2.6.22.y-op.git

Loop isn't affected before 2.6.23, so while it doesn't hurt to put it
into 2.6.22, there's not much point either. 2.6.23 and 24 need the
patch.


> 
> On 4/4/08, Jens Axboe <jens.axboe@oracle.com> wrote:
> > On Thu, Apr 03 2008, Hugh Dickins wrote:
> > > The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
> > > mapping_gfp_mask, to avoid hangs under memory pressure.  But nowadays
> > > it uses splice, usually going through __generic_file_splice_read.  That
> > > must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.
> > >
> > > Signed-off-by: Hugh Dickins <hugh@veritas.com>
> > > ---
> > > Ought to go into 2.6.25.  For 2.6.23 and 2.6.24 stable?  Well, I've
> > > not actually seen this hang on any of these, though presumably it's
> > > lurking there.  Where I did see it, and test the fix, was 2.6.25-rc5-mm1:
> > > whose SLUB had a disturbing predilection (since corrected) for order-4
> > > allocations, even when allocating radix tree nodes.
> >
> > Thanks Hugh, definitely correct! I see it's already merged, so all is
> > well.
> >
> > --
> > Jens Axboe
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/
> >
> 
> 
> -- 
> Thanks,
> Oliver

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-04-05  7:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-03 22:35 [PATCH] splice: use mapping_gfp_mask Hugh Dickins
2008-04-04 11:46 ` Jens Axboe
2008-04-04 20:54   ` Oliver Pinter
2008-04-05  7:23     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).