int main(int argc, char *argv[]) { int lc; int size = 128, num = 3, unit = 1; unsigned long nmask[MAXNODES / BITS_PER_LONG] = { 0 }; unsigned int node; tst_parse_opts(argc, argv, ksm_options, ksm_usage); node = get_a_numa_node(tst_exit); set_node(nmask, node); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; check_ksm_options(&size, &num, &unit); if (set_mempolicy(MPOL_BIND, nmask, MAXNODES) == -1) { if (errno != ENOSYS) tst_brkm(TBROK | TERRNO, cleanup, "set_mempolicy"); else tst_brkm(TCONF, cleanup, "set_mempolicy syscall is not " "implemented on your system."); } create_same_memory(size, num, unit); write_cpusets(node); create_same_memory(size, num, unit); } cleanup(); tst_exit(); }
int main(int argc, char *argv[]) { int lc; char *msg; int size = 128, num = 3, unit = 1; unsigned long nnodes = 1; unsigned long nmask = 2; msg = parse_opts(argc, argv, ksm_options, ksm_usage); if (msg != NULL) tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg); nnodes = count_numa(); if (count_numa() <= 1) tst_brkm(TCONF, NULL, "required a NUMA system."); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { Tst_count = 0; check_ksm_options(&size, &num, &unit); write_memcg(); if (set_mempolicy(MPOL_BIND, &nmask, MAXNODES) == -1) { if (errno != ENOSYS) tst_brkm(TBROK|TERRNO, cleanup, "set_mempolicy"); else tst_brkm(TCONF, cleanup, "set_mempolicy syscall is not implemented on your system."); } create_same_memory(size, num, unit); write_cpusets(); create_same_memory(size, num, unit); } cleanup(); tst_exit(); }
int main(int argc, char *argv[]) { int lc; int size = 128, num = 3, unit = 1; tst_parse_opts(argc, argv, ksm_options, ksm_usage); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; check_ksm_options(&size, &num, &unit); create_same_memory(size, num, unit); } cleanup(); tst_exit(); }
int main(int argc, char *argv[]) { int lc; const char *msg; int size = 128, num = 3, unit = 1; msg = parse_opts(argc, argv, ksm_options, ksm_usage); if (msg != NULL) tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg); setup(); for (lc = 0; TEST_LOOPING(lc); lc++) { tst_count = 0; check_ksm_options(&size, &num, &unit); create_same_memory(size, num, unit); } cleanup(); tst_exit(); }
static void verify_ksm(void) { create_same_memory(size, num, unit); }