Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1471372
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Mike Rapoport <rppt@linux.vnet.ibm.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] userfaultfd: selftest: add ufd parameter to copy_page |
| Date | Sun, 28 Aug 2016 16:40:01 +0200 |
| Message-ID | <sb9pD-2UB-1@gated-at.bofh.it> (permalink) |
| References | <sb9pD-2UB-3@gated-at.bofh.it> |
| X-Ibm-Helo | d06dlp01.portsmouth.uk.ibm.com |
| X-Ibm-Mailfrom | rppt@linux.vnet.ibm.com |
| X-Ibm-Rcptto | linux-kernel@vger.kernel.org |
| X-Mailer | git-send-email 1.9.1 |
| X-Tm-As-Mml | disable |
| X-Content-Scanned | Fidelis XPS MAILER |
| X-Cbid | 16082814-0040-0000-0000-00000219F5A6 |
| X-Ibm-Av-Detection | SAVI=unused REMOTE=unused XFE=unused |
| X-Cbparentid | 16082814-0041-0000-0000-000021811E18 |
| X-Proofpoint-Virus-Version | vendor=fsecure engine=2.50.10432:,, definitions=2016-08-28_08:,, signatures=0 |
| X-Proofpoint-Spam-Details | rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608280143 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 59 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Pavel Emelyanov <xemul@virtuozzo.com>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Rapoport <rppt@linux.vnet.ibm.com> |
| X-Original-Date | Sun, 28 Aug 2016 17:37:46 +0300 |
| X-Original-Message-ID | <1472395067-24538-3-git-send-email-rppt@linux.vnet.ibm.com> |
| X-Original-References | <1472395067-24538-1-git-send-email-rppt@linux.vnet.ibm.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1471372 |
Show key headers only | View raw
With future addition of event tests, copy_page will be called with
different userfault file descriptors
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
---
tools/testing/selftests/vm/userfaultfd.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c
index 75540e7..c79c372 100644
--- a/tools/testing/selftests/vm/userfaultfd.c
+++ b/tools/testing/selftests/vm/userfaultfd.c
@@ -317,7 +317,7 @@ static void *locking_thread(void *arg)
return NULL;
}
-static int copy_page(unsigned long offset)
+static int copy_page(int ufd, unsigned long offset)
{
struct uffdio_copy uffdio_copy;
@@ -329,7 +329,7 @@ static int copy_page(unsigned long offset)
uffdio_copy.len = page_size;
uffdio_copy.mode = 0;
uffdio_copy.copy = 0;
- if (ioctl(uffd, UFFDIO_COPY, &uffdio_copy)) {
+ if (ioctl(ufd, UFFDIO_COPY, &uffdio_copy)) {
/* real retval in ufdio_copy.copy */
if (uffdio_copy.copy != -EEXIST)
fprintf(stderr, "UFFDIO_COPY error %Ld\n",
@@ -386,7 +386,7 @@ static void *uffd_poll_thread(void *arg)
offset = (char *)(unsigned long)msg.arg.pagefault.address -
area_dst;
offset &= ~(page_size-1);
- if (copy_page(offset))
+ if (copy_page(uffd, offset))
userfaults++;
}
return (void *)userfaults;
@@ -424,7 +424,7 @@ static void *uffd_read_thread(void *arg)
offset = (char *)(unsigned long)msg.arg.pagefault.address -
area_dst;
offset &= ~(page_size-1);
- if (copy_page(offset))
+ if (copy_page(uffd, offset))
(*this_cpu_userfaults)++;
}
return (void *)NULL;
@@ -438,7 +438,7 @@ static void *background_thread(void *arg)
for (page_nr = cpu * nr_pages_per_cpu;
page_nr < (cpu+1) * nr_pages_per_cpu;
page_nr++)
- copy_page(page_nr * page_size);
+ copy_page(uffd, page_nr * page_size);
return NULL;
}
--
1.9.1
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 2/3] userfaultfd: selftest: add ufd parameter to copy_page Mike Rapoport <rppt@linux.vnet.ibm.com> - 2016-08-28 16:40 +0200
csiph-web