Re: [PATCH] splice: add support for SPLICE_F_MOVE flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Morton <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux