From: Robert Jennings <rcj@linux.vnet.ibm.com>
To: Dave Hansen <dave@sr71.net>
Cc: linux-kernel@vger.kernel.org, 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, 8 Oct 2013 14:48:19 -0500 [thread overview]
Message-ID: <20131008194819.GB6129@linux.vnet.ibm.com> (raw)
In-Reply-To: <52542F53.4020807@sr71.net>
* Dave Hansen (dave@sr71.net) wrote:
> On 10/07/2013 01:21 PM, Robert C Jennings wrote:
> > + } else {
> > + if (vma)
> > + zap_page_range(vma,
> > + user_start,
> > + (user_end -
> > + user_start),
> > + NULL);
> > + vma = find_vma_intersection(
> > + current->mm,
> > + useraddr,
> > + (useraddr +
> > + PAGE_SIZE));
> > + if (!IS_ERR_OR_NULL(vma)) {
> > + user_start = useraddr;
> > + user_end = (useraddr +
> > + PAGE_SIZE);
> > + } else
> > + vma = NULL;
> > + }
>
> This is pretty unspeakably hideous. Was there truly no better way to do
> this?
I was hoping to find a better way to coalesce pipe buffers and zap
entire VMAs (and it needs better documentation but your argument is with
structure and I agree). I would love suggestions for improving this but
that is not to say that I've abandoned it; I'm still looking for ways
to make this cleaner.
Doing find_vma() on a single page in the VMA rather than on each and
then zapping once provides a 50% runtime reduction for the writer when
tested with a 256MB vmsplice operation. Based on the result I felt that
coalescing was justfied but the implementation is ugly.
--
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: Robert Jennings <rcj@linux.vnet.ibm.com>
To: Dave Hansen <dave@sr71.net>
Cc: linux-kernel@vger.kernel.org, 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, 8 Oct 2013 14:48:19 -0500 [thread overview]
Message-ID: <20131008194819.GB6129@linux.vnet.ibm.com> (raw)
In-Reply-To: <52542F53.4020807@sr71.net>
* Dave Hansen (dave@sr71.net) wrote:
> On 10/07/2013 01:21 PM, Robert C Jennings wrote:
> > + } else {
> > + if (vma)
> > + zap_page_range(vma,
> > + user_start,
> > + (user_end -
> > + user_start),
> > + NULL);
> > + vma = find_vma_intersection(
> > + current->mm,
> > + useraddr,
> > + (useraddr +
> > + PAGE_SIZE));
> > + if (!IS_ERR_OR_NULL(vma)) {
> > + user_start = useraddr;
> > + user_end = (useraddr +
> > + PAGE_SIZE);
> > + } else
> > + vma = NULL;
> > + }
>
> This is pretty unspeakably hideous. Was there truly no better way to do
> this?
I was hoping to find a better way to coalesce pipe buffers and zap
entire VMAs (and it needs better documentation but your argument is with
structure and I agree). I would love suggestions for improving this but
that is not to say that I've abandoned it; I'm still looking for ways
to make this cleaner.
Doing find_vma() on a single page in the VMA rather than on each and
then zapping once provides a 50% runtime reduction for the writer when
tested with a 256MB vmsplice operation. Based on the result I felt that
coalescing was justfied but the implementation is ugly.
next prev parent reply other threads:[~2013-10-08 19:48 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 [this message]
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
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=20131008194819.GB6129@linux.vnet.ibm.com \
--to=rcj@linux.vnet.ibm.com \
--cc=aarcange@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=dave@sr71.net \
--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=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.