From: Dave Hansen <dave@sr71.net>
To: Robert C Jennings <rcj@linux.vnet.ibm.com>, linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Rik van Riel <riel@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Matt Helsley <matt.helsley@gmail.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
Lei Li <lilei@linux.vnet.ibm.com>,
Leonardo Garcia <lagarcia@linux.vnet.ibm.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient
Date: Tue, 08 Oct 2013 09:23:33 -0700 [thread overview]
Message-ID: <52543185.3060705@sr71.net> (raw)
In-Reply-To: <1381177293-27125-2-git-send-email-rcj@linux.vnet.ibm.com>
On 10/07/2013 01:21 PM, Robert C Jennings wrote:
> spd.partial[page_nr].offset = loff;
> spd.partial[page_nr].len = this_len;
> + spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT;
> len -= this_len;
> loff = 0;
> spd.nr_pages++;
> @@ -656,6 +702,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
> this_len = min_t(size_t, vec[i].iov_len, res);
> spd.partial[i].offset = 0;
> spd.partial[i].len = this_len;
> + spd.partial[i].useraddr = (unsigned long)vec[i].iov_base;
> if (!this_len) {
> __free_page(spd.pages[i]);
> spd.pages[i] = NULL;
> @@ -1475,6 +1522,8 @@ static int get_iovec_page_array(const struct iovec __user *iov,
>
> partial[buffers].offset = off;
> partial[buffers].len = plen;
> + partial[buffers].useraddr = (unsigned long)base;
> + base = (void*)((unsigned long)base + PAGE_SIZE);
>
> off = 0;
> len -= plen;
> diff --git a/include/linux/splice.h b/include/linux/splice.h
> index 74575cb..56661e3 100644
> --- a/include/linux/splice.h
> +++ b/include/linux/splice.h
> @@ -44,6 +44,7 @@ struct partial_page {
> unsigned int offset;
> unsigned int len;
> unsigned long private;
> + unsigned long useraddr;
> };
"useraddr" confuses me. You make it an 'unsigned long', yet two of the
three assignments are from "void __user *". The other assignment:
spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT;
'index' looks to be the offset inside the file, not a user address, so
I'm confused what that is doing.
Could you elaborate a little more on why 'useraddr' is suddenly needed
in these patches? How is "index << PAGE_CACHE_SHIFT" a virtual address?
Also, are we losing any of the advantages of sparse checking since
'useraddr' is without the __user annotation?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave@sr71.net>
To: Robert C Jennings <rcj@linux.vnet.ibm.com>, linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Rik van Riel <riel@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Matt Helsley <matt.helsley@gmail.com>,
Anthony Liguori <anthony@codemonkey.ws>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
Lei Li <lilei@linux.vnet.ibm.com>,
Leonardo Garcia <lagarcia@linux.vnet.ibm.com>,
Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH 1/2] vmsplice: unmap gifted pages for recipient
Date: Tue, 08 Oct 2013 09:23:33 -0700 [thread overview]
Message-ID: <52543185.3060705@sr71.net> (raw)
In-Reply-To: <1381177293-27125-2-git-send-email-rcj@linux.vnet.ibm.com>
On 10/07/2013 01:21 PM, Robert C Jennings wrote:
> spd.partial[page_nr].offset = loff;
> spd.partial[page_nr].len = this_len;
> + spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT;
> len -= this_len;
> loff = 0;
> spd.nr_pages++;
> @@ -656,6 +702,7 @@ ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
> this_len = min_t(size_t, vec[i].iov_len, res);
> spd.partial[i].offset = 0;
> spd.partial[i].len = this_len;
> + spd.partial[i].useraddr = (unsigned long)vec[i].iov_base;
> if (!this_len) {
> __free_page(spd.pages[i]);
> spd.pages[i] = NULL;
> @@ -1475,6 +1522,8 @@ static int get_iovec_page_array(const struct iovec __user *iov,
>
> partial[buffers].offset = off;
> partial[buffers].len = plen;
> + partial[buffers].useraddr = (unsigned long)base;
> + base = (void*)((unsigned long)base + PAGE_SIZE);
>
> off = 0;
> len -= plen;
> diff --git a/include/linux/splice.h b/include/linux/splice.h
> index 74575cb..56661e3 100644
> --- a/include/linux/splice.h
> +++ b/include/linux/splice.h
> @@ -44,6 +44,7 @@ struct partial_page {
> unsigned int offset;
> unsigned int len;
> unsigned long private;
> + unsigned long useraddr;
> };
"useraddr" confuses me. You make it an 'unsigned long', yet two of the
three assignments are from "void __user *". The other assignment:
spd.partial[page_nr].useraddr = index << PAGE_CACHE_SHIFT;
'index' looks to be the offset inside the file, not a user address, so
I'm confused what that is doing.
Could you elaborate a little more on why 'useraddr' is suddenly needed
in these patches? How is "index << PAGE_CACHE_SHIFT" a virtual address?
Also, are we losing any of the advantages of sparse checking since
'useraddr' is without the __user annotation?
next prev parent reply other threads:[~2013-10-08 16:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 20:21 [PATCH 0/2] vmpslice support for zero-copy gifting of pages Robert C Jennings
2013-10-07 20:21 ` Robert C Jennings
2013-10-07 20:21 ` [PATCH 1/2] vmsplice: unmap gifted pages for recipient Robert C Jennings
2013-10-07 20:21 ` Robert C Jennings
2013-10-08 16:14 ` Dave Hansen
2013-10-08 16:14 ` Dave Hansen
2013-10-08 19:48 ` Robert Jennings
2013-10-08 19:48 ` Robert Jennings
2013-10-08 21:22 ` Dave Hansen
2013-10-08 21:22 ` Dave Hansen
2013-10-08 16:23 ` Dave Hansen [this message]
2013-10-08 16:23 ` Dave Hansen
2013-10-17 13:54 ` Robert Jennings
2013-10-17 13:54 ` Robert Jennings
2013-10-17 10:20 ` Vlastimil Babka
2013-10-17 10:20 ` Vlastimil Babka
2013-10-17 13:48 ` Robert Jennings
2013-10-17 13:48 ` Robert Jennings
2013-10-18 8:10 ` Vlastimil Babka
2013-10-18 8:10 ` Vlastimil Babka
2013-10-07 20:21 ` [PATCH 2/2] vmsplice: Add limited zero copy to vmsplice Robert C Jennings
2013-10-07 20:21 ` Robert C Jennings
2013-10-08 16:45 ` Dave Hansen
2013-10-08 16:45 ` Dave Hansen
2013-10-08 17:35 ` Robert Jennings
2013-10-08 17:35 ` Robert Jennings
2013-10-17 11:23 ` Vlastimil Babka
2013-10-17 11:23 ` Vlastimil Babka
2013-10-17 13:44 ` Robert Jennings
2013-10-17 13:44 ` Robert Jennings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52543185.3060705@sr71.net \
--to=dave@sr71.net \
--cc=aarcange@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=lagarcia@linux.vnet.ibm.com \
--cc=lilei@linux.vnet.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matt.helsley@gmail.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=rcj@linux.vnet.ibm.com \
--cc=riel@redhat.com \
--cc=vbabka@suse.cz \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.