Re: [PATCH] splice: add support for SPLICE_F_MOVE flag
From: Andrew Morton
Date: Thu Mar 30 2006 - 21:57:22 EST
Andrew Morton <akpm@xxxxxxxx> wrote:
>
> static void page_cache_pipe_buf_unmap(struct pipe_inode_info *info,
> > struct pipe_buffer *buf)
> > {
> > - unlock_page(buf->page);
> > + if (!buf->stolen)
> > + unlock_page(buf->page);
> > kunmap(buf->page);
> > }
>
> There go our chances of ever getting rid of kmap(). Is it not feasible to
> use atomic kmaps throughout this code?
What are the kmaps for, anyway? afaict they're doing the
kmap-the-page-while-we-run-some-a_ops thing which ceased being a
requirement 3-4 years ago.
The general approach we should take is that the code which actually
modifies a page's contents is the code which is responsible for kmapping
that page. Use an atomic kmap, memcpy-or-memset, atomic kunmap. Just four
or five lines.
If we can do that, pipe_buf_operations.map/unmap can be removed.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/