lkml.org 
[lkml]   [2009]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 2/3] splice: implement default splice_read method
From
Date
On Wed, 13 May 2009, Jens Axboe wrote:
> On Tue, May 12 2009, Andrew Morton wrote:
> > On Thu, 07 May 2009 15:37:36 +0200 Miklos Szeredi <miklos@szeredi.hu> wrote:
> >
> > > + for (i = 0; i < spd.nr_pages; i++) {
> > > + kunmap(pages[i]);
> >
> > It is deadlockable if any thread of control holds more than a single
> > kmap at a time.
> >
> > Because there are a finite number of kmaps available, and if one is
> > unavailable, kmap() waits for one to become free. If the number of
> > waiting threads equals the number of available slots, nobody makes any
> > progress.

Ouch.

>
> Good catch, that will not work reliably. I've applied the below.

Thanks.

The bigger problem is that the default_file_splice_write()
implementation in the other patch does the same (it calls
buf->ops->map() on all buffers).

Hmm. Simple solution would be to do a write() for each buffer. But
this only affects HIGHMEM kernels, so it's a bit pointless to do that
on all archs. Sigh...

Miklos


\
 
 \ /
  Last update: 2009-05-13 11:05    [W:0.218 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site