lkml.org 
[lkml]   [2015]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 00/10] evacuate struct page from the block layer, introduce __pfn_t

Al,

I was wondering about the struct page rules of
iov_iter_get_pages_alloc(), used in various places. There's no
documentation whatsoever in lib/iov_iter.c, nor in
include/linux/uio.h, and the changelog that introduced it only says:

commit 91f79c43d1b54d7154b118860d81b39bad07dfff
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Fri Mar 21 04:58:33 2014 -0400

new helper: iov_iter_get_pages_alloc()

same as iov_iter_get_pages(), except that pages array is allocated
(kmalloc if possible, vmalloc if that fails) and left for caller to
free. Lustre and NFS ->direct_IO() switched to it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

So if code does iov_iter_get_pages_alloc() on a user address that has
a real struct page behind it - and some other code does a regular
get_user_pages() on it, we'll have two sets of struct page
descriptors, the 'real' one, and a fake allocated one, right?

How does that work? Nobody else can ever discover these fake page
structs, so they don't really serve any 'real' synchronization purpose
other than the limited role of IO completion.

Thanks,

Ingo


\
 
 \ /
  Last update: 2015-05-08 07:41    [W:0.076 / U:5.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site