Lines Matching refs:npages
176 unsigned long npages) in hmm_dmirror_cmd() argument
184 cmd.npages = npages; in hmm_dmirror_cmd()
265 unsigned long npages) in hmm_migrate_sys_to_dev() argument
267 return hmm_dmirror_cmd(fd, HMM_DMIRROR_MIGRATE_TO_DEV, buffer, npages); in hmm_migrate_sys_to_dev()
272 unsigned long npages) in hmm_migrate_dev_to_sys() argument
274 return hmm_dmirror_cmd(fd, HMM_DMIRROR_MIGRATE_TO_SYS, buffer, npages); in hmm_migrate_dev_to_sys()
290 unsigned long npages; in TEST_F() local
297 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
298 ASSERT_NE(npages, 0); in TEST_F()
299 size = npages << self->page_shift; in TEST_F()
332 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
334 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
354 unsigned long npages; in TEST_F() local
360 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
361 ASSERT_NE(npages, 0); in TEST_F()
362 size = npages << self->page_shift; in TEST_F()
391 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
413 unsigned long npages; in TEST_F() local
419 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
420 ASSERT_NE(npages, 0); in TEST_F()
421 size = npages << self->page_shift; in TEST_F()
442 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
444 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
461 unsigned long npages; in TEST_F() local
467 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
468 ASSERT_NE(npages, 0); in TEST_F()
469 size = npages << self->page_shift; in TEST_F()
496 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
508 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
510 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
527 unsigned long npages; in TEST_F() local
535 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
536 ASSERT_NE(npages, 0); in TEST_F()
537 size = npages << self->page_shift; in TEST_F()
585 ret = hmm_dmirror_cmd(child_fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
587 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
605 unsigned long npages; in TEST_F() local
613 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
614 ASSERT_NE(npages, 0); in TEST_F()
615 size = npages << self->page_shift; in TEST_F()
663 ret = hmm_dmirror_cmd(child_fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
665 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
682 unsigned long npages; in TEST_F() local
707 npages = size >> self->page_shift; in TEST_F()
719 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
721 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
786 unsigned long npages; in TEST_F() local
799 npages = size >> self->page_shift; in TEST_F()
823 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
825 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
843 unsigned long npages; in TEST_F() local
851 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
852 ASSERT_NE(npages, 0); in TEST_F()
853 size = npages << self->page_shift; in TEST_F()
880 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
882 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
898 unsigned long npages; in TEST_F() local
906 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
907 ASSERT_NE(npages, 0); in TEST_F()
908 size = npages << self->page_shift; in TEST_F()
932 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
934 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
956 unsigned long npages; in TEST_F() local
962 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
963 ASSERT_NE(npages, 0); in TEST_F()
964 size = npages << self->page_shift; in TEST_F()
985 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
987 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1004 unsigned long npages; in TEST_F() local
1010 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1011 ASSERT_NE(npages, 0); in TEST_F()
1012 size = npages << self->page_shift; in TEST_F()
1033 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1035 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1046 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1048 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1060 unsigned long npages; in TEST_F() local
1066 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1067 ASSERT_NE(npages, 0); in TEST_F()
1068 size = npages << self->page_shift; in TEST_F()
1087 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1089 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1096 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_RELEASE, buffer, npages); in TEST_F()
1112 unsigned long npages; in TEST_F() local
1116 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1117 ASSERT_NE(npages, 0); in TEST_F()
1118 size = npages << self->page_shift; in TEST_F()
1135 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1147 unsigned long npages; in TEST_F() local
1154 npages = 6; in TEST_F()
1155 size = npages << self->page_shift; in TEST_F()
1174 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, npages); in TEST_F()
1239 unsigned long npages; in TEST_F() local
1246 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1247 ASSERT_NE(npages, 0); in TEST_F()
1248 size = npages << self->page_shift; in TEST_F()
1270 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1272 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1280 ret = hmm_migrate_dev_to_sys(self->fd, buffer, npages); in TEST_F()
1282 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1298 unsigned long npages; in TEST_F() local
1305 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1306 ASSERT_NE(npages, 0); in TEST_F()
1307 size = npages << self->page_shift; in TEST_F()
1330 npages); in TEST_F()
1332 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1360 unsigned long npages; in TEST_F() local
1365 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1366 ASSERT_NE(npages, 0); in TEST_F()
1367 size = npages << self->page_shift; in TEST_F()
1399 npages); in TEST_F()
1401 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1422 unsigned long npages; in TEST_F() local
1427 npages = 1; in TEST_F()
1428 size = npages << self->page_shift; in TEST_F()
1435 buffer->mirror = malloc(npages); in TEST_F()
1447 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
1449 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1464 unsigned long npages; in TEST_F() local
1472 npages = 7; in TEST_F()
1473 size = npages << self->page_shift; in TEST_F()
1480 buffer->mirror = malloc(npages); in TEST_F()
1534 ret = hmm_dmirror_cmd(self->fd0, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
1536 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1566 unsigned long npages; in TEST_F() local
1582 npages = size >> self->page_shift; in TEST_F()
1597 buffer->mirror = malloc(npages); in TEST_F()
1605 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
1607 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1611 for (i = 0; i < npages; ++i) in TEST_F()
1620 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
1622 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1626 for (i = 0; i < npages; ++i) in TEST_F()
1641 unsigned long npages; in TEST_F() local
1647 npages = 6; in TEST_F()
1648 size = npages << self->page_shift; in TEST_F()
1655 buffer->mirror = malloc(npages); in TEST_F()
1674 ret = hmm_dmirror_cmd(self->fd0, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
1676 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1684 ret = hmm_dmirror_cmd(self->fd1, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
1686 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1694 ret = hmm_migrate_sys_to_dev(self->fd1, buffer, npages); in TEST_F()
1696 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1698 ret = hmm_dmirror_cmd(self->fd0, HMM_DMIRROR_READ, buffer, npages); in TEST_F()
1700 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1716 unsigned long npages; in TEST_F() local
1722 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1723 ASSERT_NE(npages, 0); in TEST_F()
1724 size = npages << self->page_shift; in TEST_F()
1745 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_EXCLUSIVE, buffer, npages); in TEST_F()
1747 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1761 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_CHECK_EXCLUSIVE, buffer, npages); in TEST_F()
1770 unsigned long npages; in TEST_F() local
1776 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1777 ASSERT_NE(npages, 0); in TEST_F()
1778 size = npages << self->page_shift; in TEST_F()
1799 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_EXCLUSIVE, buffer, npages); in TEST_F()
1801 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1811 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_WRITE, buffer, npages); in TEST_F()
1823 unsigned long npages; in TEST_F() local
1829 npages = ALIGN(HMM_BUFFER_SIZE, self->page_size) >> self->page_shift; in TEST_F()
1830 ASSERT_NE(npages, 0); in TEST_F()
1831 size = npages << self->page_shift; in TEST_F()
1852 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_EXCLUSIVE, buffer, npages); in TEST_F()
1854 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1869 int npages, int size, int flags) in gup_test_exec() argument
1872 .nr_pages_per_call = npages, in gup_test_exec()
1897 unsigned long npages; in TEST_F() local
1908 npages = 4; in TEST_F()
1909 size = npages << self->page_shift; in TEST_F()
1930 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
1932 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1951 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
1953 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
1985 unsigned long npages; in TEST_F() local
1994 npages = 4; in TEST_F()
1995 size = npages << self->page_shift; in TEST_F()
2017 ret = hmm_migrate_sys_to_dev(self->fd, buffer, npages); in TEST_F()
2019 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
2045 ret = hmm_dmirror_cmd(self->fd, HMM_DMIRROR_SNAPSHOT, buffer, npages); in TEST_F()
2047 ASSERT_EQ(buffer->cpages, npages); in TEST_F()
2049 for (i = 0; i < npages; i++) in TEST_F()